From 9934fafc055c9c827821f5162d22e20ccbd74779 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Tue, 19 Jul 2016 14:04:15 +0200 Subject: [PATCH] rootfsinstall: -L option to specify the volume label for system partition --- src/rootfsinstall.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/rootfsinstall.sh b/src/rootfsinstall.sh index 2688336..f7078c6 100755 --- a/src/rootfsinstall.sh +++ b/src/rootfsinstall.sh @@ -8,6 +8,7 @@ SYSTEMFSTYPE=ext4 # All targets are arm currently TARGET_ARCH=arm +VOLUME_LABEL="openmamba" function usage() { echo "Usage: $0 device rootfs-archive [-bpi|-cubox|-rpi] [-a archive] [-c command] [-fs fstype] [-k kernel] [-p password] [-y]" @@ -28,6 +29,7 @@ function usage() { echo "-k2 kernel : extract and use specified second kernel file from ROOTFS/boot/ for boot" echo "-i packages : install packages using package manager in chroot" echo "-l : force local installation only; don't perform installation from network" + echo "-L : rootfs volume label (default: 'openmamba')" echo "-p password : set given password for root user" echo "-r mode : set given default video mode where applicable (e.g. -r 1920x1080-32@60)" echo "-y : assume yes to all questions (script mode)" @@ -108,6 +110,13 @@ while [ "$1" ]; do shift ;; -l) LOCALONLY=1 ;; + -L) [ "$2" ] || { + echo "Error: -L option requires a volume label as argument; aborting." + exit 1 + } + VOLUME_LABEL="$2" + shift + ;; -p) [ "$2" ] || { echo "Error: -p option requires a password as argument; aborting." exit 1 @@ -254,7 +263,7 @@ if [ "$BOOTFSTYPE" ]; then fi echo "Formatting $PARTITION2 ($SYSTEMFSTYPE)..." -mke2fs -q -F -t $SYSTEMFSTYPE -j -L "openmamba" $PARTITION2 || { +mke2fs -q -F -t $SYSTEMFSTYPE -j -L "$VOLUME_LABEL" $PARTITION2 || { echo "ERROR: unable to format $PARTITION2; aborting." exit 1 }