summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Schwarzott <zzam@gentoo.org>2008-07-25 11:36:46 +0000
committerMatthias Schwarzott <zzam@gentoo.org>2008-07-25 11:36:46 +0000
commit0cd87c5e14ec0959f2f46f54f7f4e04a3e734a86 (patch)
tree4bb8d7fd1e983b97a522bf151ddc0a098a7efe11 /sys-fs/udev/files
parentia64/sparc stable wrt #228387 (diff)
downloadgentoo-2-0cd87c5e14ec0959f2f46f54f7f4e04a3e734a86.tar.gz
gentoo-2-0cd87c5e14ec0959f2f46f54f7f4e04a3e734a86.tar.bz2
gentoo-2-0cd87c5e14ec0959f2f46f54f7f4e04a3e734a86.zip
Version bumped. rules were moved inside the tarball. Rewritten write_root_link_rule due to better support from udevadm.
(Portage version: 2.2_rc3/cvs/Linux 2.6.25-tuxonice-r6 i686)
Diffstat (limited to 'sys-fs/udev/files')
-rwxr-xr-xsys-fs/udev/files/write_root_link_rule-12529
1 files changed, 29 insertions, 0 deletions
diff --git a/sys-fs/udev/files/write_root_link_rule-125 b/sys-fs/udev/files/write_root_link_rule-125
new file mode 100755
index 000000000000..8eaea117693a
--- /dev/null
+++ b/sys-fs/udev/files/write_root_link_rule-125
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# This script should run before doing udevtrigger at boot.
+# It will create a rule matching the device directory / is on, and
+# creating /dev/root symlink pointing on its device node.
+#
+# This is especially useful for hal looking at /proc/mounts containing
+# a line listing /dev/root as device:
+# /dev/root / reiserfs rw 0 0
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation version 2 of the License.
+#
+# (c) 2007-2008 Matthias Schwarzott <zzam@gentoo.org>
+
+eval $(udevadm info --export --export-prefix="ROOT_" --device-id-of-file=/)
+
+[ $? = 0 ] || exit 0
+[ "$ROOT_MAJOR" = 0 ] && exit 0
+
+DIR=/dev/.udev/rules.d
+[ -d "$DIR" ] || mkdir -p "$DIR"
+RULES=$DIR/10-root-link.rules
+
+echo "# Created by /lib/udev/write_root_link_rule" > "${RULES}"
+echo "# This rule should create /dev/root as link to real root device." >> "${RULES}"
+echo "SUBSYSTEM==\"block\", ENV{MAJOR}==\"$ROOT_MAJOR\", ENV{MINOR}==\"$ROOT_MINOR\", SYMLINK+=\"root\"" >> "${RULES}"
+