Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 133739 Details for
Bug 196250
sys-apps/baselayout-2.0.0_rc5 - modules init-script fails to start
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
The init-Script
modules (text/plain), 2.88 KB, created by
Andreas Mielke
on 2007-10-18 09:18:33 UTC
(
hide
)
Description:
The init-Script
Filename:
MIME Type:
Creator:
Andreas Mielke
Created:
2007-10-18 09:18:33 UTC
Size:
2.88 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2007 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 > >depend() { > need checkroot > use isapnp >} > >load_modules() { > local x= > local i=0 > local retval=0 > local modules= > local modargs= > local modcount=0 > local config="$1" > > [[ -z ${config} || ! -r ${config} ]] && return 0 > > # Loop over every line in $config > eval $(awk ' > BEGIN { > COUNT = 0 # Make sure COUNT is set > } > > $0 !~ /(^[[:space:]]*(#|$))/ { > if (MODULES == "") > MODULES = $1 > else > MODULES = MODULES " " $1 > > # Not the greatest method to remove $1 from $0, but it works > sub(/^[[:space:]]*[^[:space:]]*[[:space:]]*/, "") > # Trim trailing comments on the line > sub(/#.*$/, "") > ARGS[COUNT] = $0 > COUNT++ > } > > END { > # 'eval' will make sure these are set to proper bash variables > print "modcount=" COUNT > print "modules=\"" MODULES "\"" > for (x = 0;x < COUNT;x++) > print "modargs[" x "]=\"" ARGS[x] "\"" > } > ' "${config}") > > if [[ ${modcount} -gt 0 ]]; then > einfo "Using ${config} as config:" > > for x in ${modules}; do > ebegin " Loading module ${x}" > modprobe -q ${x} ${modargs[${i}]} &>/dev/null > retval=$? > eend ${retval} " Failed to load ${x}" > > i=$((i+1)) > [[ ${retval} -eq 0 ]] || modcount=$((modcount-1)) > done > > einfo "Autoloaded ${modcount} module(s)" > fi > > return 0 >} > >start() { > local KV=$(uname -r) > local KV_MAJOR=$(KV_major "${KV}") > local KV_MINOR=$(KV_minor "${KV}") > local KV_MICRO=$(KV_micro "${KV}") > > # Should not fail if kernel do not have module > # support compiled in ... > [[ -f /proc/modules ]] || return 0 > > # Make sure depmod from modutils do not whine, but do not bother if > # we are on a 2.6 kernel without modprobe.old > if [[ -z "${CDBOOT}" ]] && [[ ! -e /etc/modules.conf ]] && \ > [[ $(get_KV) -lt $(KV_to_int '2.5.48') || -x /sbin/modprobe.old ]] > then > echo '### This file is automatically generated by update-modules' \ > > /etc/modules.conf 2>/dev/null > [[ ! -f /etc/modules.conf ]] && \ > ewarn "Cannot update /etc/modules.conf!" > fi > > # Only do this if we have modules.conf or a 2.6 kernel > if [[ -z "${CDBOOT}" ]] && \ > [[ -f /etc/modules.conf || $(get_KV) -ge $(KV_to_int '2.5.48') ]] > then > /sbin/update-modules > fi > > local autoload="" > if [[ -f /etc/modules.autoload && ! -L /etc/modules.autoload ]]; then > autoload=/etc/modules.autoload > else > local x > for x in "${KV}" ${KV_MAJOR}.${KV_MINOR}.${KV_MICRO} ${KV_MAJOR}.${KV_MINOR} ; do > if [[ -f /etc/modules.autoload.d/kernel-"${x}" ]] ; then > autoload="/etc/modules.autoload.d/kernel-${x}" > break > fi > done > fi > [[ -n ${autoload} ]] && load_modules "${autoload}" > > # > # Just in case a sysadmin prefers generic symbolic links in > # /lib/modules/boot for boot time modules we will load these modules > # > [[ -n $(modprobe -l -t boot) ]] && modprobe -a -t boot \* &>/dev/null > > # Above test clobbers the return > return 0 >} > > ># vim:ts=4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 196250
: 133739