Commit 365b2ed3 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Add support for resizing OpenBSD UFS file systems

parent de34e7aa
......@@ -34,6 +34,8 @@ CHNTPW=chntpw
SGDISK=sgdisk
GROWFS_UFS=growfs.ufs
DUMPFS_UFS=dumpfs.ufs
GROWFS_OPENBSD=growfs.openbsd
DUMPFS_OPENBSD=dumpfs.openbsd
DATE="date -u" # Time in UTC
EATMYDATA=eatmydata
MOUNT="mount -n"
......
......@@ -36,6 +36,21 @@ if [ ! -b "$SNF_IMAGE_DEV" ]; then
log_error "Device file:\`${SNF_IMAGE_DEV}' is not a block device"
fi
if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = openbsd ]; then
part="${SNF_IMAGE_DEV}$(@scriptsdir@/disklabel.py --print-last-linux "$SNF_IMAGE_DEV")"
# If this fails the script will stop
$DUMPFS_OPENBSD "$part" > /dev/null
$GROWFS_OPENBSD -y "$part"
exit 0
fi
if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = netbsd ]; then
warn "File system resizing currently not supported for NetBSD"
exit 0
fi
if [ -z "$SNF_IMAGE_RESIZE_PART" ]; then
warn "No partition chosen for resize"
exit 0
......@@ -45,12 +60,6 @@ if [ "x$SNF_IMAGE_PROPERTY_DO_SYNC" = "xyes" ]; then
unset EATMYDATA
fi
if [[ "$SNF_IMAGE_PROPERTY_OSFAMILY" =~ (net)|(open)bsd ]]; then
os=${SNF_IMAGE_PROPERTY_OSFAMILY^^[bsd]}
warn "File sytem resizing currently not supported for ${os^?}"
exit 0
fi
table=$(get_partition_table "$SNF_IMAGE_DEV")
partition=$(get_partition_by_num "$table" "$SNF_IMAGE_RESIZE_PART")
id=$(cut -d: -f1 <<< "$partition")
......
......@@ -34,7 +34,7 @@ suite=wheezy/
components=
[Helper]
packages=ufsutils linux-image-3.2.0-4-amd64 python-bcrypt
packages=ufsutils linux-image-3.2.0-4-amd64 python-bcrypt openbsd-utils
# Don't change the parameters below unless you really know what you are doing.
# The /'s and the empty `componets' variable are needed when working with apt.
source=http://apt.dev.grnet.gr/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment