X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=f7d2af3ec17b2ad32c0be5451e064986fc109a14;hp=5566b24fd506ed13c30c55ee3b3ea30175b6fd9c;hb=d59aa289b111fb3258ffe057281367fa15713aa8;hpb=08499fcf9f7fb3f58da6fd67a56e504af4b961cc diff --git a/autoconfig.functions b/autoconfig.functions index 5566b24..f7d2af3 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Klaus Knopper , (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Die Sep 04 12:36:35 CEST 2007 [mika] +# Latest change: Son Sep 30 14:15:11 CEST 2007 [mika] ################################################################################ # {{{ path, variables, signals, umask, zsh @@ -96,7 +96,7 @@ CMDLINE="$(cat /proc/cmdline)" # {{{ Check if we are running from the grml-CD or HD INSTALLED="" -{ [ -e /GRML/etc/grml_cd ] || [ -r /etc/grml_cd ] } && INSTALLED="yes" +[ -e /etc/grml_cd ] || INSTALLED="yes" # testcd TESTCD="" @@ -157,11 +157,6 @@ fi } # }}} -# {{{ Check if we are in interactive startup mode -INTERACTIVE="" -stringinstring "BOOT_IMAGE=expert " "$CMDLINE" && INTERACTIVE="yes" -# }}} - # {{{ set firmware timeout via bootparam config_fwtimeout(){ if checkbootparam fwtimeout ; then @@ -262,10 +257,12 @@ config_language(){ # write keyboard related variables to file for later use [ -d /etc/sysconfig ] || mkdir /etc/sysconfig - echo "KEYTABLE=\"$KEYTABLE\"" > /etc/sysconfig/keyboard - echo "XKEYBOARD=\"$XKEYBOARD\"" >> /etc/sysconfig/keyboard - echo "KDEKEYBOARD=\"$KDEKEYBOARD\"" >> /etc/sysconfig/keyboard - echo "KDEKEYBOARDS=\"$KDEKEYBOARDS\"" >> /etc/sysconfig/keyboard + if ! [ -e /etc/sysconfig/keyboard ] ; then + echo "KEYTABLE=\"$KEYTABLE\"" > /etc/sysconfig/keyboard + echo "XKEYBOARD=\"$XKEYBOARD\"" >> /etc/sysconfig/keyboard + echo "KDEKEYBOARD=\"$KDEKEYBOARD\"" >> /etc/sysconfig/keyboard + echo "KDEKEYBOARDS=\"$KDEKEYBOARDS\"" >> /etc/sysconfig/keyboard + fi fi [ -r /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard @@ -273,20 +270,16 @@ config_language(){ # activate unicode console if running within utf8 environment if [ -r /etc/default/locale ] ; then if grep -q "LANG=.*UTF" /etc/default/locale ; then - if checkgrmlsmall && [ -z "$INSTALLED" ] ; then - ewarn "Not runnning unicode_start: grml-small with reduced language support detected." ; eend 0 - else - einfo "Setting up unicode environment." - unicode_start 2>>$DEBUG ; eend $? - fi + einfo "Setting up unicode environment." + unicode_start 2>>$DEBUG ; eend $? fi fi # Set default keyboard before interactive setup if [ -n "$KEYTABLE" ] ; then - einfo "Running loadkeys for ${WHITE}${KEYTABLE}${NORMAL} in background" - loadkeys -q $KEYTABLE & - eend $? + einfo "Running loadkeys for ${WHITE}${KEYTABLE}${NORMAL} in background" + loadkeys -q $KEYTABLE & + eend $? fi # we have to set up all consoles, therefore loop it over all ttys: @@ -600,19 +593,19 @@ if [ -n "$TESTCD" ]; then [ -d /live/image/GRML ] && TESTCD_PATH=/live/image/GRML if [ -n "$TESTCD_PATH" ] ; then - ( cd "$TESTCD_PATH" ; rm -f /tmp/md5sum.log ; md5sum -c md5sums 2>&1 | tee /tmp/md5sum.log ) + ( cd "$TESTCD_PATH" ; 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 [ "$?" = "0" ]; then - echo " ${GREEN}Everything looks OK${NORMAL}" - else - echo "${RED} *** CHECKSUM FAILED FOR THESE FILES: ***" - egrep -v '(^md5sum:|OK$)' /tmp/md5sum.log - echo "${RED} *** DATA ON YOUR CD MEDIUM IS POSSIBLY INCOMPLETE OR DAMAGED, ***${NORMAL}" - echo "${RED} *** OR YOUR COMPUTER HAS BAD RAM. ***${NORMAL}" - echo -n "${CYAN}Hit return to contine, or press the reset button to quit.${NORMAL}" + 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 @@ -751,10 +744,10 @@ if [ -d /proc/acpi ]; then else ewarn "(none)" ; eend 1 fi - if ! [ -S /var/run/acpid.socket ] ; then + 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 >>$DEBUG ; eend $? + /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" @@ -882,24 +875,8 @@ fi # {{{ Interactive configuration config_interactive(){ -if [ -n "$INTERACTIVE" ] ; then -einfo "Entering interactive configuration second stage." - - echo " ${GREEN}Your console keyboard defaults to: ${MAGENTA}${KEYTABLE}" - echo -n "${CYAN}Do you want to (re)configure your console keyboard?${NORMAL} [Y/n] " - read a - [ "$a" != "n" ] && /usr/sbin/dpkg-reconfigure console-data ; eend $? - - echo -n "${CYAN}Do you want to (re)configure your soundcard?${NORMAL} [Y/n] " - read a - [ "$a" != "n" ] && alsaconf && ( exec aumix -m 0 >>$DEBUG 2>&1 & ) ; eend $? - - echo -n "${CYAN}Do you want to (re)configure your graphics (X11) subsystem?${NORMAL} [Y/n] " - read a - [ "$a" != "n" ] && xorgcfg -textmode ; eend $? - echo " ${GREEN}Interactive configuration finished. Everything else should be fine for now.${NORMAL}" -fi -eend 0 + ewarn "config_interactive is deprecated nowadays." + ewarn "Please set CONFIG_INTERACTIVE='no' in /etc/grml/autoconfig" ; eend 0 } # }}} @@ -2125,7 +2102,8 @@ config_lvm(){ if checkbootparam 'nolvm' ; then ewarn "Skipping LVM code as requested on boot commandline." ; eend 0 else - if ! [ -x /sbin/lvm -a -x /etc/init.d/lvm2 -a -x /sbin/lvdisplay ] ; then + # Debian etch provides /etc/init.d/lvm only, newer suites provide /etc/init.d/lvm2 + if ! [ -x /sbin/lvm -a -x /sbin/lvdisplay ] || ! [ -x /etc/init.d/lvm2 -o -x /etc/init.d/lvm ] ; then eerror "LVM not available, can not execute it." ; eend 1 else if lvdisplay 2>&1 | grep -v 'No volume groups found' 1>/dev/null 2>&1 ; then