busybox-initramfs: init: Allow overlay mount for mount types with parameters

This fixes overlay mount so it doesn't add $OVERLAY_DIR at the end of the
parameter list.
Kernel commandline parameter 'overlay' should now work for both NFS and
CIFS/SMB mounts, but alas, busybox CIFS mount doesn't (yet) support subdir
mounts (regular mount does). Leaving this in for posterity.

Signed-off-by: Alain Kalker <a.c.kalker@gmail.com>
This commit is contained in:
Alain Kalker 2012-03-20 19:57:09 +01:00
parent 03fcc58fae
commit 56b29979f6

View File

@ -249,7 +249,17 @@ NBD_DEVS="0"
mkdir /storage/$OVERLAY_DIR mkdir /storage/$OVERLAY_DIR
fi fi
/bin/busybox umount /storage /bin/busybox umount /storage
mount_part "$disk/$OVERLAY_DIR" "/storage" "rw,noatime"
# split $disk into $target,$options so we can append $OVERLAY_DIR
options="${disk#*,}"
target="${disk%%,*}"
if [ "$options" = "$disk" ]; then
disk="$target/$OVERLAY_DIR"
else
disk="$target/$OVERLAY_DIR,$options"
fi
mount_part "$disk" "/storage" "rw,noatime"
} }
check_update() { check_update() {