#! /bin/bash ### BEGIN TASK INFO # Provides: FilesystemResizeUnmounted # RunBefore: MountImage # RunAfter: FixPartitionTable # Short-Description: Resize filesystem to use all the available space ### END TASK INFO set -e . "@commondir@/common.sh" if [ ! -b "$SNF_IMAGE_DEV" ]; then log_error "Device file:\`${SNF_IMAGE_DEV}' is not a block device" 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" == ext[234] ]]; then device="${SNF_IMAGE_DEV}${id}" "$RESIZE2FS" "$device" fi exit 0 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :