diff options
author | 2007-11-13 22:40:48 +0000 | |
---|---|---|
committer | 2007-11-13 22:40:48 +0000 | |
commit | 07b4e73cf9072b1a470f6906857c40e8ad02aef5 (patch) | |
tree | 348fe7c04d76d61148d6f9655167e06c6f9e8fa3 /sys-fs/udev/files/write_root_link_rule | |
parent | Version bump to test a fix for bug #198083. (diff) | |
download | historical-07b4e73cf9072b1a470f6906857c40e8ad02aef5.tar.gz historical-07b4e73cf9072b1a470f6906857c40e8ad02aef5.tar.bz2 historical-07b4e73cf9072b1a470f6906857c40e8ad02aef5.zip |
Version bumped. Now all helper-apps are merged into binary udevadm. This needs to be included when building initramfs'. Using udevadm for providing /dev/root link. Added special warning for Bug #190994. No longer install udevstart, it is not needed for 2.6.15 and newer and just confuses people.
Package-Manager: portage-2.1.3.19
Diffstat (limited to 'sys-fs/udev/files/write_root_link_rule')
-rwxr-xr-x | sys-fs/udev/files/write_root_link_rule | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sys-fs/udev/files/write_root_link_rule b/sys-fs/udev/files/write_root_link_rule new file mode 100755 index 000000000000..4d6cd78c9d37 --- /dev/null +++ b/sys-fs/udev/files/write_root_link_rule @@ -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 Matthias Schwarzott <zzam@gentoo.org> + +DEV=$(udevadm info --device-id-of-file=/) +if [ $? = 0 ]; then + MAJOR="${DEV% *}" + MINOR="${DEV#* }" + + [ -d /dev/.udev/rules.d ] || mkdir -p /dev/.udev/rules.d + RULES=/dev/.udev/rules.d/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}==\"$MAJOR\", ENV{MINOR}==\"$MINOR\", SYMLINK+=\"root\"" >> "${RULES}" +fi + |