grml-udev-config.grml-forensic: also react to block device *changes*
[grml-udev-config.git] / debian / grml-udev-config.grml-forensic.udev
index db71dd0..30a166e 100644 (file)
@@ -1,2 +1,4 @@
 # mark new block devices as readonly when booting with bootoption forensic/readonly
-ACTION=="add",    SUBSYSTEM=="block", RUN+="/etc/udev/scripts/forensic-mark-readonly"
+ACTION=="add",    SUBSYSTEM=="block",                    RUN+="/etc/udev/scripts/forensic-mark-readonly $name"
+# take care of devices when e.g. partition tables get re-read (see block/genhd.c + set_disk_ro() in linux source)
+ACTION=="change", SUBSYSTEM=="block", ENV{DISK_RO}=="0", RUN+="/etc/udev/scripts/forensic-mark-readonly $name"