dmsquash-live-root: Manage absent overlayfs module better.

die when required; systemctl reload otherwise.
master
Frederick Grose 2018-09-03 19:02:23 -04:00 committed by Harald Hoyer
parent a7d8fc280c
commit 44d1688164
1 changed files with 16 additions and 10 deletions

View File

@ -146,10 +146,10 @@ do_live_overlay() {
[ -d /run/initramfs/overlayfs/ovlwork ]; then
ln -s /run/initramfs/overlayfs/overlayfs /run/overlayfs$opt
ln -s /run/initramfs/overlayfs/ovlwork /run/ovlwork$opt
if [ -z "$overlayfs" ]; then
overlayfs="yes"
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit=":>/xor_overlayfs;"
if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then
reloadsysrootmountunit=":>/xor_overlayfs;"
fi
overlayfs="required"
setup="yes"
fi
fi
@ -157,18 +157,24 @@ do_live_overlay() {
[ -d /run/initramfs/overlayfs$pathspec/../ovlwork ]; then
ln -s /run/initramfs/overlayfs$pathspec /run/overlayfs$opt
ln -s /run/initramfs/overlayfs$pathspec/../ovlwork /run/ovlwork$opt
if [ -z "$overlayfs" ]; then
overlayfs="yes"
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit=":>/xor_overlayfs;"
if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then
reloadsysrootmountunit=":>/xor_overlayfs;"
fi
overlayfs="required"
setup="yes"
fi
fi
if [ -n "$overlayfs" ]; then
modprobe overlay
if [ $? != 0 ]; then
if [ "$overlayfs" = required ]; then
die "OverlayFS is required but not available."
exit 1
fi
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit=":>/xor_overlayfs;"
m='OverlayFS is not available; using temporary Device-mapper overlay.'
unset -v overlayfs setup reloadsysrootmountunit
info $m
unset -v overlayfs setup
fi
fi

@ -302,10 +308,10 @@ if [ -e "$SQUASHED" ]; then
fi
elif [ -d /run/initramfs/squashfs/proc ]; then
FSIMG=$SQUASHED
if [ -z "$overlayfs" ]; then
overlayfs="yes"
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit=":>/xor_overlayfs;"
if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then
reloadsysrootmountunit=":>/xor_overlayfs;"
fi
overlayfs="required"
else
die "Failed to find a root filesystem in $SQUASHED."
exit 1