From: Michael Prokop Date: Fri, 26 Jun 2015 13:02:16 +0000 (+0200) Subject: Enable write-mode for persistency related devices in readonly/forensic mode X-Git-Tag: debian/5.0_a4-1+grml.1~11 X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=commitdiff_plain;h=7200e4a927e3c8ff6b25b0a8b6860a36827b653a Enable write-mode for persistency related devices in readonly/forensic mode --- diff --git a/components/0020-read-only b/components/0020-read-only index fc0dde0..a2c86ef 100755 --- a/components/0020-read-only +++ b/components/0020-read-only @@ -53,4 +53,20 @@ Read_only () ;; esac 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 persistence + 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 + }