summaryrefslogtreecommitdiffstats
path: root/generic/sbin/fake-overlayfs
blob: 5e3c44314d1667dbba7c718faed29ddb72cc09c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

OVERLAY_DIRS="@OVERLAY_DIRLIST@"

bdir=/tmp/.fake-overlay-root

mkdir $bdir
mount -o bind,ro / $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