From b68c8324892eeb86da41de6cad460616e60ad966 Mon Sep 17 00:00:00 2001 From: Alain Kalker Date: Mon, 19 Mar 2012 18:55:38 +0100 Subject: [PATCH] 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/ 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 --- .../initramfs/sysutils/busybox-initramfs/scripts/init | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/initramfs/sysutils/busybox-initramfs/scripts/init b/packages/initramfs/sysutils/busybox-initramfs/scripts/init index 8b329c28d6..e0a3a4811b 100755 --- a/packages/initramfs/sysutils/busybox-initramfs/scripts/init +++ b/packages/initramfs/sysutils/busybox-initramfs/scripts/init @@ -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() {