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/1%20160511~9^2~2 X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=commitdiff_plain;h=e3cbd82426f1710dba545ee0f44b0731a45e0b6a;hp=ac5eb22cdeb44618c3e5c52dccd26d871d4096d0 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 + }