View previous topic :: View next topic |
Author |
Message |
Vertical n00b
Joined: 24 Jan 2005 Posts: 33
|
Posted: Thu Mar 03, 2005 3:17 pm Post subject: dumb problems with etc/init.d/modules |
|
|
Hello
I was trying 'Flying with gentoo' howto from this forum. Opened /etc/init.d/modules, copied & pasted lines. Now can't start modules
$ /etc/init.d/modules start
/var/lib/init.d/modules-6060: line 130: syntax error: unexpected end of file
* ERROR: "/etc/init.d/modules" has syntax errors in it; not executing...
By the way there are only 128 lines in script. I didn't change anything else!
Tryes modules-update, etc-update, tried placing last } symbol from line 130 to another places.. NOTHING!
Please, tell me, wtf it is?
*************************************************************************************
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-src/rc-scripts/init.d/modules,v 1.32.4.1 2005/01/30 22:17:37 vapier Exp $
depend() {
need checkroot hostname
use isapnp
}
load_modules() {
local x=
local i=0
local retval=0
local modules=
local modargs=
local modcount=0
local config="$1"
[ -z "${config}" ] && return 0
[ ! -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:]]*/, "")
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() {
# Should not fail if kernel do not have module
# support compiled in ...
[ -f /proc/modules ] || return 0
# Here we should fail, as a modular kernel do need
# depmod command ...
if [ ! -x /sbin/depmod ]
then
eerror "ERROR: system is missing /sbin/depmod !"
return 1
fi
if [ -z "${CDBOOT}" ] && touch /etc/modules.conf 2> /dev/null
then
if [ /etc/modules.d -nt /etc/modules.conf ]
then
ebegin "Calculating module dependencies"
/sbin/modules-update &>/dev/null
eend $? "Failed to calculate dependencies"
else
einfo "Module dependencies are up-to-date"
fi
if [ -f /etc/modules.autoload -a ! -L /etc/modules.autoload ]
then
# Loop over every line in /etc/modules.autoload.
load_modules /etc/modules.autoload
else
local KV="$(uname -r)"
local KV_MAJOR="`KV_major "${KV}"`"
local KV_MINOR="`KV_minor "${KV}"`"
# New support for /etc/modules.autoload/kernel-$KV
if [ "$(get_KV)" -ge "$(KV_to_int '2.5.48')" ] && \
[ -f /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}" ]
then
load_modules /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}"
elif [ ! -f /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}" ]
then
ewarn "Missing /etc/modules.autoload.d/kernel-${KV_MAJOR}.${KV_MINOR}"
load_modules /etc/modules.autoload.d/kernel-2.4
else
load_modules /etc/modules.autoload.d/kernel-2.4
fi
fi
#
# Just in case a sysadmin prefers generic symbolic links in
# /lib/modules/boot for boot time modules we will load these modules
#
if [ -n "$(modprobe -l -t boot)" ]
then
modprobe -a -t boot \* &>/dev/null
fi
}
************************************************************************************* |
|
Back to top |
|
|
bkunlimited l33t
Joined: 18 Jun 2004 Posts: 672
|
Posted: Thu Mar 03, 2005 3:25 pm Post subject: |
|
|
did you paste /etc/init.d/modules here or /var/lib/init.d/modules-6060 ? |
|
Back to top |
|
|
Vertical n00b
Joined: 24 Jan 2005 Posts: 33
|
Posted: Thu Mar 03, 2005 4:06 pm Post subject: |
|
|
it is /etc/init.d/modules
modules-6060 was dynamicly named I think, and really don't know what is it |
|
Back to top |
|
|
Vertical n00b
Joined: 24 Jan 2005 Posts: 33
|
Posted: Thu Mar 03, 2005 9:08 pm Post subject: |
|
|
Now strange things happen. On boot everything is Ok, but on shutdown sometimes it shows problems (with syntax)
Can someone post their /etc/init.d/modules?
or how to reinstall default (original) file? |
|
Back to top |
|
|
|