summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Schwarzott <zzam@gentoo.org>2010-05-05 19:35:07 +0000
committerMatthias Schwarzott <zzam@gentoo.org>2010-05-05 19:35:07 +0000
commit9a2b45aa0bd6c88d5255e0fcd87852c58540f77a (patch)
tree10181625018d2398f4536b1ad3acb94f05d48f06 /sys-fs/udev/files/151-r4/udev-start.sh
parentVersion bump (diff)
downloadgentoo-2-9a2b45aa0bd6c88d5255e0fcd87852c58540f77a.tar.gz
gentoo-2-9a2b45aa0bd6c88d5255e0fcd87852c58540f77a.tar.bz2
gentoo-2-9a2b45aa0bd6c88d5255e0fcd87852c58540f77a.zip
Updated init-scripts. Now support setting debug and trace options in config file. Explicitly send add-event for initial population (newer udevds will default to change). Set property STARTUP while booting for compatibility with new eg. lvm2 init-scripts. Sync udev-9999.ebuild.
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'sys-fs/udev/files/151-r4/udev-start.sh')
-rw-r--r--sys-fs/udev/files/151-r4/udev-start.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/sys-fs/udev/files/151-r4/udev-start.sh b/sys-fs/udev/files/151-r4/udev-start.sh
new file mode 100644
index 000000000000..e927e8c14427
--- /dev/null
+++ b/sys-fs/udev/files/151-r4/udev-start.sh
@@ -0,0 +1,55 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+[ -e /etc/conf.d/udev ] && . /etc/conf.d/udev
+
+. /lib/udev/shell-compat-addon.sh
+
+compat_volume_nodes()
+{
+ # Only do this for baselayout-1*
+ # This check is likely to get false positives due to some multilib stuff,
+ # but that should not matter, as this can only happen on old openrc versions
+ # no longer available as ebuilds.
+ if [ ! -e /lib/librc.so ]; then
+
+ # Create nodes that udev can't
+ [ -x /sbin/lvm ] && \
+ /sbin/lvm vgscan -P --mknodes --ignorelockingfailure &>/dev/null
+ # Running evms_activate on a LiveCD causes lots of headaches
+ [ -z "${CDBOOT}" -a -x /sbin/evms_activate ] && \
+ /sbin/evms_activate -q &>/dev/null
+ fi
+}
+
+start_initd()
+{
+ (
+ . /etc/init.d/"$1"
+ _start
+ )
+}
+
+# set it as openrc does
+RC_BOOTLEVEL=${BOOTLEVEL:-default}
+RC_DEFAULTLEVEL=${DEFAULTLEVEL:-default}
+
+# mount tmpfs on /dev
+start_initd udev-mount || exit 1
+
+# Create a file so that our rc system knows it's still in sysinit.
+# Existance means init scripts will not directly run.
+# rc will remove the file when done with sysinit.
+# this is no longer needed as of openrc-0.4.0
+touch /dev/.rcsysinit
+
+# load device tarball
+start_initd udev-dev-tarball
+
+# run udevd
+start_initd udev || exit 1
+
+compat_volume_nodes
+
+# udev started successfully
+exit 0