busybox-initramfs: init: add kernel commandline parameter: overlay

Adds a new kernel commandline parameter: overlay , which enables multiple
clients to use a single configuration file while keeping their storage mounts
separate. For the given example, the storage mounts will be under
/var/lib/overlay/<mac-address>
This will only work with mount types which support subdirectory mounts.

Example usage: disk=NFS=192.168.1.1:/var/lib/overlay overlay

Signed-off-by: Alain Kalker <a.c.kalker@gmail.com>
This commit is contained in:
Alain Kalker 2012-03-19 18:55:38 +01:00
parent cd052262f8
commit b68c832489

View File

@ -60,6 +60,9 @@ NBD_DEVS="0"
fastboot)
FASTBOOT=yes
;;
overlay)
OVERLAY=yes
;;
break=*)
BREAK="${arg#*=}"
;;
@ -220,6 +223,14 @@ NBD_DEVS="0"
progress "Mounting disks"
mount_part "$boot" "/flash" "ro,noatime"
mount_part "$disk" "/storage" "rw,noatime"
[ -z "$OVERLAY" ] && return
OVERLAY_DIR=`cat /sys/class/net/eth0/address | /bin/busybox tr -d :`
if [ ! -d /storage/$OVERLAY_DIR ]; then
mkdir /storage/$OVERLAY_DIR
fi
/bin/busybox umount /storage
mount_part "$disk/$OVERLAY_DIR" "/storage" "rw,noatime"
}
check_update() {