]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
add readonly overlay support for dmsquash
authorJoey Boggs <jboggs@redhat.com>
Fri, 26 Feb 2010 14:44:29 +0000 (09:44 -0500)
committerHarald Hoyer <harald@redhat.com>
Thu, 4 Mar 2010 13:06:47 +0000 (14:06 +0100)
Adds the readonly_overlay karg for cases where the dm snapshot should be set to readonly. Use case would be a livecd that is configured to have a readonly root where filling up the dm snapshot would cause a problem.

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

index acec91d68ceb667abb827b3c99552d12ef6b7cb5..f40e04870133874f598073299469918adfd469d3 100755 (executable)
@@ -20,6 +20,7 @@ live_dir=$(getarg live_dir)
 [ -z "$live_dir" ] && live_dir="LiveOS"
 getarg live_ram && live_ram="yes"
 getarg reset_overlay && reset_overlay="yes"
+getarg readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
 overlay=$(getarg overlay)
 
 # FIXME: we need to be able to hide the plymouth splash for the check really
@@ -95,7 +96,7 @@ do_live_overlay() {
     fi
 
     # set up the snapshot
-    echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create live-rw
+    echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create $readonly_overlay live-rw
 }
 
 # live cd helper function