#! /bin/bash # Copyright (C) 2011 GRNET S.A. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. ### BEGIN TASK INFO # Provides: FilesystemResizeMounted # RunBefore: UmountImage # RunAfter: InstallUnattend # Short-Description: Resize filesystem to use all the available space ### END TASK INFO set -e . "@commondir@/common.sh" # Check if the task should be prevented from running. check_if_excluded if [ ! -d "$SNF_IMAGE_TARGET" ]; then log_error "Target directory \`$SNF_IMAGE_TARGET' is missing" fi if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" != "windows" ]; then exit 0 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. cat > "$SNF_IMAGE_TARGET/Windows/SnfScripts/ExtendFilesystem" <