X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=13fd9f4dfd68f8cce080d7a70f26a4a02c089cc4;hp=317323c9c4f711051751d17cb660c1171223b03a;hb=84f02a7ce07e4976c07521d8b1de5b364f3becc6;hpb=f2e718518cd811284a9b14a67fe3978deaa5a378 diff --git a/autoconfig.functions b/autoconfig.functions index 317323c..13fd9f4 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: Mit Jul 25 18:59:49 CEST 2007 [mika] +# Latest change: Die Sep 04 13:58:35 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 ] || INSTALLED="yes" +[ -e /etc/grml_cd ] || INSTALLED="yes" # testcd TESTCD="" @@ -444,11 +444,13 @@ update_progress(){ config_timezone(){ # don't touch the files if running from harddisk: if [ -z "$INSTALLED" ]; then - einfo "Setting timezone." - KTZ="$(getbootparam tz 2>>$DEBUG)" - [ -f "/usr/share/zoneinfo/$KTZ" ] && TZ="$KTZ" - rm -f /etc/localtime - cp "/usr/share/zoneinfo/$TZ" /etc/localtime && eend 0 + KTZ="$(getbootparam tz 2>>$DEBUG)" + if [ -n "$KTZ" ] ; then + einfo "Setting timezone." + [ -f "/usr/share/zoneinfo/$KTZ" ] && TZ="$KTZ" + rm -f /etc/localtime + cp "/usr/share/zoneinfo/$TZ" /etc/localtime ; eend $? + fi fi } # }}} @@ -588,21 +590,33 @@ config_fix_passwd(){ # {{{ 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}" - ( cd /cdrom/GRML/ ; rm -f /tmp/md5sum.log ; md5sum -c md5sums 2>&1 | tee /tmp/md5sum.log ) - 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} " - read a - fi - eend 0 + 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}" + + # /linuxrc grml version: + [ -d /cdrom/GRML ] && TESTCD_PATH=/cdrom/GRML + # live-initramfs version: + [ -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 ) + 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}" + read a + fi + + eend 0 fi } # }}} @@ -2367,4 +2381,4 @@ config_keyboard(){ # }}} ## END OF FILE ################################################################# -# vim:foldmethod=marker expandtab ai ft=zsh +# vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=3