Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (797 Bytes)

1 0a35a4ab Nikos Skalkotos
#! /bin/bash
2 c349d1b3 Nikos Skalkotos
3 c349d1b3 Nikos Skalkotos
### BEGIN TASK INFO
4 c349d1b3 Nikos Skalkotos
# Provides:		ResizeMounted
5 c349d1b3 Nikos Skalkotos
# RunBefore:            UmountImage
6 c349d1b3 Nikos Skalkotos
# RunAfter:		MountImage
7 c349d1b3 Nikos Skalkotos
# Short-Description:	Resize filesystem to use all the available space
8 c349d1b3 Nikos Skalkotos
### END TAST INFO
9 c349d1b3 Nikos Skalkotos
10 c349d1b3 Nikos Skalkotos
set -e
11 bad5ca1f Nikos Skalkotos
. "@commondir@/common.sh"
12 c349d1b3 Nikos Skalkotos
13 c349d1b3 Nikos Skalkotos
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
14 8704ee47 Nikos Skalkotos
    log_error "Target directory \`$SNF_IMAGE_TARGET' is missing"
15 c349d1b3 Nikos Skalkotos
fi
16 c349d1b3 Nikos Skalkotos
17 5d3735b5 Nikos Skalkotos
if [ "$SNF_IMAGE_TYPE" = "ntfsdump" ]; then
18 5d3735b5 Nikos Skalkotos
    # Write a diskpart script to %SystemDrive%\Windows\SnfScripts. Sysprep will
19 5d3735b5 Nikos Skalkotos
    # try to execute this script during the specialize pass.
20 5d3735b5 Nikos Skalkotos
    mkdir -p "$SNF_IMAGE_TARGET/Windows/SnfScripts"
21 5d3735b5 Nikos Skalkotos
    cat > "$SNF_IMAGE_TARGET/Windows/SnfScripts/ExtendFilesystem" <<EOF
22 c349d1b3 Nikos Skalkotos
select disk 0
23 c349d1b3 Nikos Skalkotos
select volume 1
24 c349d1b3 Nikos Skalkotos
extend filesystem
25 c349d1b3 Nikos Skalkotos
exit
26 c349d1b3 Nikos Skalkotos
EOF
27 5d3735b5 Nikos Skalkotos
fi
28 c349d1b3 Nikos Skalkotos
29 c349d1b3 Nikos Skalkotos
cleanup
30 c349d1b3 Nikos Skalkotos
trap - EXIT
31 c349d1b3 Nikos Skalkotos
32 c349d1b3 Nikos Skalkotos
exit 0
33 c349d1b3 Nikos Skalkotos
34 c349d1b3 Nikos Skalkotos
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :