From 2f1408b3ce92f45c7dba907bec8397c515711a1b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 18 May 2009 19:32:01 +0200 Subject: [PATCH] only create udev rules for root=/dev/... --- modules.d/95rootfs-block/genrules.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules.d/95rootfs-block/genrules.sh b/modules.d/95rootfs-block/genrules.sh index 0b42483b..4662a327 100755 --- a/modules.d/95rootfs-block/genrules.sh +++ b/modules.d/95rootfs-block/genrules.sh @@ -1,14 +1,14 @@ +if [ "${root#/dev/}" != "$root" ]; then + + 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 + } -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 - - + 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