diff options
author | David Oberhollenzer <goliath@infraroot.at> | 2019-03-29 18:31:45 +0100 |
---|---|---|
committer | David Oberhollenzer <goliath@infraroot.at> | 2019-03-29 18:31:45 +0100 |
commit | 36c14c147d17b124fd80fb473780536bf459d868 (patch) | |
tree | 104d4aceaa464bd7e78392853bdd1647aa467c61 | |
parent | 98d5ba81be3b2eafa3865e727b058d3bce11e806 (diff) |
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>
-rwxr-xr-x | scripts/overlay.sh | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/scripts/overlay.sh b/scripts/overlay.sh index 090671c..e98c442 100755 --- a/scripts/overlay.sh +++ b/scripts/overlay.sh @@ -5,17 +5,7 @@ upper=/cfg/overlay/${1} work=/cfg/overlay/${1}_work target=${2} -if [ ! -d "$target" ]; then - exit -fi - -if [ -d "$lower" ]; then - if [ -d "$upper" ]; then - mkdir -p "$work" - mount -t overlay overlay \ - -olowerdir=${lower},upperdir=${upper},workdir=${work} \ - ${target} - else - mount --bind "$lower" "$target" - fi -fi +mkdir -p "$work" "$upper" +mount -t overlay overlay \ + -olowerdir=${lower},upperdir=${upper},workdir=${work} \ + "$target" |