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