Blame SOURCES/0261-dmsquash-live-setup-the-images-in-run-initramfs.patch

712866
From 23e3c7f95f7747375fdda20e0dfac10bc7a8920f Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Tue, 16 Dec 2014 12:53:18 +0100
712866
Subject: [PATCH] dmsquash-live: setup the images in /run/initramfs
712866
712866
We want to cleanup / after switch_root. Placing the loop files in /
712866
works, but it is more sane to put them in /run/initramfs
712866
712866
(cherry picked from commit 1f8abe81a9fca0f44c63bf3bd30a7f7fbec28642)
712866
---
712866
 modules.d/90dmsquash-live/dmsquash-live-root.sh | 12 ++++++------
712866
 1 file changed, 6 insertions(+), 6 deletions(-)
712866
712866
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh
5c6c2a
index 0645a0bd..12354f42 100755
712866
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
712866
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
712866
@@ -189,9 +189,9 @@ fi
712866
 
712866
 if [ -n "$OSMINSQFS" ]; then
712866
     # decompress the delta data
712866
-    dd if=$OSMINSQFS of=/osmin.img 2> /dev/null
712866
+    dd if=$OSMINSQFS of=/run/initramfs/osmin.img 2> /dev/null
712866
     OSMIN_SQUASHED_LOOPDEV=$( losetup -f )
712866
-    losetup -r $OSMIN_SQUASHED_LOOPDEV /osmin.img
712866
+    losetup -r $OSMIN_SQUASHED_LOOPDEV /run/initramfs/osmin.img
712866
     mkdir -m 0755 -p /run/initramfs/squashfs.osmin
712866
     mount -n -t squashfs -o ro $OSMIN_SQUASHED_LOOPDEV /run/initramfs/squashfs.osmin
712866
     OSMIN_LOOPDEV=$( losetup -f )
712866
@@ -212,8 +212,8 @@ if [ -n "$FSIMG" ] ; then
712866
     if [ -n "$writable_fsimg" ] ; then
712866
         # mount the provided fileysstem read/write
712866
         echo "Unpacking live filesystem (may take some time)"
712866
-        unpack_archive $FSIMG /tmp/fsimg/
712866
-        losetup $BASE_LOOPDEV /tmp/fsimg/rootfs.img
712866
+        unpack_archive $FSIMG /run/initramfs/fsimg/
712866
+        losetup $BASE_LOOPDEV /run/initramfs/fsimg/rootfs.img
712866
         echo "0 $( blockdev --getsize $BASE_LOOPDEV ) linear $BASE_LOOPDEV 0" | dmsetup create live-rw
712866
     else
712866
         # mount the filesystem read-only and add a dm snapshot for writes
712866
@@ -231,10 +231,10 @@ if [ -e "$SQUASHED" ] ; then
712866
     if [ -n "$live_ram" ] ; then
712866
         echo "Copying live image to RAM..."
712866
         echo "(this may take a few minutes)"
712866
-        dd if=$SQUASHED of=/squashed.img bs=512 2> /dev/null
712866
+        dd if=$SQUASHED of=/run/initramfs/squashed.img bs=512 2> /dev/null
712866
         umount -n /run/initramfs/live
712866
         echo "Done copying live image to RAM."
712866
-        SQUASHED="/squashed.img"
712866
+        SQUASHED="/run/initramfs/squashed.img"
712866
     fi
712866
 
712866
     SQUASHED_LOOPDEV=$( losetup -f )