1
0
Fork 0
mirror of https://github.com/pygos/init-scripts.git synced 2024-11-14 17:07:11 +01:00
init-scripts/scripts/overlay.sh
David Oberhollenzer 36c14c147d Cleanup overlay script
- Create the upper and work dirs if they don't exist yet.
 - If the target doesn't exist, let it fail. The configuration
   is bonkers.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-29 18:31:45 +01:00

11 lines
232 B
Bash
Executable file

#!/bin/sh
lower=/cfg/preserve/${1}
upper=/cfg/overlay/${1}
work=/cfg/overlay/${1}_work
target=${2}
mkdir -p "$work" "$upper"
mount -t overlay overlay \
-olowerdir=${lower},upperdir=${upper},workdir=${work} \
"$target"