scripts/forensic-mark-readonly: fix parent device handling + their usage via READONLY...
authorMichael Prokop <mika@grml.org>
Fri, 11 Sep 2020 18:14:37 +0000 (20:14 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 11 Sep 2020 20:43:53 +0000 (22:43 +0200)
commit451331668643dd76d51d53c8ca44069561f86d1d
tree36eb138af6146b75e4e88563f4c80ccb17f68cff
parentb2080fafcb8624b8061936a54c6f500934def44d
scripts/forensic-mark-readonly: fix parent device handling + their usage via READONLY_IGNORE

With commit 31e81f4ab5 the parent device behavior was modified
in an unintended way: /dev/sda1 was set to read-only, even
if the underlying parent device /dev/sda was already set to r/w.
Fixed via proper quoting and invoking readlink on the /sys/...
directory from within the calculation of ${tmp_parent}.

Also support parent devices within the READONLY_IGNORE=... setting
in /etc/grml/forensic.conf, so it's possible to assign
READONLY_IGNORE='/dev/sda' and operate on e.g. /dev/sda1, expecting
to ignore /dev/sda1 as well as /dev/sda then.

This work was funded by Grml-Forensic.
(Internally recorded as release-planning issue #175.)
scripts/forensic-mark-readonly