Enable write-mode for persistency related devices in readonly/forensic mode
authorMichael Prokop <mika@grml.org>
Fri, 14 Sep 2012 14:38:24 +0000 (16:38 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 14 Sep 2012 14:38:24 +0000 (16:38 +0200)
debian/patches/39_persistence_with_forensic.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/39_persistence_with_forensic.patch b/debian/patches/39_persistence_with_forensic.patch
new file mode 100644 (file)
index 0000000..16a67b0
--- /dev/null
@@ -0,0 +1,24 @@
+--- a/scripts/live-premount/readonly
++++ b/scripts/live-premount/readonly
+@@ -32,4 +32,21 @@
+                       blockdev --setro $device && printf "done [ execute \"blockdev --setrw %-9s\" to unlock]\n" $device >/dev/console || printf "failed\n" >/dev/console
+               fi
+       done
++
++      if grep -qe persistence /proc/cmdline
++        then
++              printf " * Persistence mode enabled, searching for persistency related devices to unlock\n" >/dev/console
++
++              for label in custom-ov home-rw home-sn live-rw live-sn
++              do
++                      if blkid -t LABEL="$label" | grep -q '.'
++                      then
++                              device=$(blkid -t LABEL="$label" | awk -F: '{print $1}')
++                                printf "   - Setting device %-9s with label '%s' to write mode for persistence mode: " "$device" "$label" >/dev/console
++                              blockdev --setrw $device && printf "done\n" >/dev/console || printf "failed\n" >/dev/console
++                      fi
++
++              done
++      fi
++
+ fi
index 4e78816..6f8f3bf 100644 (file)
@@ -19,3 +19,4 @@
 36_support_dhcp_bootoption.patch
 37_fix_legacy_persistence_handling.patch
 38_do_not_check_for_forensic_in_readonly_mode.patch
+39_persistence_with_forensic.patch