#! /bin/bash ### BEGIN TASK INFO # Provides: FilesystemResizeMounted # RunBefore: UmountImage # RunAfter: MountImage # Short-Description: Resize filesystem to use all the available space ### END TASK INFO set -e . "@commondir@/common.sh" if [ ! -d "$SNF_IMAGE_TARGET" ]; then log_error "Target directory \`$SNF_IMAGE_TARGET' is missing" fi last_partition=$(get_last_partition "$SNF_IMAGE_DEV") id=$(echo "$last_partition" | cut -d: -f1) ptype=$(echo "$last_partition" | cut -d: -f5) if [ "$ptype" = "ntfs" ]; then # Write a diskpart script to %SystemDrive%\Windows\SnfScripts. Sysprep will # try to execute this script during the specialize pass. mkdir -p "$SNF_IMAGE_TARGET/Windows/SnfScripts" cat > "$SNF_IMAGE_TARGET/Windows/SnfScripts/ExtendFilesystem" <