From: Frederick Grose Date: Sun, 9 Apr 2017 01:01:19 +0000 (-0400) Subject: dmsquash-live-root: Avoid mount source conflict on $BASE_LOOPDEV. X-Git-Tag: 046~73^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F217%2Fhead;p=thirdparty%2Fdracut.git dmsquash-live-root: Avoid mount source conflict on $BASE_LOOPDEV. The newer mount utilities are more strict about directly shared devices. For OverlayFS boots, which mount $BASE_LOOPDEV directly, avoid a mount error by indirectly sharing the read-only base filesystem through a second, over-attached $BASE_LOOPDEV for the DM live-base target. --- diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh index 264983f59..3a25465c6 100755 --- a/modules.d/90dmsquash-live/dmsquash-live-root.sh +++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh @@ -241,7 +241,12 @@ do_live_overlay() { fi # Create a device that always points to a ro base image - echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create --readonly live-base + if [ -n "$overlayfs" ]; then + BASE_LOOPDUP=$(losetup -f --show -r $BASE_LOOPDEV) + echo 0 $sz linear $BASE_LOOPDUP 0 | dmsetup create --readonly live-base + else + echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create --readonly live-base + fi } # we might have a genMinInstDelta delta file for anaconda to take advantage of