Adopt a more C style for scripts and remove vim settings.

This commit is contained in:
Roy Marples
2008-01-11 12:13:46 +00:00
parent 1f4422c72f
commit 3bf49a9bd1
38 changed files with 264 additions and 213 deletions

View File

@@ -21,7 +21,8 @@ else
utc_cmd="--localtime"
fi
depend() {
depend()
{
if yesno ${clock_adjfile}; then
use checkroot
else
@@ -29,7 +30,8 @@ depend() {
fi
}
setupopts() {
setupopts()
{
case "${RC_SYS}" in
UML|VPS|XENU)
utc="${RC_SYS}"
@@ -55,7 +57,8 @@ setupopts() {
}
# hwclock doesn't always return non zero on error
_hwclock() {
_hwclock()
{
local err="$(hwclock "$@" 2>&1 >/dev/null)"
[ -z "${err}" ] && return 0
@@ -63,7 +66,8 @@ _hwclock() {
return 1
}
start() {
start()
{
local retval=0 errstr=""
setupopts
@@ -97,7 +101,8 @@ start() {
return 0
}
stop() {
stop()
{
# Don't tweak the hardware clock on LiveCD halt.
[ -n "${CDBOOT}" ] && return 0
yesno ${clock_systohc} || return 0
@@ -122,14 +127,14 @@ stop() {
eend ${retval} "Failed to sync clocks"
}
save() {
save()
{
clock_systohc="yes"
stop
}
show() {
show()
{
setupopts
hwclock --show "${utc_cmd}" ${clock_args}
}
# vim: set ts=4 :

View File

@@ -4,13 +4,15 @@
description="Sets a font for the consoles."
depend() {
depend()
{
need localmount
need keymaps # sets up terminal encoding scheme
after hotplug
}
start() {
start()
{
# Forget about any font until we are successful
rm -rf "${RC_LIBDIR}"/console
@@ -66,7 +68,9 @@ start() {
if [ ${retval} -eq 0 -a -w "${RC_LIBDIR}" ]; then
mkdir -p "${RC_LIBDIR}"/console
for font in /usr/share/consolefonts/"${consolefont}".*; do :; done
for font in /usr/share/consolefonts/"${consolefont}".*; do
:
done
cp "${font}" "${RC_LIBDIR}"/console
echo "${font##*/}" > "${RC_LIBDIR}"/console/font
if yesno ${unicode:-${UNICODE}}; then
@@ -78,5 +82,3 @@ start() {
return ${retval}
}
# vim: set ts=4 :

View File

@@ -12,11 +12,13 @@ windowskeys=${windowskeys:-${SET_WINDOWSKEYS}}
fix_euro=${fix_euro:-${FIX_EURO}}
dumpkeys_charset=${dumpkeys_charset:-${DUMPKEYS_CHARSET}}
depend() {
depend()
{
need localmount
}
start() {
start()
{
case "${RC_SYS}" in
UML|VPS|XENU)
ewarn "Not loading keymaps for ${RC_SYS} systems"
@@ -64,7 +66,8 @@ start() {
# See utf-8(7) for more information.
local termencoding= termmsg=
if yesno ${unicode}; then
dumpkeys ${dumpkeys_charset:+-c} ${dumpkeys_charset} | loadkeys --unicode
dumpkeys ${dumpkeys_charset:+-c} \
${dumpkeys_charset} | loadkeys --unicode
termencoding="%G"
termmsg="UTF-8"
else
@@ -80,5 +83,3 @@ start() {
done
eend 0
}
# vim: set ts=4 :

View File

@@ -4,12 +4,14 @@
description="Loads a user defined list of kernel modules."
depend() {
depend()
{
need checkroot
use isapnp
}
start() {
start()
{
# Should not fail if kernel do not have module
# support compiled in ...
[ ! -f /proc/modules -o "${RC_SYS}" = "VPS" ] && return 0
@@ -22,7 +24,10 @@ start() {
local KV_MICRO=${x%%-*}
local list= x= args= cnt=0
for x in "${KV}" ${KV_MAJOR}.${KV_MINOR}.${KV_MICRO} ${KV_MAJOR}.${KV_MINOR}; do
for x in "${KV}" \
${KV_MAJOR}.${KV_MINOR}.${KV_MICRO} \
${KV_MAJOR}.${KV_MINOR} \
; do
eval list=\$modules_$(shell_var "${x}")
[ -n "${list}" ] && break
done
@@ -43,5 +48,3 @@ start() {
# Above test clobbers the return
return 0
}
# vim: set ts=4 :

View File

@@ -6,11 +6,13 @@ description="Turns numlock on for the consoles."
ttyn=${rc_tty_number:-${RC_TTY_NUMBER}:-12}
depend() {
depend()
{
need localmount
}
_setleds() {
_setleds()
{
[ -z "$1" ] && return 1
local dev=/dev/tty t= i=1 retval=0
@@ -24,16 +26,16 @@ _setleds() {
return ${retval}
}
start() {
start()
{
ebegin "Enabling numlock on ttys"
_setleds +
eend $? "Failed to enable numlock"
}
stop() {
stop()
{
ebegin "Disabling numlock on ttys"
_setleds -
eend $? "Failed to disable numlock"
}
# vim: set ts=4 :

View File

@@ -4,11 +4,13 @@
description="Mounts misc filesystems in /proc."
depend() {
depend()
{
need checkfs
}
start() {
start()
{
# Make sure we insert usbcore if its a module
if [ -f /proc/modules -a ! -d /proc/bus/usb ]; then
modprobe -q usbcore
@@ -84,5 +86,3 @@ start() {
return 0
}
# vim: set ts=4 :

View File

@@ -2,17 +2,17 @@
# Copyright 2007-2008 Roy Marples
# All rights reserved
depend() {
depend()
{
use hostname
before bootmisc logger
}
start() {
start()
{
[ "${RC_SYS}" = "VPS" ] && return 0
[ -e /etc/sysctl.conf ] || return 0
ebegin "Configuring kernel parameters"
sysctl -p /etc/sysctl.conf >/dev/null
eend $?
}
# vim: set ts=4 :