forked from dracutdevs/dracut
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(overlayfs): split overlayfs mount in two steps (bsc#1219778)
This commit splits the creation of required overlayfs underlaying directories and the actual overlayfs mount. This way it is still possible to mount the overlayfs with the generated sysroot.mount that dmsquash-live creates. The overlayfs tree is created in a pre-mount hook so it is executed before sysroot.mount is started. Otherwise sysroot.mount starts and fails before mount hooks are executed. Signed-off-by: David Cassany <dcassany@suse.com> (cherry picked from commit bddffed)
- Loading branch information
1 parent
3e9a746
commit 7962d6b
Showing
3 changed files
with
22 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh | ||
|
||
getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes" | ||
getargbool 0 rd.live.overlay.reset -d -y reset_overlay && reset_overlay="yes" | ||
|
||
if [ -n "$overlayfs" ]; then | ||
if ! [ -e /run/rootfsbase ]; then | ||
mkdir -m 0755 -p /run/rootfsbase | ||
mount --bind "$NEWROOT" /run/rootfsbase | ||
fi | ||
|
||
mkdir -m 0755 -p /run/overlayfs | ||
mkdir -m 0755 -p /run/ovlwork | ||
if [ -n "$reset_overlay" ] && [ -h /run/overlayfs ]; then | ||
ovlfsdir=$(readlink /run/overlayfs) | ||
info "Resetting the OverlayFS overlay directory." | ||
rm -r -- "${ovlfsdir:?}"/* "${ovlfsdir:?}"/.* > /dev/null 2>&1 | ||
fi | ||
fi |