diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2008-04-03 20:09:39 +0000 |
---|---|---|
committer | Matthias Schwarzott <zzam@gentoo.org> | 2008-04-03 20:09:39 +0000 |
commit | 59ce7ef63c1248fee5d1d5a3369c980be086758b (patch) | |
tree | 88381f48128153c830f2b46afaf3268696be7240 /sys-fs/udev/files | |
parent | amd64/x86 stable, security bug #214212 (diff) | |
download | gentoo-2-59ce7ef63c1248fee5d1d5a3369c980be086758b.tar.gz gentoo-2-59ce7ef63c1248fee5d1d5a3369c980be086758b.tar.bz2 gentoo-2-59ce7ef63c1248fee5d1d5a3369c980be086758b.zip |
Add ewarn about missing /dev/zero and about kernel older than 2.6.18. Cosmetics.
(Portage version: 2.1.4.4)
Diffstat (limited to 'sys-fs/udev/files')
-rw-r--r-- | sys-fs/udev/files/udev-start-119-r1.sh | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/sys-fs/udev/files/udev-start-119-r1.sh b/sys-fs/udev/files/udev-start-119-r1.sh index 760c008b5256..770159db0ba4 100644 --- a/sys-fs/udev/files/udev-start-119-r1.sh +++ b/sys-fs/udev/files/udev-start-119-r1.sh @@ -7,7 +7,8 @@ rc_coldplug=${rc_coldplug:-${RC_COLDPLUG:-YES}} rc_device_tarball=${rc_device_tarball:-${RC_DEVICE_TARBALL:-NO}} -cleanup() { +cleanup() +{ if [ "$1" != "0" ]; then # cleanup to fail more gracely start-stop-daemon --stop --exec /sbin/udevd @@ -21,11 +22,14 @@ cleanup() { # Maybe something like udevd --test || exit $? check_kernel() { - if [ $(get_KV) -le $(KV_to_int '2.6.14') ]; then + if [ $(get_KV) -lt $(KV_to_int '2.6.15') ]; then eerror "Your kernel is too old to work with this version of udev." eerror "Current udev only supports Linux kernel 2.6.15 and newer." return 1 fi + if [ $(get_KV) -lt $(KV_to_int '2.6.18') ]; then + ewarn "You need at least Linux kernel 2.6.18 for reliable operation of udev." + fi return 0 } @@ -85,6 +89,13 @@ seed_dev() return 0 } +disable_hotplug_agent() +{ + if [ -e /proc/sys/kernel/hotplug ]; then + echo "" >/proc/sys/kernel/hotplug + fi +} + start_udev() { ebegin "Starting udevd" @@ -123,7 +134,7 @@ populate_udev() return 0 } -compat_device_nodes() +compat_volume_nodes() { # Only do this for baselayout-1* if [ ! -e /lib/librc.so ]; then @@ -192,24 +203,23 @@ fi unpack_device_tarball seed_dev - -if [ -e /proc/sys/kernel/hotplug ]; then - echo "" >/proc/sys/kernel/hotplug -fi - +disable_hotplug_agent /lib/udev/write_root_link_rule start_udev || cleanup $? populate_udev || cleanup $? -compat_device_nodes +compat_volume_nodes check_persistent_net # trigger executing initscript when /etc is writable IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>&1 # should exist on every system, else udev failed -[ -e /dev/zero ] || cleanup 1 +if [ ! -e /dev/zero ]; then + eerror "Assuming udev failed somewhere, as /dev/zero does not exist." + cleanup 1 +fi # udev started successfully exit 0 |