devfs_automounted="no"
if [ -e "/dev/.devfsd" ]
then
mymounts="$(awk '($3 == "devfs") { print "yes"; exit 0 }' /proc/mounts)"
if [ "${mymounts}" != "yes" ]
then
rm -f /dev/.devfsd
else
devfs_automounted="yes"
fi
fi
这段为的是修正bug用的,具体为什么,还没有弄清楚,跳过这段,我们接下来看
if [ "${RC_DEVICES}" = "static" ]
then
ebegin "Using existing device nodes 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"
;;
esac
if [ "${udev}" = "yes" ]
then
if get_bootparam "noudev" || ! has_addon udev-start.sh || \
[ ${devfs_automounted} = "yes" ] || \
[ "$(get_KV)" -lt "$(KV_to_int '2.6.0')" ]
then
udev="no"
fi
fi
if [ "${devfs}" = "yes" ]
then
if get_bootparam "nodevfs" || [ "${udev}" = "yes" ] || \
! has_addon devfs-start.sh
then
devfs="no"
fi
fi
if [[ ${udev} == "yes" ]] ; then
start_addon udev
elif [[ ${devfs} == "yes" ]] ; then
start_addon devfs
if [[ ${fellback_to_devfs} == "yes" ]] ; then
ewarn "You wanted udev but support for it was not available!"
ewarn "lease review your system after it's booted!"
fi
fi
if [[ ${devfs} == "no" && ${udev} == "no" ]] ; then
echo
einfo "The Gentoo Linux system initialization scripts have detected that"
einfo "your system does not support UDEV. Since Gentoo Linux has been"
einfo "designed with dynamic /dev in mind, it is highly suggested that you"
einfo "emerge sys-fs/udev and configure your system to use it."
einfo "lease read the Gentoo Handbook for more information!"
echo
einfo " http://www.gentoo.org/doc/en/handbook/"
echo
einfo "Thanks for using Gentoo! "
echo
read -t 15 -p "(hit Enter to continue or wait 15 seconds ...)"
fi
fi
for copt in $(< /proc/cmdline) ; do
if [[ ${copt%=*} == "gentoo" ]] ; then
params=$(gawk -v PARAMS="${copt##*=}" '
BEGIN {
split(PARAMS, nodes, ",")
for (x in nodes)
print nodes[x]
}')
# Parse gentoo option
for x in ${params} ; do
if [[ ${x} == "$1" ]] ; then
# echo "YES"