Statistics
| Branch: | Tag: | Revision:

root / helper / tasks / 40ResizeMounted.sh @ 0a35a4ab

History | View | Annotate | Download (743 Bytes)

1
#! /bin/bash
2

    
3
### BEGIN TASK INFO
4
# Provides:		ResizeMounted
5
# RunBefore:            UmountImage
6
# RunAfter:		MountImage
7
# Short-Description:	Resize filesystem to use all the available space
8
### END TAST INFO
9

    
10
set -e
11
. /usr/share/snf-image/common.sh
12

    
13
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
14
    log_error "Target directory \`$SNF_IMAGE_TARGET\' is missing"
15
fi
16

    
17
# Write a diskpart script to %SystemDrive%\Windows\SnfScripts. Sysprep will
18
# try to execute this script during the specialize pass.
19
mkdir -p "$SNF_IMAGE_TARGET/Windows/SnfScripts"
20
cat > "$SNF_IMAGE_TARGET/Windows/SnfScripts/ExtendFilesystem" <<EOF
21
select disk 0
22
select volume 1
23
extend filesystem
24
exit
25
EOF
26

    
27
cleanup
28
trap - EXIT
29

    
30
exit 0
31

    
32
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
33