]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Look for btrfs.img in dmsquash-live-root
authorWill Woods <wwoods@redhat.com>
Tue, 8 Mar 2011 23:35:16 +0000 (18:35 -0500)
committerHarald Hoyer <harald@redhat.com>
Wed, 9 Mar 2011 11:09:34 +0000 (12:09 +0100)
Btrfs is an excellent option for the root fs image for live systems,
especially since it does its own transparent compression.

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

index 95ef05dc3fe5fc8ef657274740434efe46b3971e..f8aa805ae42459d490048c81d2bb6a8cf7bcc84f 100755 (executable)
@@ -127,6 +127,8 @@ fi
 # we might have an embedded fs image to use as rootfs (uncompressed live)
 if [ -e /dev/.initramfs/live/${live_dir}/ext3fs.img ]; then
     FSIMG="/dev/.initramfs/live/${live_dir}/ext3fs.img"
+elif [ -e /dev/.initramfs/live/${live_dir}/btrfs.img ]; then
+    FSIMG="/dev/.initramfs/live/${live_dir}/btrfs.img"
 fi
 
 if [ -n "$FSIMG" ] ; then
@@ -158,7 +160,11 @@ if [ -e "$SQUASHED" ] ; then
     mount -n -t squashfs -o ro $SQUASHED_LOOPDEV /squashfs
 
     BASE_LOOPDEV=$( losetup -f )
-    losetup -r $BASE_LOOPDEV /squashfs/LiveOS/ext3fs.img
+    if [ -f /squashfs/LiveOS/ext3fs.img ]; then
+        losetup -r $BASE_LOOPDEV /squashfs/LiveOS/ext3fs.img
+    elif [ -f /squashfs/LiveOS/btrfs.img ]; then
+        losetup -r $BASE_LOOPDEV /squashfs/LiveOS/btrfs.img
+    fi
 
     umount -l /squashfs