]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dmsquash-live: add /dev/mapper/live-base
authorBrian C. Lane <bcl@redhat.com>
Tue, 8 Oct 2013 13:13:44 +0000 (15:13 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 8 Oct 2013 13:13:44 +0000 (15:13 +0200)
This is similar to the reason for adding the
/run/initramfs/live-baseloop symlink -- access to the original live
image without overlays.

livemedia-creator does not create a osmin.img, so there is no mountable
device for it to use when rsyncing the live image to the target. It
needs a device that points to the original live image without overlays.

Note that lmc won't be creating osmin.img, since really isn't needed any
longer. Its purpose was to provide a minimal image that could be dd'd to
the target. Now that we use rsync this is no longer necessary.

The included patch adds a /dev/mapper/live-base device that Anaconda can
use whether or not there is an osmin present.

modules.d/90dmsquash-live/dmsquash-live-root.sh

index 8951f80cf9b75adef9fece078fd9ae4fd2c32400..5705e8df90db96be0f9562c7afa09099037e8e3c 100755 (executable)
@@ -144,6 +144,9 @@ do_live_overlay() {
         over=$OVERLAY_LOOPDEV
     fi
     echo 0 $sz snapshot $base $over p 8 | dmsetup create live-rw
+
+    # Create a device that always points to a ro base image
+    echo 0 $sz linear $base 0 | dmsetup create --readonly live-base
 }
 
 # live cd helper function
@@ -225,9 +228,6 @@ if [ -n "$ROOTFLAGS" ]; then
     ROOTFLAGS="-o $ROOTFLAGS"
 fi
 
-if [ -b "$BASE_LOOPDEV" ]; then
-    ln -s $BASE_LOOPDEV /run/initramfs/live-baseloop
-fi
 ln -s /dev/mapper/live-rw /dev/root
 printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh