aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rwxr-xr-xsh.Linux/init.sh73
-rwxr-xr-xsh/rc-functions.sh7
3 files changed, 32 insertions, 54 deletions
diff --git a/ChangeLog b/ChangeLog
index 3869b0a0..1e7b60f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for Gentoo System Intialization ("rc") scripts
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2
+ 16 Apr 2007; Mike Frysinger <vapier@gentoo.org>:
+
+ Allow addons to pass up their exit status in import_addon.
+
+ Simplify /dev handling in init.sh and add mdev as an option.
+
16 Apr 2007; Roy Marples <uberlord@gentoo.org>:
Punted the volumes init script. Volume handling will be handled by
diff --git a/sh.Linux/init.sh b/sh.Linux/init.sh
index 810a5e83..74b88e0a 100755
--- a/sh.Linux/init.sh
+++ b/sh.Linux/init.sh
@@ -12,7 +12,7 @@ single_user() {
halt -f
return
fi
-
+
sulogin ${CONSOLE}
einfo "Unmounting filesystems"
if [ -c /dev/null ] ; then
@@ -164,58 +164,33 @@ elif [ "${RC_UNAME}" = "GNU/kFreeBSD" ] ; then
ebegin "Using kFreeBSD devfs in /dev"
eend 0
else
- fellback_to_devfs="no"
- case "${RC_DEVICES}" in
- devfs) devfs="yes"
- udev="no"
- ;;
- udev) devfs="yes"
- udev="yes"
- fellback_to_devfs="yes"
- ;;
- auto|*) devfs="yes"
- udev="yes"
- ;;
+ case ${RC_DEVICES} in
+ devfs) managers="devfs udev mdev";;
+ udev) managers="udev devfs mdev";;
+ mdev) managers="mdev udev devfs";;
+ auto|*) managers="udev devfs mdev";;
esac
- # Check udev prerequisites and kernel params
- if [ "${udev}" = "yes" ] ; then
- if get_bootparam "noudev" || ! has_addon udev-start || \
- [ -n "${devfs_mounted}" -o "${K26}" != 0 ] ; then
- udev="no"
- fi
- fi
-
- # Check devfs prerequisites and kernel params
- if [ "${devfs}" = "yes" ] ; then
- if get_bootparam "nodevfs" || ! has_addon devfs-start ||
- [ "${udev}" = "yes" -o ! -r /proc/filesystems ] ; then
- devfs="no"
- elif ! grep -Eq "[[:space:]]+devfs$" /proc/filesystems ; then
- devfs="no"
- fi
- fi
-
- # Actually start setting up /dev now
- if [ "${udev}" = "yes" ] ; then
- start_addon udev
-
- # With devfs, /dev can be mounted by the kernel ...
- elif [ "${devfs}" = "yes" ] ; then
- start_addon devfs
-
- # Did the user want udev in the config file but for
- # some reason, udev support didnt work out ?
- if [ "${fellback_to_devfs}" = "yes" ] ; then
- ewarn "You wanted udev but support for it was not available!"
- ewarn "Please review your system after it's booted!"
+ for m in ${managers} ; do
+ # Check common manager prerequisites and kernel params
+ if get_bootparam "no${m}" || ! has_addon ${m}-start ; then
+ continue
fi
- fi
+ # Check specific manager prerequisites
+ case ${m} in
+ udev|mdev)
+ if [ -n "${devfs_mounted}" -o "${K26}" != 0 ] ; then
+ continue
+ fi
+ ;;
+ devfs)
+ grep -Eqs "[[:space:]]+devfs$" /proc/filesystems || continue
+ ;;
+ esac
- # OK, if we got here, things are probably not right :)
- if [ "${devfs}" = "no" -a "${udev}" = "no" ] ; then
- :
- fi
+ # Let's see if we can get this puppy rolling
+ start_addon ${m} && break
+ done
fi
# From linux-2.6 we need to mount /dev/pts again ...
diff --git a/sh/rc-functions.sh b/sh/rc-functions.sh
index 586471dd..632060ad 100755
--- a/sh/rc-functions.sh
+++ b/sh/rc-functions.sh
@@ -6,11 +6,8 @@ has_addon() {
}
import_addon() {
- if has_addon "$1" ; then
- . "${RC_LIBDIR}/addons/$1.sh"
- return 0
- fi
- return 1
+ has_addon "$1" || return 1
+ . "${RC_LIBDIR}/addons/$1.sh"
}
start_addon() {