X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=b69f79c30c2de8c7fcda8d106552bc6baf08c99f;hp=afecb537d4de6c3db3e42f8d4d26f50df560e10b;hb=27914b00e672a70311c89e2c462c83ef11c4da3b;hpb=8cbf3c62d6c200dc321924826b0dae39f20fadb4 diff --git a/autoconfig.functions b/autoconfig.functions index afecb53..b69f79c 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -222,13 +222,14 @@ config_language(){ [ -n "$LANGUAGE" ] || LANGUAGE='en' fi - # if bootoption lang is used update /etc/default/locale, otherwise *not*! - if [ -n "$BOOT_LANGUAGE" -a -x /usr/sbin/grml-setlang ] ; then - if checkgrmlsmall ; then - /usr/sbin/grml-setlang "POSIX" - else - /usr/sbin/grml-setlang "$LANGUAGE" - fi + if [ -x /usr/sbin/grml-setlang ] ; then + # if bootoption lang is used update /etc/default/locale accordingly + if [ -n "$BOOT_LANGUAGE" ] ; then + checkgrmlsmall && /usr/sbin/grml-setlang "POSIX" || /usr/sbin/grml-setlang "$LANGUAGE" + # otherwise default to lang=en + else + checkgrmlsmall && /usr/sbin/grml-setlang "POSIX" || /usr/sbin/grml-setlang "en" + fi fi # set console font @@ -353,8 +354,9 @@ config_hostname(){ if checkbootparam 'hostname' ; then HOSTNAME="$(getbootparam 'hostname' 2>>$DEBUG)" einfo "Setting hostname to $HOSTNAME as requested." - sed -i "s/^127.0.0.1.*localhost/127.0.0.1 $HOSTNAME localhost/" /etc/hosts - hostname $HOSTNAME ; eend $? + grml-hostname $HOSTNAME >>$DEBUG ; RC=$? + [ "$RC" = "0" ] && hostname $HOSTNAME + eend $RC else hostname --file /etc/hostname fi @@ -1425,10 +1427,11 @@ else eend 0 else SKIP_CPU_GOVERNOR=1 - eend $1 + eend $RC fi else - ewarn "Could not detect an appropriate CPU for use with cpu frequency scaling - skipping." && eend 1 + ewarn "Could not detect an appropriate CPU for use with cpu frequency scaling - skipping." + eend 1 fi # $MODULE fi # loadcpufreq