Skip to contentSkip to conversation

add live_readonly karg to mount /dev/mapper/live-rw as readonly

PATCH In review Joey Boggs 2 participants 2 messages Mar 4, 2010 – Mar 5, 2010 1 message not in the archive

lore
Share & tools
lore

Joey Boggs

author
#0 lore raw

PATCH 1/1 add live_readonly karg to mount /dev/mapper/live-rw as readonly

This will allow live cd based images to utilize a readonly root file system.

---
 modules.d/90dmsquash-live/dmsquash-live-root |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
modules.d/90dmsquash-live/dmsquash-live-root +2 -1
index e2e3ef8..7457e2c 100755
@@ -21,6 +21,7 @@ live_dir=$(getarg live_dir)
 getarg live_ram && live_ram="yes"
 getarg reset_overlay && reset_overlay="yes"
 getarg readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
+getarg live_readonly && live_readonly="-o ro" || live_readonly=""
 overlay=$(getarg overlay)
 
 # FIXME: we need to be able to hide the plymouth splash for the check really
@@ -173,6 +174,6 @@ if [ -b "$OSMIN_LOOPDEV" ]; then
 fi
 
 ln -s /dev/mapper/live-rw /dev/root
-printf '/bin/mount /dev/mapper/live-rw %s\n' "$NEWROOT" > /mount/01-$$-live.sh
+printf '/bin/mount %s /dev/mapper/live-rw %s\n' "$live_readonly" "$NEWROOT" > /mount/01-$$-live.sh
 
 exit 0
Signature · 1 line
1.6.6.1
#2 lore raw
In reply to a message not in the archive
Quoted 19 lines · Joey Boggs

This will allow live cd based images to utilize a readonly root file system.

---
  modules.d/90dmsquash-live/dmsquash-live-root |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
modules.d/90dmsquash-live/dmsquash-live-root +1 -0
index e2e3ef8..7457e2c 100755
@@ -21,6 +21,7 @@ live_dir=$(getarg live_dir)
  getarg live_ram&&  live_ram="yes"
  getarg reset_overlay&&  reset_overlay="yes"
  getarg readonly_overlay&&  readonly_overlay="--readonly" || readonly_overlay=""
+getarg live_readonly&&  live_readonly="-o ro" || live_readonly=""
  overlay=$(getarg overlay)
 
  # FIXME: we need to be able to hide the plymouth splash for the check really

modules.d/90dmsquash-live/dmsquash-live-root if [ -b "$OSMIN_LOOPDEV" ]; then · line 179

Quoted 7 lines
modules.d/90dmsquash-live/dmsquash-live-root +1 -1
@@ -173,6 +174,6 @@ if [ -b "$OSMIN_LOOPDEV" ]; then
  fi
 
  ln -s /dev/mapper/live-rw /dev/root
-printf '/bin/mount /dev/mapper/live-rw %s\n' "$NEWROOT">  /mount/01-$$-live.sh
+printf '/bin/mount %s /dev/mapper/live-rw %s\n' "$live_readonly" "$NEWROOT">  /mount/01-$$-live.sh
 
  exit 0

maybe we should teach dmsquash-live to use already defined parameters, like "rootflags" "rootfstype" and such.