Fix swap partitions missing from fstab
authorChristian Hofstaedtler <ch@grml.org>
Mon, 19 Dec 2011 11:42:47 +0000 (12:42 +0100)
committerChristian Hofstaedtler <ch@grml.org>
Mon, 19 Dec 2011 11:42:47 +0000 (12:42 +0100)
swap partitions get ID_FS_USAGE='other' instead of 'filesystem'.
This change hands the filter for ID_FS_USAGE to grml-udev-rebuildfstab,
to the point right before adding the new entries. This way cleanup
should work always, and we get swap partitions, too.

debian/grml-udev-config.grml-blockdevices.udev
scripts/grml-udev-rebuildfstab

index 1fc7f96..8f9360f 100644 (file)
@@ -1,2 +1,2 @@
 # regenerate /etc/fstab for new/removed devices:
-ENV{ID_FS_USAGE}=="filesystem", ACTION=="add|change|remove", SUBSYSTEM=="block", RUN+="/etc/udev/scripts/grml-udev-rebuildfstab"
+ACTION=="add|change|remove", SUBSYSTEM=="block", RUN+="/etc/udev/scripts/grml-udev-rebuildfstab"
index 6ff1b18..71e7f36 100755 (executable)
@@ -226,6 +226,11 @@ done
 # if entry is already present ignore it
 stringinfile $device $TMPFILE && bailout 0
 
+if [ "$ID_FS_USAGE" != "filesystem" -a "$ID_FS_TYPE" != "swap" ]; then
+    # blockdevice in question won't be mountable in this case
+    bailout 0
+fi
+
 options=noauto,user,dev,suid,exec
 case $ID_FS_TYPE in
 ntfs)