core: create workdir/upperdir when mounting a Type=overlay mount unit
So far we created the target directory, and the source for bind mounts, but not workdir/upperdir for overlays, so it has to be done separately and strictly before the unit is started, which is annoying. Check the options when creating directories, and if upper/work directories are specified, create them.
This commit is contained in:
committed by
Yu Watanabe
parent
fe6e0cfa19
commit
6c75eff6af
@@ -149,3 +149,9 @@ touch "$WORK_DIR/mnt/foo/baz"
|
||||
systemd-umount "$WORK_DIR/mnt/foo"
|
||||
test -d "$WORK_DIR/mnt/foo/bar"
|
||||
test ! -e "$WORK_DIR/mnt/foo/baz"
|
||||
|
||||
# overlay
|
||||
systemd-mount --type=overlay --options="lowerdir=/etc,upperdir=$WORK_DIR/upper,workdir=$WORK_DIR/work" /etc "$WORK_DIR/overlay"
|
||||
touch "$WORK_DIR/overlay/foo"
|
||||
test -e "$WORK_DIR/upper/foo"
|
||||
systemd-umount "$WORK_DIR/overlay"
|
||||
|
||||
Reference in New Issue
Block a user