summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2010-01-29 14:14:03 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2010-02-11 11:23:02 +0100
commit36bd0029f312865485f5ffa30022c79163763a18 (patch)
treee460c8bbdae7ef2501ae5ee25d8889c54e2139ca /generic
parent2b9c916f6727cf9ac2ad652b9b0928983ffe8962 (diff)
downloadptxdist-36bd0029f312865485f5ffa30022c79163763a18.tar.gz
ptxdist-36bd0029f312865485f5ffa30022c79163763a18.tar.xz
[fake-overlayfs] added new package
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'generic')
-rw-r--r--generic/etc/init.d/fake-overlayfs46
1 files changed, 46 insertions, 0 deletions
diff --git a/generic/etc/init.d/fake-overlayfs b/generic/etc/init.d/fake-overlayfs
new file mode 100644
index 000000000..b6cf8c000
--- /dev/null
+++ b/generic/etc/init.d/fake-overlayfs
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+#
+# /etc/init.d/fake-overlay
+#
+
+OVERLAY_DIRS="@OVERLAY_DIRLIST@"
+
+bdir=/tmp/.fake-overlay-root
+
+fake_overlay() {
+ mkdir $bdir
+ mount -o bind / $bdir
+ IFS=:
+ set $OVERLAY_DIRS
+ while [ $# -gt 0 ]; do
+ if [ -z "$1" ]; then
+ shift
+ continue
+ fi
+ echo $1
+ src="$bdir$1"
+ dst="$1/"
+ test -e "$dst" || mkdir $dst
+ cp -a "$src/"* "$src/".[^.]* "$src/"..?* $dst 2> /dev/null
+ shift
+ done
+ umount $bdir
+}
+
+#
+# Main
+#
+
+case $1 in
+
+ start)
+ echo "${PREFIX}copying files to tmpfs..."
+ fake_overlay
+ ;;
+ stop)
+ ;;
+ *)
+ echo "Usage: $0 [start|stop]"
+ ;;
+esac