Blame SOURCES/0024-dmsquash-live-add-dev-mapper-live-base.patch

18971c
From 86fff83927ad194def97c60c2eef80099ebb1238 Mon Sep 17 00:00:00 2001
18971c
From: "Brian C. Lane" <bcl@redhat.com>
18971c
Date: Tue, 8 Oct 2013 15:13:44 +0200
18971c
Subject: [PATCH] dmsquash-live: add /dev/mapper/live-base
18971c
18971c
This is similar to the reason for adding the
18971c
/run/initramfs/live-baseloop symlink -- access to the original live
18971c
image without overlays.
18971c
18971c
livemedia-creator does not create a osmin.img, so there is no mountable
18971c
device for it to use when rsyncing the live image to the target. It
18971c
needs a device that points to the original live image without overlays.
18971c
18971c
Note that lmc won't be creating osmin.img, since really isn't needed any
18971c
longer. Its purpose was to provide a minimal image that could be dd'd to
18971c
the target. Now that we use rsync this is no longer necessary.
18971c
18971c
The included patch adds a /dev/mapper/live-base device that Anaconda can
18971c
use whether or not there is an osmin present.
18971c
---
18971c
 modules.d/90dmsquash-live/dmsquash-live-root.sh | 6 +++---
18971c
 1 file changed, 3 insertions(+), 3 deletions(-)
18971c
18971c
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh
18971c
index 8951f80c..5705e8df 100755
18971c
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
18971c
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
18971c
@@ -144,6 +144,9 @@ do_live_overlay() {
18971c
         over=$OVERLAY_LOOPDEV
18971c
     fi
18971c
     echo 0 $sz snapshot $base $over p 8 | dmsetup create live-rw
18971c
+
18971c
+    # Create a device that always points to a ro base image
18971c
+    echo 0 $sz linear $base 0 | dmsetup create --readonly live-base
18971c
 }
18971c
 
18971c
 # live cd helper function
18971c
@@ -225,9 +228,6 @@ if [ -n "$ROOTFLAGS" ]; then
18971c
     ROOTFLAGS="-o $ROOTFLAGS"
18971c
 fi
18971c
 
18971c
-if [ -b "$BASE_LOOPDEV" ]; then
18971c
-    ln -s $BASE_LOOPDEV /run/initramfs/live-baseloop
18971c
-fi
18971c
 ln -s /dev/mapper/live-rw /dev/root
18971c
 printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh
18971c