Blame 0006-dmsquash-live-add-dev-mapper-live-base.patch

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