summaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2011-02-13 13:43:08 -0600
committerWilliam Hubbs <williamh@gentoo.org>2011-04-30 21:46:14 -0500
commit32e81d1a44f3bcce6cc2a23210bd5919ac2c45c2 (patch)
treea7a2093f2de73f8ad94bbdb3e2a8226e1ee88ae8 /init.d
parentstart xdm from autoconfig (diff)
downloadlivecd-tools-32e81d1a44f3bcce6cc2a23210bd5919ac2c45c2.tar.gz
livecd-tools-32e81d1a44f3bcce6cc2a23210bd5919ac2c45c2.tar.bz2
livecd-tools-32e81d1a44f3bcce6cc2a23210bd5919ac2c45c2.zip
move init.d scripts to a common directory
We have several init.d scripts, and some of the names clash with other parts of the package, so I have moved them to an init.d directory.
Diffstat (limited to 'init.d')
-rwxr-xr-xinit.d/autoconfig610
-rwxr-xr-xinit.d/fixinittab102
-rw-r--r--init.d/gpm-pre36
-rwxr-xr-xinit.d/spind17
-rwxr-xr-xinit.d/unmute49
5 files changed, 814 insertions, 0 deletions
diff --git a/init.d/autoconfig b/init.d/autoconfig
new file mode 100755
index 0000000..9eec5ce
--- /dev/null
+++ b/init.d/autoconfig
@@ -0,0 +1,610 @@
+#!/sbin/runscript
+
+# This script is used by Gentoo release media to start certain services and to
+# ensure a sane setup for a CD-based boot.
+
+ACPI="yes"
+ALSA="yes"
+APM="no"
+BRLTTY="no"
+COLDPLUG="yes"
+DETECT="yes"
+DHCP="yes"
+DMRAID="yes"
+EVMS="no"
+FIREWIRE="yes"
+GPM="yes"
+IDEDMA="yes"
+LVM="no"
+MDADM="yes"
+NET="yes"
+NFS="yes"
+PASSWD="yes"
+PATA="yes"
+PCMCIA="yes"
+SATA="yes"
+SCSI="no"
+SPEAKUP="no"
+SPEAKUP_MODULE=""
+SPEAKUP_OPTIONS=""
+SSHD="no"
+USB="yes"
+X11="yes"
+
+get_config() {
+ CMDLINE="$(cat /proc/cmdline)"
+
+ for x in ${CMDLINE} ; do
+ case "${x}" in
+ # We put nodetect first, so we can override it with do* commands
+ nodetect)
+ ACPI="no"
+ ALSA="no"
+ APM="no"
+ COLDPLUG="no"
+ DETECT="no"
+ DMRAID="no"
+ EVMS="no"
+ FIREWIRE="no"
+ GPM="no"
+ LVM="no"
+ MDADM="no"
+ NET="no"
+ NFS="no"
+ PCMCIA="no"
+ PATA="no"
+ SATA="no"
+ SCSI="no"
+ USB="no"
+ X11="no"
+ ;;
+ noapm)
+ APM="no"
+ ;;
+ nocoldplug|nohotplug)
+ COLDPLUG="no"
+ ;;
+ nodhcp)
+ DHCP="no"
+ ;;
+ nodmraid)
+ DMRAID="no"
+ ;;
+ noevms|noevms2)
+ EVMS="no"
+ ;;
+ nofirewire)
+ FIREWIRE="no"
+ ;;
+ nogpm)
+ GPM="no"
+ ;;
+ noload=*)
+ NOLOAD="$*"
+ ;;
+ nolvm|nolvm2)
+ LVM="no"
+ ;;
+ nomdadm)
+ MDADM="no"
+ ;;
+ nonet)
+ NET="no"
+ ;;
+ nonfs)
+ NFS="no"
+ ;;
+ nopata)
+ PATA="no"
+ ;;
+ nopcmcia)
+ PCMCIA="no"
+ ;;
+ nosata)
+ SATA="no"
+ ;;
+ noscsi)
+ SCSI="no"
+ ;;
+ nosshd)
+ SSHD="no"
+ ;;
+ nosound)
+ ALSA="no"
+ ;;
+ nousb)
+ USB="no"
+ ;;
+ nox)
+ X11="no"
+ ;;
+ acpi\=on|acpi\=force)
+ ACPI="yes"
+ APM="no"
+ ;;
+ brltty=*)
+ BRLTTY="yes"
+ X11="no"
+ ;;
+ ide\=nodma)
+ IDEDMA="no"
+ ;;
+ doapm)
+ ACPI="no"
+ APM="yes"
+ ;;
+ docoldplug|dohotplug)
+ COLDPLUG="yes"
+ ;;
+ dodhcp)
+ DHCP="yes"
+ ;;
+ dodmraid)
+ DMRAID="yes"
+ ;;
+ doevms|doevms2)
+ EVMS="yes"
+ ;;
+ dofirewire)
+ FIREWIRE="yes"
+ ;;
+ dogpm)
+ GPM="yes"
+ ;;
+ dolvm|dolvm2)
+ LVM="yes"
+ ;;
+ domdadm)
+ MDADM="yes"
+ ;;
+ donet)
+ NET="yes"
+ ;;
+ dopata)
+ PATA="yes"
+ ;;
+ dopcmcia)
+ PCMCIA="yes"
+ ;;
+ dosata)
+ SATA="yes"
+ ;;
+ doscsi)
+ SCSI="yes"
+ ;;
+ dosshd)
+ SSHD="yes"
+ ;;
+ dosound)
+ SOUND="yes"
+ ;;
+ dousb)
+ USE="yes"
+ ;;
+ dox)
+ X11="yes"
+ ;;
+ passwd=*)
+ PASSWD="no"
+ PASSWORD="${x#*=}"
+ ;;
+ speakup.synth=*)
+ SPEAKUP="yes"
+ SPEAKUP_MODULE="speakup_${x#*=}"
+ X11="no"
+ ;;
+ speakup_*.{ser,port}=*)
+ SPEAKUP_OPTIONS="${SPEAKUP_OPTIONS} ${x#*.}"
+ ;;
+ esac
+ done
+}
+
+depend() {
+ get_config
+
+ if yesno "${SPEAKUP}"
+ then
+ modprobe ${SPEAKUP_MODULE} ${SPEAKUP_OPTIONS} > /dev/null 2>&1
+ fi
+
+ need modules $(list_services)
+ before net
+}
+
+# Checks whether a service will be started by autoconfig.
+# Usage: check_svc var service [service_alternative]
+check_svc() {
+ if yesno "${1}"
+ then
+ if rc-service -e "${2}"
+ then
+ echo "${2}"
+ elif [ -n "${3}" ] && rc-service -e "${3}"
+ then
+ echo "${3}"
+ fi
+ fi
+}
+
+# Prints an ordered list of services that will be started by autoconfig.
+list_services() {
+ get_config
+ # Must not print anything here
+ if yesno "${DETECT}"
+ then
+ local arch="$(uname -m)"
+
+ case ${arch} in
+ mips*)
+ ACPI="no"
+ APM="no"
+ IDEDMA="no"
+ ;;
+ i?86|x86_64)
+ :
+ ;;
+ alpha)
+ ACPI="no"
+ APM="no"
+ ;;
+ sparc*)
+ ACPI="no"
+ APM="no"
+ ;;
+ powerpc*)
+ ACPI="no"
+ APM="no"
+ ;;
+ ia64)
+ APM="no"
+ ;;
+ esac
+ fi
+
+ local svcs="$(check_svc ${ACPI} acpid)"
+ svcs="${svcs} $(check_svc ${ALSA} alsasound)"
+ svcs="${svcs} $(check_svc ${ALSA} unmute)"
+ if [ "${SPEAKUP_MODULE}" = "speakup_soft" ] && rc-service -e espeakup
+ then
+ svcs="${svcs} espeakup"
+ fi
+ svcs="${svcs} $(check_svc ${APM} apmd)"
+ svcs="${svcs} $(check_svc ${BRLTTY} brltty)"
+ svcs="${svcs} $(check_svc ${COLDPLUG} coldplug hotplug)"
+ svcs="${svcs} $(check_svc ${GPM} gpm)"
+ svcs="${svcs} $(check_svc ${IDEDMA} hdparm)"
+ svcs="${svcs} $(check_svc ${NFS} nfsmount)"
+ svcs="${svcs} $(check_svc ${PASSWD} pwgen)"
+ svcs="${svcs} $(check_svc ${PCMCIA} pcmcia)"
+ svcs="${svcs} $(check_svc ${SSHD} sshd)"
+ svcs="${svcs} $(check_svc ${X11} xdm)"
+
+ ### TODO: make this baselayout-2 compatible
+ ### TODO: make these checks accurate using service dependencies
+
+ echo ${svcs}
+}
+
+unpack_firmware() {
+ # This unpacks any firmware tarballs.
+ if [ -e /lib/firmware.tar.bz2 ]
+ then
+ ebegin "Unpacking firmware"
+ mkdir -p /lib/firmware
+ tar xjf /lib/firmware.tar.bz2 -C /lib/firmware
+ eend 0
+ fi
+}
+
+get_info() {
+ local tmp
+
+ if [ ! -z "${1}" -a ! -z "${2}" ]
+ then
+ tmp=$(grep "^$1[[:space:]]\+:" /proc/cpuinfo | head -n 1 | cut -d" " -f3-)
+ eval "${2}='${tmp}'"
+ fi
+}
+
+detect_mips() {
+ get_info "cpu model" cpuinfo
+ get_info "system type" machinfo
+ cpuinfo="${cpuinfo%% FPU*}"
+
+ case "${machinfo}" in
+ "SGI Indigo2")
+ case "${cpuinfo}" in
+ R4*)
+ machinfo="SGI Indigo2" # I2 R4x00
+ ;;
+ R8*)
+ machinfo="SGI Indigo2 Power" # I2 R8000
+ ;;
+ R10*)
+ machinfo="SGI Indigo2 Impact" # I2 R10000
+ ;;
+ esac
+ ;;
+ esac
+
+ PC="Detected an ${machinfo} w/ ${numcpu} ${cpuinfo} CPU(s)"
+}
+
+detect_x86_amd64_ia64() {
+ if [ "${1}" = "ia64" ]
+ then
+ get_info "family" cpuinfo
+ else
+ get_info "model name" cpuinfo
+ fi
+ get_info "cpu MHz" mhz
+ mhz="${mhz%%.*}MHz"
+
+ PC="Detected ${numcpu} ${cpuinfo} CPU(s) @ ${mhz}"
+}
+
+detect_alpha() {
+ get_info "platform string" machinfo
+ get_info "cpu" cpuinfo1
+ get_info "cpu model" cpuinfo2
+ get_info "cpus detected" numcpu
+
+ PC="Detected ${numcpu} ${cpuinfo1} ${cpuinfo2} CPU(s) in a ${machinfo} system"
+}
+
+detect_ppc() {
+ get_info "cpu" cpuinfo
+ get_info "clock" mhz
+ get_info "detected as" machinfo
+ machinfo="${machinfo##*\(}"
+ machinfo="${machinfo%%\)*}"
+
+ local machtype=""
+
+ case "${machinfo}" in
+ "CHRP Pegasos2")
+ machtype="Pegasos 2"
+ ;;
+ "CHRP IBM,9124-720")
+ machtype="IBM OP720"
+ ;;
+ "iBook 2 rev. 2")
+ machtype="Apple iBook G3"
+ ;;
+ "iMac G5"*)
+ machtype="Apple iMac G5"
+ ;;
+ "MPC8241")
+ machtype="Kurobox"
+ ;;
+ "PowerMac G5")
+ machtype="Apple PowerMac G5"
+ ;;
+ "PowerMac G5 Dual Core")
+ machtype="Apple PowerMac G5 Dual Core"
+ ;;
+ "PowerMac G4 AGP Graphics")
+ machtype="Apple PowerMac G4"
+ ;;
+ "PowerBook Titanium"|"PowerBook G4 15\"")
+ machtype="Apple Powerbook G4"
+ ;;
+ "Unknown Intrepid-based")
+ machtype="Apple Mac-Mini"
+ ;;
+ *)
+ machtype="Unknown PPC System"
+ ;;
+ esac
+
+ PC="Detected a(n) ${machtype} w/ ${numcpu} ${cpuinfo} CPU(s)"
+}
+
+detect_sparc() {
+ get_info "cpu" cpuinfo
+ get_info "ncpus active" numcpu
+ get_info "ncpus probed" numprobed
+
+ PC="Detected ${numcpu} active ${cpuinfo} CPU(s) of ${numprobed} total"
+}
+
+start() {
+ echo "0" > /proc/sys/kernel/printk
+ get_config
+
+ if yesno "${DETECT}"
+ then
+ ebegin "Hardware detection started"
+ local numcpu="$(grep -c '^processor[[:space:]]\+:' /proc/cpuinfo)"
+ local arch="$(uname -m)"
+
+ case ${arch} in
+ mips*)
+ detect_mips
+ ACPI="no"
+ APM="no"
+ IDEDMA="no"
+ ;;
+ i?86|x86_64)
+ detect_x86_amd64_ia64
+ ;;
+ alpha)
+ detect_alpha
+ ACPI="no"
+ APM="no"
+ ;;
+ sparc*)
+ detect_sparc
+ ACPI="no"
+ APM="no"
+ ;;
+ powerpc*)
+ detect_ppc
+ ACPI="no"
+ APM="no"
+ ;;
+ ia64)
+ detect_x86_amd64_ia64 "ia64"
+ APM="no"
+ ;;
+ *)
+ PC=
+ ;;
+ esac
+ [ -n "${PC}" ] && einfo "${PC}"
+ eend
+ else
+ ewarn "Hardware detection disabled via cmdline ..."
+ fi
+
+ # Now, we check if we are supposed to run a coldplug script.
+ if yesno "${COLDPLUG}"
+ then
+ # Check whether we should be using hotplug/coldplug or whether we should
+ # just let udev do it all.
+ # coldplug+hotplug would already be up due to list_services
+ if ! rc-service -e coldplug && ! rc-service -e hotplug
+ then
+ # TODO: This needs to go to a seperate script, so that hwsetup can depend on it.
+ unpack_firmware
+ [ -x /sbin/udevtrigger ] && /sbin/udevtrigger
+ fi
+ [ -e /etc/sysconfig ] || mkdir -p /etc/sysconfig
+ [ -x /usr/sbin/hwsetup ] && hwsetup
+ else
+ ewarn "Hotplug/Coldplug disabled via cmdline ..."
+ fi
+
+ if yesno "${APM}"
+ then
+ modprobe apm power_off=1 >/dev/null 2>&1 && \
+ einfo "APM BIOS found, power management functions enabled ..."
+ if ! service_started apmd
+ then
+ rc-service -i apmd start
+ fi
+ else
+ einfo "Not Loading APM Bios support ..."
+ fi
+
+ if yesno "${ACPI}"
+ then
+ modprobe processor >/dev/null 2>&1 && \
+ ebegin "ACPI power management functions enabled" && \
+ modprobe thermal >/dev/null
+ modprobe fan >/dev/null 2>&1
+ modprobe button >/dev/null 2>&1
+ modprobe battery >/dev/null 2>&1
+ modprobe ac >/dev/null 2>&1
+ modprobe thermal >/dev/null 2>&1
+ modprobe video >/dev/null 2>&1
+ modprobe dock >/dev/null 2>&1
+ if ! service_started acpid
+ then
+ rc-service -i acpid start
+ fi
+ eend
+ else
+ einfo "Not Loading ACPI support ..."
+ fi
+
+ if ! yesno "${IDEDMA}"
+ then
+ ewarn "Disabling IDE DMA support ..."
+ fi
+
+ if ! yesno "${PCMCIA}"
+ then
+ ewarn "PCMCIA disabled via cmdline ..."
+ fi
+
+ if ! yesno "${DHCP}"
+ then
+ sed -i -e '/^ifconfig_eth.*dhcp.*/ s/^/#/' \
+ -e '/^iface_eth.*dhcp.*/ s/^/#/' \
+ -e '/^config_eth.*dhcp.*/ s/^/#/' \
+ /etc/conf.d/net
+ for i in `seq 0 4`
+ do
+ echo "config_eth${i}=( \"none\" )" >> /etc/conf.d/net
+ done
+ ewarn "Skipping DHCP broadcast ..."
+ fi
+
+ # Read in what hwsetup has found
+ [ -f /etc/sysconfig/gentoo ] && source /etc/sysconfig/gentoo
+
+ # Mouse
+ # FIXME: If MOUSE_DEVICE is empty, we actually do not want to do anything, not even start gpm.
+ if [ -n "${MOUSE_DEVICE}" ]
+ then
+ :
+ # Migrated to autoconfig-gpm-pre
+ fi
+
+ if yesno "${DETECT}"
+ then
+ NETDEVICES="$(awk -F: '/eth.:|tr.:|ath.:|wlan.:/{print $1}' /proc/net/dev 2>/dev/null)"
+ else
+ DHCP="no"
+ fi
+
+ if [ -n "${NETDEVICES}" ]
+ then
+ for nics in ${NETDEVICES}
+ do
+ if yesno "${DHCP}"
+ then
+ einfo "Network device ${HILITE}${nics}${NORMAL} detected, DHCP broadcasting for IP ..."
+ if [ -f /var/run/dhcpcd-${nics}.pid ]
+ then
+ if [ -z "$(/sbin/ifconfig ${nics} | grep 'inet addr')" ]
+ then
+ kill $(cat /var/run/dhcpcd-${nics}.pid)
+ sleep 2
+ dhcpcd -n -h $(hostname) ${nics}
+ fi
+ fi
+ fi
+ done
+ if ! yesno "${PASSWD}"
+ then
+ echo "root:${PASSWORD}" | chpasswd > /dev/null 2>&1
+ fi
+ if yesno "${SSHD}"
+ then
+ # If we have passwd= on the command line, we do not run pwgen and we
+ # set the root password to PASSWORD.
+ if yesno "${PASSWD}"
+ then
+ ewarn "WARNING: You are starting sshd with a scrambled root password!!!"
+ ewarn "WARNING: You need to set a root password to be able to login remotely."
+ fi
+ fi
+ else
+ ewarn "No Network device auto detected ..."
+ fi
+
+ if yesno "${ALSA}"
+ then
+ if [ -n "${SOUND_FULLNAME}" -o -n "${SOUND_DRIVER}" ]
+ then
+ einfo "Soundcard: "
+
+ [ -n "${SOUND_FULLNAME}" ] \
+ && einfo " ${WARN}${SOUND_FULLNAME} "
+ [ -n "${SOUND_DRIVER}" ] \
+ && einfo " driver = ${SOUND_DRIVER}"
+ fi
+ else
+ ewarn "Skipping ALSA detection as requested on command line ..."
+ fi
+
+ [ -n "${XDESC}" ] && einfo "VideoCard: ${HILITE}${XDESC}${NORMAL}"
+
+ killall hwsetup 2>/dev/null
+ echo "6" > /proc/sys/kernel/printk
+}
+
+# vim: ts=4
diff --git a/init.d/fixinittab b/init.d/fixinittab
new file mode 100755
index 0000000..c65fcdc
--- /dev/null
+++ b/init.d/fixinittab
@@ -0,0 +1,102 @@
+#!/sbin/runscript
+
+depend()
+{
+ after root
+}
+
+start()
+{
+ if [ "${CDBOOT}" = "" ]
+ then
+ return 1
+ fi
+
+ einfo "adjusting inittab"
+ # Create a backup
+ cp -f /etc/inittab /etc/inittab.old
+
+ # Comment out current getty settings
+ sed -i -e '/^c[0-9]/ s/^/#/' /etc/inittab
+ sed -i -e '/^s[01]/ s/^/#/' /etc/inittab
+
+ # SPARC & HPPA console magic
+ if [ "${HOSTTYPE}" = "sparc" -o "${HOSTTYPE}" = "hppa" -o "${HOSTTYPE}" = "ppc64" ]
+ then
+ # Mount openprom tree for user debugging purposes
+ if [ "${HOSTTYPE}" = "sparc" ]
+ then
+ mount -t openpromfs none /proc/openprom
+ fi
+
+ # SPARC serial port A, HPPA mux / serial
+ if [ -c "/dev/ttyS0" ]
+ then
+ LIVECD_CONSOLE_BAUD=$(stty -F /dev/ttyS0 speed)
+ echo "s0:12345:respawn:/sbin/agetty -nl /bin/bashlogin ${LIVECD_CONSOLE_BAUD} ttyS0 vt100" >> /etc/inittab
+ fi
+ # HPPA software PDC console (K-models)
+ if [ "${LIVECD_CONSOLE}" = "ttyB0" ]
+ then
+ mknod /dev/ttyB0 c 11 0
+ LIVECD_CONSOLE_BAUD=$(stty -F /dev/ttyB0 speed)
+ echo "b0:12345:respawn:/sbin/agetty -nl /bin/bashlogin ${LIVECD_CONSOLE_BAUD} ttyB0 vt100" >> /etc/inittab
+ fi
+ # FB / STI console
+ if [ -c "/dev/vc/1" -o -c "/dev/tts/1" -o -c "/dev/tty2" ]
+ then
+ MODEL_NAME=$(cat /proc/cpuinfo |grep "model name"|sed 's/.*: //')
+ if [ "${MODEL_NAME}" = "UML" ]
+ then
+ for x in 0 1 2 3 4 5 6
+ do
+ echo "c${x}:12345:respawn:/sbin/mingetty --noclear --autologin root tty${x}" >> /etc/inittab
+ done
+ else
+ for x in 1 2 3 4 5 6
+ do
+ echo "c${x}:12345:respawn:/sbin/mingetty --noclear --autologin root tty${x}" >> /etc/inittab
+ done
+ fi
+ fi
+ if [ -c "/dev/hvc0" ]
+ then
+ einfo "Adding hvc console to inittab"
+ echo "s0:12345:respawn:/sbin/agetty -nl /bin/bashlogin 9600 hvc0 vt320" >> /etc/inittab
+ fi
+
+ # The rest...
+ else
+ if [ "${LIVECD_CONSOLE}" = "tty0" -o "${LIVECD_CONSOLE}" = "" ]
+ then
+ for x in 1 2 3 4 5 6
+ do
+ echo "c${x}:12345:respawn:/sbin/agetty -nl /bin/bashlogin 38400 tty${x} linux" >> /etc/inittab
+ done
+ else
+ einfo "Adding ${LIVECD_CONSOLE} console to inittab"
+ echo "s0:12345:respawn:/sbin/agetty -nl /bin/bashlogin ${LIVECD_CONSOLE_BAUD} ${LIVECD_CONSOLE} vt100" >> /etc/inittab
+ fi
+ fi
+
+ # EFI-based machines should automatically hook up their console lines
+ if dmesg | grep -q '^Adding console on'
+ then
+ dmesg | grep '^Adding console on' | while read x; do
+ line=`echo "$x" | cut -d' ' -f4`
+ id=e`echo "$line" | grep -o '.\{1,3\}$'`
+ [ "${line}" = "${LIVECD_CONSOLE}" ] && continue # already setup above
+ case "$x" in
+ *options\ \'[0-9]*) speed=`echo "$x" | sed "s/.*options '//; s/[^0-9].*//"` ;;
+ *) speed=9600 ;; # choose a default, only matters if it is serial
+ esac
+ echo "$id:12345:respawn:/sbin/agetty -nl /bin/bashlogin ${speed} ${line} vt100" >> /etc/inittab
+ done
+ fi
+
+ # force reread of inittab
+ telinit q
+
+ eend 0
+ return 0
+}
diff --git a/init.d/gpm-pre b/init.d/gpm-pre
new file mode 100644
index 0000000..af52b0e
--- /dev/null
+++ b/init.d/gpm-pre
@@ -0,0 +1,36 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# Do one of the following:
+# Add to /etc/rc.conf: rc_gpm_need="autoconfig-gpm-pre"
+# XOR
+# Add to /etc/conf.d/gpm: rc_need="autoconfig-gpm-pre"
+
+depend() {
+ before gpm
+ need hwsetup
+}
+
+start() {
+ # FIXME: If MOUSE_DEVICE is empty, we actually do not want to do anything, not even start gpm.
+ # created by hwsetup
+ source /etc/sysconfig/gentoo
+ source /etc/sysconfig/mouse
+ einfo "Mouse is ${HILITE}${MOUSE_FULLNAME}${NORMAL} at ${HILITE}${MOUSE_DEVICE}${NORMAL} ..."
+
+ if [ $(grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm) ]; then
+ sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
+ else
+ echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
+ fi
+
+ if [ $(grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm) ]; then
+ sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm
+ else
+ echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm
+ fi
+}
+
+# vim: ft=gentoo-init-d:
diff --git a/init.d/spind b/init.d/spind
new file mode 100755
index 0000000..1a9a5f5
--- /dev/null
+++ b/init.d/spind
@@ -0,0 +1,17 @@
+#!/sbin/runscript
+
+depend() {
+ before local
+}
+
+start() {
+ ebegin "Starting spin daemon"
+ start-stop-daemon --start --quiet --exec /usr/sbin/spind &
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping spind"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/spind
+ eend $?
+}
diff --git a/init.d/unmute b/init.d/unmute
new file mode 100755
index 0000000..7e73c83
--- /dev/null
+++ b/init.d/unmute
@@ -0,0 +1,49 @@
+#!/sbin/runscript
+
+depend()
+{
+ need alsasound
+}
+
+start()
+{
+ if [ -e /proc/asound/cards ]
+ then
+ for i in $(cat /proc/asound/cards | awk '{print $1}' | grep ^[[:digit:]])
+ do
+ einfo "unmuting sound card $i"
+ if [ -d /proc/asound/card$i ] && [ -x /usr/bin/amixer ]
+ then
+ amixer -c $i scontrols > /etc/amixer
+ [ -n "$(grep Master /etc/amixer)" ] \
+ && amixer -c $i -q set Master 95% unmute \
+ >/dev/null 2>&1
+ [ -n "$(grep Front /etc/amixer)" ] \
+ && amixer -c $i -q set Front 95% unmute \
+ >/dev/null 2>&1
+ [ -n "$(grep HDMI /etc/amixer)" ] \
+ && amixer -c $i -q set HDMI 95% unmute \
+ >/dev/null 2>&1
+ [ -n "$(grep IEC958 /etc/amixer)" ] \
+ && amixer -c $i -q set IEC958 95% unmute \
+ >/dev/null 2>&1
+ [ -n "$(grep PCM /etc/amixer)" ] \
+ && amixer -c $i -q set PCM 95% unmute \
+ >/dev/null 2>&1
+ [ -n "$(grep Speaker /etc/amixer)" ] \
+ && amixer -c $i -q set Speaker 95% unmute \
+ >/dev/null 2>&1
+ [ -n "$(grep Mic /etc/amixer)" ] \
+ && amixer -c $i -q set Mic 95% mute cap \
+ >/dev/null 2>&1
+ [ -n "$(grep Wave /etc/amixer)" ] \
+ && amixer -c $i -q set Wave 95% unmute \
+ >/dev/null 2>&1
+ [ -n "$(grep Capture /etc/amixer)" ] \
+ && amixer -c $i -q set Capture 95% unmute cap \
+ >/dev/null 2>&1
+ fi
+ done
+ fi
+ return 0
+}