only create udev rules for root=/dev/...
authorHarald Hoyer <harald@redhat.com>
Mon, 18 May 2009 17:32:01 +0000 (19:32 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 18 May 2009 17:32:01 +0000 (19:32 +0200)
modules.d/95rootfs-block/genrules.sh

index 0b42483..4662a32 100755 (executable)
@@ -1,14 +1,14 @@
+if [ "${root#/dev/}" != "$root" ]; then
 
-resume=$(getarg resume=) && ! getarg noresume && [ -b "$resume" ] && {
-    (
-       /bin/echo -e 'KERNEL=="'${resume#/dev/}'", RUN+="/bin/echo %M:%m > /sys/power/resume"'
-       /bin/echo -e 'SYMLINK=="'${resume#/dev/}'", RUN+="/bin/echo %M:%m > /sys/power/resume"'
-    ) >> /etc/udev/rules.d/99-resume.rules
-}
-
-(
- echo 'KERNEL=="'${root#/dev/}'", RUN+="/bin/mount '$fstype' -o '$rflags' '$root' '$NEWROOT'" '
- echo 'SYMLINK=="'${root#/dev/}'", RUN+="/bin/mount '$fstype' -o '$rflags' '$root' '$NEWROOT'" '
-) >> /etc/udev/rules.d/99-mount.rules
-
+    resume=$(getarg resume=) && ! getarg noresume  && {
+       (
+           /bin/echo -e 'KERNEL=="'${resume#/dev/}'", RUN+="/bin/echo %M:%m > /sys/power/resume"'
+           /bin/echo -e 'SYMLINK=="'${resume#/dev/}'", RUN+="/bin/echo %M:%m > /sys/power/resume"'
+       ) >> /etc/udev/rules.d/99-resume.rules
+    }
 
+    (
+       echo 'KERNEL=="'${root#/dev/}'", RUN+="/bin/mount '$fstype' -o '$rflags' '$root' '$NEWROOT'" '
+       echo 'SYMLINK=="'${root#/dev/}'", RUN+="/bin/mount '$fstype' -o '$rflags' '$root' '$NEWROOT'" '
+    ) >> /etc/udev/rules.d/99-mount.rules
+fi
\ No newline at end of file