-if checkbootparam "console"; then
- einfo "Bootoption (for serial) console detected."
- eindent
- if [ -r /etc/mgetty/mgetty.config ] ; then
- MODE=$(getbootparam console | awk -F, '{print $2}')
- MODE=${MODE%%n*}
- [ -n "$MODE" ] || MODE=9600 # default mode
- einfo "Setting speed in /etc/mgetty/mgetty.config to $MODE bps"
- sed -i "s/speed [0-9]*/speed $MODE/" /etc/mgetty/mgetty.config ; eend $?
- fi
-
- einfo "Activating mgetty."
- sed -i 's/^#T0/T0/' /etc/inittab
- sed -i 's/^#T1/T1/' /etc/inittab
- /sbin/telinit q ; eend $?
- eoutdent
-fi
-}
-# }}}
-
-# For burning on IDE-CD-Roms, k3b (and others) check for special permissions {{{
-config_cdrom_perm(){
-CDROMS=""
-for DEVICE in /proc/ide/hd?; do
- [ "$(cat $DEVICE/media 2>/dev/null)" = "cdrom" ] && CDROMS="$CDROMS /dev/${DEVICE##*/}"
-done
-[ -n "$CDROMS" ] && { chown root.cdrom $CDROMS; chmod 666 $CDROMS; } 2>/dev/null
-}
-# }}}
-
-# {{{ Bring up loopback interface now
-config_local_net(){
- if [ -z "$INSTALLED" ] ; then
- if grep -q 'iface lo inet loopback' /etc/network/interfaces 2>/dev/null ; then
- grep -q lo=lo /etc/network/run/ifstate 2>/dev/null || ifup lo
- else
- ifconfig lo up
- fi
- fi
-}
-# }}}
-
-# firewire devices {{{
-# the raw1394 driver does not yet export info into SYSFS,
-# so let's create raw1394 device manually
-# http://www.michael-prokop.at/blog/index.php?p=352
-config_firewire_dev(){
-if checkbootparam "nofirewiredev" ; then
- ewarn "Skipping creating some firewire devices as requested on boot commandline." ; eend 0
-else
-#if [ "${KERNEL%-*}" == "2.6.11" ] ; then
- einfo "Creating some firewire devices (fix kernel 2.6-bug)."
-# cd /dev && MAKEDEV video1394 raw1394
- [ -r /dev/raw1394 ] || mknod /dev/raw1394 c 171 0
- [ -r /dev/video1394 ] || mknod -m 666 /dev/video1394 c 171 16
-# mknod -m 666 /dev/dv1394 c 171 32 # for NTSC
- [ -r /dev/dv1394 ] || mknod -m 666 /dev/dv1394 c 171 34 # for PAL
- chown -R root:video /dev/raw1394 /dev/video1394 /dev/dv1394
- chmod -R 664 /dev/raw1394 /dev/video1394 /dev/dv1394 ; eend $?
-fi
-#fi
-}
-# }}}
-
-# {{{ copy passwd-lockfile to ramdisk (fix unionfs-behaviour)
-# otherwise we will get: passwd: Authentication token lock busy
-config_fix_passwd(){
- if [ -z "$INSTALLED" ] ; then
- touch /etc/.pwd.lock
- fi
-}
-# }}}
-
-# {{{ CD Checker
-config_testcd(){
-if [ -n "$TESTCD" ]; then
- einfo "Checking CD data integrity as requested by '${WHITE}testcd${NORMAL}' boot option."
- einfo "Reading files and checking against GRML/md5sums, this may take a while..."
- echo -n "${RED}"
-
- if [ -n "${LIVECD_PATH}"/GRML ] ; then
- ( cd "${LIVECD_PATH}"/GRML ; rm -f /tmp/md5sum.log ; md5sum -c md5sums 2>&1 | tee /tmp/md5sum.log ; RC=$? )
- else
- echo "${RED} *** Error: Could not find md5sum file. ***"
- fi
-
- if [ "$RC" = "0" ]; then
- einfo "Everything looks OK" ; eend 0
- else
- eerror 'Checksum failed for theses files:' ; eend 1
- egrep -v '(^md5sum:|OK$)' /tmp/md5sum.log
- eerror 'Data on the grml medium is possibly incomplete/damaged or...'
- eerror '... RAM of your computer is broken.' ; eend 1
- einfon "Hit return to continue, or press the reset button to quit."
- read a
- fi
-
- eend 0
-fi
-}
-# }}}
-
-# {{{ hardware detection via discover
-config_discover(){
-if checkbootparam "nodisc" ; then
- ewarn "Skipping hardware detection via discover as requested on boot commandline." ; eend 0
-else
- if [ -x /sbin/discover ] ; then
- einfo "Discovering hardware. Trying to load the following modules in background:"
- eindent
- einfo "$(discover --data-path=linux/module/name --data-path=linux/modules/options --format="%s %s" --data-version=`uname -r` --enable-bus all | sort -u | xargs echo)"
- eoutdent
- /sbin/discover-modprobe -v 1>>$DEBUG 2>&1 &
- eend 0
- else
- eerror "Application discover not available. Information: udev should handle hardware recognition." ; eend 0
- fi
-fi
-}
-# }}}
-
-# {{{ hardware detection via hwinfo
-config_hwinfo(){
-if checkbootparam hwinfo >>$DEBUG 2>&1; then
- einfo "Discovering hardware via hwinfo:"
- MODULES=$(su grml hwinfo | grep "Cmd: \"modprobe" | awk '{print $5}' | sed 's/"//')
- echo -n " Loading modules: "
- for i in `echo $MODULES` ; do echo -n $i && modprobe $i ; done
- eend 0
-fi
-}
-# }}}
-
-# {{{ disable hotplug agents on request
-config_hotplug_agent(){
-if checkbootparam "noagent" ; then
- AGENT="$(getbootparam 'noagent' 2>>$DEBUG)"
- AGENTLIST=$(echo "$AGENT" | sed 's/,/\\n/g')
- AGENTNL=$(echo "$AGENT" | sed 's/,/ /g')
- einfo "Disabling hotplug-agent(s) $AGENTNL"
- for agent in $(echo -e $AGENTLIST) ; do
- mv /etc/hotplug/${agent}.rc /etc/hotplug/${agent}.norc
- done
- [ "$?" == "0" ] ; eend $?
-fi
-}
-# }}}
-
-# {{{ blacklist of hotplug-modules
-config_hotplug_blacklist(){
-if checkbootparam "black" ; then
- BLACK="$(getbootparam 'black' 2>>$DEBUG)"
- BLACKLIST=$(echo "$BLACK" | sed 's/,/\\n/g')
- BLACKNL=$(echo "$BLACK" | sed 's/,/ /g')
- einfo "Blacklisting $BLACKNL via /etc/hotplug/blacklist.d/hotplug-light"
- echo -e "$BLACKLIST" >> /etc/hotplug/blacklist.d/hotplug-light
- echo -e "$BLACKLIST" >> /etc/hotplug/blacklist
- eend 0
-fi
-}
-# }}}
-
-# {{{ run hotplug
-config_hotplug(){
-if checkbootparam "nohotplug" ; then
- ewarn "Skipping running hotplug as requested on boot commandline." ; eend 0
-else
- if [ -r /etc/init.d/hotplug ] ; then
- einfo "Starting hotplug system in background."
- /etc/init.d/hotplug start 1>>$DEBUG 2>>$DEBUG &
- eend 0
- elif [ -r /etc/init.d/hotplug-light ] ; then
- einfo "Starting hotplug-light system in background."
- /etc/init.d/hotplug-light start 1>>$DEBUG 2>>$DEBUG &
- eend 0
- else
- ewarn "No hotplug system found. Should be handled by udev. Skipping execution." ; eend 0
- fi
-fi
-}
-# }}}
-
-# {{{ blacklist specific module [ used in /etc/init.d/udev ]
-config_blacklist(){
-if checkbootparam "blacklist" ; then
- if [ -z "$INSTALLED" ]; then
- einfo "Bootoption blacklist found."
- BLACK="$(getbootparam 'blacklist' 2>>$DEBUG)"
- if [ -n "$BLACK" ] ; then
- for module in $(echo ${BLACK//,/ }) ; do
- einfo "Blacklisting module ${module} via /etc/modprobe.d/grml."
- echo "# begin entry generated by config_blacklist of grml-autoconfig" >> /etc/modprobe.d/grml
- echo "blacklist $module" >> /etc/modprobe.d/grml
- echo "alias $module off" >> /etc/modprobe.d/grml
- echo "# end entry generated by config_blacklist of grml-autoconfig" >> /etc/modprobe.d/grml ; eend $?
- done
- else
- eerror "No given module for blacklist found. Blacklisting will not work therefore."
- fi
- else
- ewarn "Backlisting via bootoption is not intended for use on harddisk installations." ; eend 1
- eindent
- einfo "Please blacklist the module(s) manually using the 'blacklist' script."
- eoutdent
- fi
-fi
-}
-# }}}
-
-# {{{ ACPI
-config_acpi_apm(){
-if [ -d /proc/acpi ]; then
- if checkbootparam "noacpi"; then
- ewarn "Skipping ACPI Bios detection as requested via noacpi on boot commandline." ; eend 0
- elif checkbootparam "nogrmlacpi" ; then
- ewarn "Skipping ACPI Bios detection as requested via nogrmlacpi on boot commandline." ; eend 0
- else
- einfo "ACPI Bios found, activating modules (disable via bootoption noacpi / nogrmlacpi): "
- eindent
- found=""
- for a in /lib/modules/$KERNEL/kernel/drivers/acpi/*; do
- basename="${a##*/}"
- basename="${basename%%.*}"
- case "$basename" in *_acpi)
- egrep -qi "${basename%%_acpi}" /proc/acpi/dsdt 2>>$DEBUG || continue ;;
- esac
- modprobe $basename >>$DEBUG 2>&1 && found="yes"
- local BASE="$BASE $basename"
- done
- if [ -n "$found" ] ; then
- einfo "$BASE" ; eend 0
- else
- ewarn "(none)" ; eend 1
- fi
- if ! ps x | grep -q /usr/sbin/acpid ; then
- if ! [ -r /var/run/dbus/pid ] ; then
- einfo "Starting acpi daemon."
- /etc/init.d/acpid start 1>>$DEBUG 2>&1 ; eend $?
- else
- eerror "acpid error: it seems you are running d-bus/hal, but acpid needs to be started before d-bus."
- eerror "Solution: please activate acpid via /etc/runlevel.conf"
- eend 1
- fi
- else
- ewarn "acpi daemon already running."
- eend 0
- fi
- eoutdent
- fi
-else
-# APM
- if checkbootparam "noapm"; then
- ewarn "Skipping APM Bios detection as requested on boot commandline." ; eend 0
- else
- modprobe apm power_off=1 >>$DEBUG 2>&1
- if [ "$?" = "0" ] ; then
- if [ -x /etc/init.d/apmd ] ;then
- einfo "APM Bios found, enabling power management functions."
- /etc/init.d/apmd start ; eend $?
- fi
- else
- eerror "Loading apm module failed." ; eend 1
- fi
- fi
-fi
-}
-# }}}
-
-# {{{ PCMCIA Check/Setup
-# This needs to be done before other modules are being loaded (by hwsetup)
-config_pcmcia(){
-if checkbootparam "nopcmcia"; then
- ewarn "Skipping PCMCIA detection as requested on boot commandline." ; eend 0
-else
- if /usr/sbin/laptop-detect ; then
- einfo "Detected Laptop - checking for PCMCIA." && eend 0
- modprobe pcmcia_core >>$DEBUG 2>&1
- # Try Cardbus or normal PCMCIA socket drivers
- modprobe yenta_socket >>$DEBUG 2>&1 || modprobe i82365 >>$DEBUG 2>&1 || modprobe pd6729 >>$DEBUG 2>&1 || modprobe tcic >>$DEBUG 2>&1
- if [ "$?" = "0" ]; then
- modprobe ds >>$DEBUG 2>&1
- if [ -d /proc/bus/pccard ] ; then
- if [ -x /sbin/cardmgr ] ; then
- einfo "PCMCIA found, starting cardmgr."
- cardmgr >>$DEBUG 2>&1 && sleep 6 && eend 0
- else
- eerror "No cardmgr found. Make sure package pcmciautils is installed, it should handle it instead." ; eend 1
- fi
- fi
- fi
- fi
-fi
-}
-# }}}
-
-# {{{ run software synthesizer via speakup
-config_swspeak(){
- if checkbootparam swspeak ; then
- einfo "Bootoption swspeak found."
-
- if [ ! -d /proc/speakup/ ] && ! grep -q speakup_soft /proc/modules ; then
- ewarn "Kernel does not support software speakup - trying to load kernel module:" ; eend 0
- eindent
- einfo "Loading speakup_soft"
- if modprobe speakup_soft ; then
- eend 0
- else
- flitewrapper "Fatal error setting up software speakup"
- eend 1
- return 1
- fi
- eoutdent
- fi
-
- if [ -d /proc/speakup/ ] || grep -q speakup_soft /proc/modules ; then
- einfo "Kernel supports speakup." ; eend 0
- eindent
- einfo "Just run swspeak if you want to use software synthesizer via speakup."
- flitewrapper "Finished activating software speakup. Just run swspeak when booting finished."
- eoutdent
- else
- eerror "Kernel does not seem to support speakup. Skipping swspeak." ; eend 1
- flitewrapper "Kernel does not seem to support speakup. Sorry."
- fi
- fi
-}
-# }}}
-
-# {{{ support hardware synthesizer via speakup
-config_hwspeak(){
- if checkbootparam speakup.synth ; then
- einfo "Bootoption speakup.synth found."
- eindent
-
- module="$(getbootparam speakup.synth 2>>$DEBUG)"
- if [ -z "$module" ] ; then
- eerror "Sorry, no speakup module specified for bootoption speakup.synth."
- flitewrapper "Sorry, no speakup module specified for bootoption speakup.synth."
- else
- einfo "Trying to load $module"
- modprobe "speakup_${module}"
- eend $?
- fi
-
- if [ -d /proc/speakup/ ] || grep -q speakup /proc/modules ; then
- einfo "Kernel should support speakup now." ; eend 0
- flitewrapper "Kernel should support speakup now."
- else
- eerror "Kernel or hardware do not seem to support speakup. Skipping hwspeak." ; eend 1
- flitewrapper "Kernel or hardware do not seem to support speakup. Sorry."
- fi
-
- eoutdent
-
- # hwspeak:
- elif checkbootparam hwspeak ; then
- einfo "Bootoption hwspeak found."
-
- if [ ! -d /proc/speakup/ ] && ! grep -q speakup /proc/modules ; then
- ewarn "Kernel does not support hardware speakup - trying to load kernel modules:" ; eend 0
- eindent
- if ! [ -d "/lib/modules/${KERNEL}/extra/speakup/" ] ; then
- eerror "Kernel does not provide speakup modules, sorry." ; eend 1
- else
- for module in $(find "/lib/modules/${KERNEL}/extra/speakup/" -name \*.ko | \
- sed 's#.*speakup/##g ; s#.ko$##g' | \
- grep -ve speakup_soft -ve speakup_dummy | sort -u) ; do
- einfo "Trying to load $module"
- modprobe $module
- eend $?
- done
- fi
- eoutdent
- fi
-
- if [ -d /proc/speakup/ ] || grep -q speakup /proc/modules ; then
- einfo "Kernel should support speakup now." ; eend 0
- flitewrapper "Kernel should support speakup now."
- else
- eerror "Kernel or hardware do not seem to support speakup. Skipping hwspeak." ; eend 1
- flitewrapper "Kernel or hardware do not seem to support speakup. Sorry."
- fi
- fi
-}
-# }}}