udev requires try function and the modules-update program should take care of any 2.4 vs 2.6 kernel issues. Also add vim instructions to a few files.
This commit is contained in:
parent
584cea1f8e
commit
afdcf1fa15
@ -56,3 +56,6 @@ install:: $(BIN) $(CONF) $(CONF_APPEND)
|
|||||||
$(INSTALL) -m 0644 $$x $(DESTDIR)$(DIR) || exit $$?; \
|
$(INSTALL) -m 0644 $$x $(DESTDIR)$(DIR) || exit $$?; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ start() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local x= param= sf_param= retval=1 ttydev=
|
local x= param= sf_param= retval=0 ttydev=
|
||||||
|
|
||||||
# Get additional parameters
|
# Get additional parameters
|
||||||
if [ -n "${consoletranslation}" ]; then
|
if [ -n "${consoletranslation}" ]; then
|
||||||
@ -74,7 +74,7 @@ start() {
|
|||||||
|
|
||||||
x=1
|
x=1
|
||||||
while [ ${x} -le ${ttyn} ]; do
|
while [ ${x} -le ${ttyn} ]; do
|
||||||
setfont ${consolefont} ${param}-C ${ttydev}${x} >/dev/null
|
setfont ${consolefont} ${param} -C ${ttydev}${x} >/dev/null
|
||||||
retval=$((${retval} + $?))
|
retval=$((${retval} + $?))
|
||||||
x=$((${x} + 1))
|
x=$((${x} + 1))
|
||||||
done
|
done
|
||||||
|
@ -103,4 +103,4 @@ start() {
|
|||||||
eend 0
|
eend 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# vim:ts=4
|
# vim: set ts=4 :
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/sbin/runscript
|
#!/sbin/runscript
|
||||||
# Copyright 1999-2007 Gentoo Foundation
|
|
||||||
# Copyright 2007 Roy Marples
|
# Copyright 2007 Roy Marples
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
|
|
||||||
@ -35,7 +34,7 @@ load_modules() {
|
|||||||
local modules=""
|
local modules=""
|
||||||
local config="$1"
|
local config="$1"
|
||||||
|
|
||||||
[ -z "${config}" -o ! -r "${config}" ] && return 0
|
[ -r "${config}" ] || return 0
|
||||||
|
|
||||||
eval set -- $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' \
|
eval set -- $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' \
|
||||||
-e "s/'/'\\\\''/g" -e "s/^/'/g" -e "s/$/'/g" "${config}")
|
-e "s/'/'\\\\''/g" -e "s/^/'/g" -e "s/$/'/g" "${config}")
|
||||||
@ -69,23 +68,7 @@ start() {
|
|||||||
x=${KV#*.*.}
|
x=${KV#*.*.}
|
||||||
local KV_MICRO=${x%%-*}
|
local KV_MICRO=${x%%-*}
|
||||||
|
|
||||||
# Make sure depmod from modutils do not whine, but do not bother if
|
[ -z "${CDBOOT}" ] && update-modules
|
||||||
# we are on a 2.6 kernel without modprobe.old
|
|
||||||
if [ -z "${CDBOOT}" -a ! -e /etc/modules.conf ] && \
|
|
||||||
[ $(KV_to_int "${KV}") -lt $(KV_to_int '2.5.48') -o -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 -o $(KV_to_int "${KV}") -ge $(KV_to_int '2.5.48') ]
|
|
||||||
then
|
|
||||||
/sbin/update-modules
|
|
||||||
fi
|
|
||||||
|
|
||||||
local auto=""
|
local auto=""
|
||||||
if [ -f /etc/modules.autoload -a ! -L /etc/modules.autoload ]; then
|
if [ -f /etc/modules.autoload -a ! -L /etc/modules.autoload ]; then
|
||||||
@ -109,15 +92,12 @@ start() {
|
|||||||
fi
|
fi
|
||||||
[ -n "${auto}" ] && load_modules "${auto}"
|
[ -n "${auto}" ] && load_modules "${auto}"
|
||||||
|
|
||||||
#
|
|
||||||
# Just in case a sysadmin prefers generic symbolic links in
|
# Just in case a sysadmin prefers generic symbolic links in
|
||||||
# /lib/modules/boot for boot time modules we will load these modules
|
# /lib/modules/boot for boot time modules we will load these modules
|
||||||
#
|
|
||||||
[ -n "$(modprobe -l -t boot)" ] && modprobe -a -t boot \* 2>/dev/null
|
[ -n "$(modprobe -l -t boot)" ] && modprobe -a -t boot \* 2>/dev/null
|
||||||
|
|
||||||
# Above test clobbers the return
|
# Above test clobbers the return
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
# vim:ts=4
|
|
||||||
|
@ -78,8 +78,8 @@ start() {
|
|||||||
if [ -d /sys/kernel/security ] && ! mountinfo -q /sys/kernel/security; then
|
if [ -d /sys/kernel/security ] && ! mountinfo -q /sys/kernel/security; then
|
||||||
if grep -qs securityfs /proc/filesystems; then
|
if grep -qs securityfs /proc/filesystems; then
|
||||||
ebegin "Mounting security filesystem"
|
ebegin "Mounting security filesystem"
|
||||||
mount -t securityfs securityfs /sys/kernel/security \
|
mount -t securityfs -o nodev,noexec,nosuid \
|
||||||
-o nodev,noexec,nosuid
|
securityfs /sys/kernel/security
|
||||||
eend $?
|
eend $?
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -88,8 +88,8 @@ start() {
|
|||||||
if [ -d /sys/kernel/debug ] && ! mountinfo -q /sys/kernel/debug; then
|
if [ -d /sys/kernel/debug ] && ! mountinfo -q /sys/kernel/debug; then
|
||||||
if grep -qs debugfs /proc/filesystems; then
|
if grep -qs debugfs /proc/filesystems; then
|
||||||
ebegin "Mounting debug filesystem"
|
ebegin "Mounting debug filesystem"
|
||||||
mount -t debugfs debugfs /sys/kernel/debug \
|
mount -t debugfs -o nodev,noexec,nosuid \
|
||||||
-o nodev,noexec,nosuid
|
debugfs /sys/kernel/debug
|
||||||
eend $?
|
eend $?
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -105,3 +105,5 @@ start() {
|
|||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
|
@ -35,3 +35,5 @@ start() {
|
|||||||
sysctl -p /etc/sysctl.conf >/dev/null
|
sysctl -p /etc/sysctl.conf >/dev/null
|
||||||
eend $?
|
eend $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
|
@ -36,3 +36,5 @@ depend() {
|
|||||||
start_pre() {
|
start_pre() {
|
||||||
mkdir -p $(dirname $pidfile)
|
mkdir -p $(dirname $pidfile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
|
@ -41,3 +41,5 @@ reload() {
|
|||||||
start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
|
start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
|
||||||
eend $?
|
eend $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
|
@ -31,3 +31,5 @@ name="Hardware Abstraction Layer Daemon"
|
|||||||
depend() {
|
depend() {
|
||||||
need dbus
|
need dbus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
|
@ -114,3 +114,5 @@ stop_post() {
|
|||||||
umount "${named_chroot}"/dev 2>/dev/null || true
|
umount "${named_chroot}"/dev 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
|
@ -57,3 +57,5 @@ start_pre() {
|
|||||||
command_args="${command_args} -u ntpd:ntpd -i ${ntpd_chroot}"
|
command_args="${command_args} -u ntpd:ntpd -i ${ntpd_chroot}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
|
@ -89,3 +89,5 @@ start_pre() {
|
|||||||
command_args="${command_args} --cd ${openvpn_dir}"
|
command_args="${command_args} --cd ${openvpn_dir}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
|
@ -31,3 +31,5 @@ name="PolicyKit Daemon"
|
|||||||
depend() {
|
depend() {
|
||||||
need dbus
|
need dbus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
|
@ -53,3 +53,5 @@ start_pre() {
|
|||||||
|
|
||||||
${command} -t
|
${command} -t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
|
@ -32,7 +32,7 @@ depend() {
|
|||||||
|
|
||||||
do_mtab() {
|
do_mtab() {
|
||||||
# Don't create mtab if /etc is readonly
|
# Don't create mtab if /etc is readonly
|
||||||
if ! cp /dev/null >/etc/mtab 2>/dev/null; then
|
if ! cp /dev/null /etc/mtab 2>/dev/null; then
|
||||||
ewarn "Skipping /etc/mtab initialization (ro root)"
|
ewarn "Skipping /etc/mtab initialization (ro root)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
@ -591,4 +591,4 @@ iwconfig_post_stop() {
|
|||||||
#iwconfig "${IFACE}" txpower 0 2>/dev/null
|
#iwconfig "${IFACE}" txpower 0 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# vim: set ts=4
|
# vim: set ts=4 :
|
||||||
|
@ -16,3 +16,5 @@ install:
|
|||||||
|
|
||||||
all:
|
all:
|
||||||
clean:
|
clean:
|
||||||
|
|
||||||
|
# vim: set ts=4 :
|
||||||
|
@ -24,10 +24,11 @@
|
|||||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
# SUCH DAMAGE.
|
# SUCH DAMAGE.
|
||||||
|
|
||||||
# void single_user()
|
# udev needs this still
|
||||||
#
|
try() {
|
||||||
# Drop to a shell, remount / ro, and then reboot
|
"$@"
|
||||||
#
|
}
|
||||||
|
|
||||||
single_user() {
|
single_user() {
|
||||||
if [ "${RC_SYS}" = "VPS" ]; then
|
if [ "${RC_SYS}" = "VPS" ]; then
|
||||||
einfo "Halting"
|
einfo "Halting"
|
||||||
@ -99,7 +100,7 @@ mount_svcdir() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_rc_get_kv_cache=""
|
_rc_get_kv_cache=
|
||||||
get_KV() {
|
get_KV() {
|
||||||
[ -z "${_rc_get_kv_cache}" ] \
|
[ -z "${_rc_get_kv_cache}" ] \
|
||||||
&& _rc_get_kv_cache="$(uname -r)"
|
&& _rc_get_kv_cache="$(uname -r)"
|
||||||
|
@ -53,9 +53,9 @@ static char *applet = NULL;
|
|||||||
* 0 = no changes (nothing to do)
|
* 0 = no changes (nothing to do)
|
||||||
* 1+ = number of runlevels updated
|
* 1+ = number of runlevels updated
|
||||||
*/
|
*/
|
||||||
static ssize_t add (const char *runlevel, const char *service)
|
static int add (const char *runlevel, const char *service)
|
||||||
{
|
{
|
||||||
ssize_t retval = -1;
|
int retval = -1;
|
||||||
|
|
||||||
if (! rc_service_exists (service))
|
if (! rc_service_exists (service))
|
||||||
eerror ("%s: service `%s' does not exist", applet, service);
|
eerror ("%s: service `%s' does not exist", applet, service);
|
||||||
@ -73,9 +73,9 @@ static ssize_t add (const char *runlevel, const char *service)
|
|||||||
return (retval);
|
return (retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t delete (const char *runlevel, const char *service)
|
static int delete (const char *runlevel, const char *service)
|
||||||
{
|
{
|
||||||
ssize_t retval = -1;
|
int retval = -1;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if (rc_service_delete (runlevel, service)) {
|
if (rc_service_delete (runlevel, service)) {
|
||||||
@ -235,9 +235,9 @@ int rc_update (int argc, char **argv)
|
|||||||
if (! service)
|
if (! service)
|
||||||
eerror ("%s: no service specified", applet);
|
eerror ("%s: no service specified", applet);
|
||||||
else {
|
else {
|
||||||
ssize_t num_updated = 0;
|
int num_updated = 0;
|
||||||
ssize_t (*actfunc)(const char *, const char *);
|
int (*actfunc)(const char *, const char *);
|
||||||
size_t ret;
|
int ret;
|
||||||
|
|
||||||
if (action & DOADD) {
|
if (action & DOADD) {
|
||||||
actfunc = add;
|
actfunc = add;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user