Statistics
| Branch: | Tag: | Revision:

root / snf-image-helper / tasks / 40ResizeMounted.in @ aa4fc6bb

History | View | Annotate | Download (795 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
. @commondir@/common.sh
12

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

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

    
29
cleanup
30
trap - EXIT
31

    
32
exit 0
33

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