Allow addons to pass up their exit status in import_addon. Simplify /dev handling in init.sh and add mdev as an option.

This commit is contained in:
Mike Frysinger 2007-04-17 00:07:09 +00:00
parent c688523fcc
commit 2266255ac5
3 changed files with 32 additions and 54 deletions

View File

@ -1,6 +1,12 @@
# ChangeLog for Gentoo System Intialization ("rc") scripts # ChangeLog for Gentoo System Intialization ("rc") scripts
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2 # 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>: 16 Apr 2007; Roy Marples <uberlord@gentoo.org>:
Punted the volumes init script. Volume handling will be handled by Punted the volumes init script. Volume handling will be handled by

View File

@ -12,7 +12,7 @@ single_user() {
halt -f halt -f
return return
fi fi
sulogin ${CONSOLE} sulogin ${CONSOLE}
einfo "Unmounting filesystems" einfo "Unmounting filesystems"
if [ -c /dev/null ] ; then if [ -c /dev/null ] ; then
@ -164,58 +164,33 @@ elif [ "${RC_UNAME}" = "GNU/kFreeBSD" ] ; then
ebegin "Using kFreeBSD devfs in /dev" ebegin "Using kFreeBSD devfs in /dev"
eend 0 eend 0
else else
fellback_to_devfs="no" case ${RC_DEVICES} in
case "${RC_DEVICES}" in devfs) managers="devfs udev mdev";;
devfs) devfs="yes" udev) managers="udev devfs mdev";;
udev="no" mdev) managers="mdev udev devfs";;
;; auto|*) managers="udev devfs mdev";;
udev) devfs="yes"
udev="yes"
fellback_to_devfs="yes"
;;
auto|*) devfs="yes"
udev="yes"
;;
esac esac
# Check udev prerequisites and kernel params for m in ${managers} ; do
if [ "${udev}" = "yes" ] ; then # Check common manager prerequisites and kernel params
if get_bootparam "noudev" || ! has_addon udev-start || \ if get_bootparam "no${m}" || ! has_addon ${m}-start ; then
[ -n "${devfs_mounted}" -o "${K26}" != 0 ] ; then continue
udev="no"
fi 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
# Check devfs prerequisites and kernel params # Let's see if we can get this puppy rolling
if [ "${devfs}" = "yes" ] ; then start_addon ${m} && break
if get_bootparam "nodevfs" || ! has_addon devfs-start || done
[ "${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!"
fi
fi
# OK, if we got here, things are probably not right :)
if [ "${devfs}" = "no" -a "${udev}" = "no" ] ; then
:
fi
fi fi
# From linux-2.6 we need to mount /dev/pts again ... # From linux-2.6 we need to mount /dev/pts again ...

View File

@ -6,11 +6,8 @@ has_addon() {
} }
import_addon() { import_addon() {
if has_addon "$1" ; then has_addon "$1" || return 1
. "${RC_LIBDIR}/addons/$1.sh" . "${RC_LIBDIR}/addons/$1.sh"
return 0
fi
return 1
} }
start_addon() { start_addon() {