summaryrefslogtreecommitdiffstats
path: root/projectroot/usr/sbin/fake-overlayfs
diff options
context:
space:
mode:
Diffstat (limited to 'projectroot/usr/sbin/fake-overlayfs')
-rw-r--r--projectroot/usr/sbin/fake-overlayfs26
1 files changed, 26 insertions, 0 deletions
diff --git a/projectroot/usr/sbin/fake-overlayfs b/projectroot/usr/sbin/fake-overlayfs
new file mode 100644
index 000000000..b6692c578
--- /dev/null
+++ b/projectroot/usr/sbin/fake-overlayfs
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+OVERLAY_DIRS="@OVERLAY_DIRLIST@"
+
+bdir=/tmp/.fake-overlay-root
+
+mkdir $bdir
+mount -o bind,private / $bdir
+mount -o remount,ro,bind,private / $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
+rmdir $bdir
+