if [ -n "$secstate" ] ; then
einfo "SecureBoot is enabled" ; eend 0
else
- ewarn "SecureBoot not detected" ; eend 0
+ einfo "SecureBoot not detected" ; eend 0
fi
else
if modprobe efivars &>/dev/null ; then
if od -An -t u1 /sys/firmware/efi/vars/SecureBoot-*/data 2>/dev/null | grep -q 1 ; then
einfo "SecureBoot is enabled" ; eend 0
else
- ewarn "SecureBoot not detected" ; eend 0
+ einfo "SecureBoot not detected" ; eend 0
fi
fi
fi
# {{{ Sound
config_mixer () {
- if ! [ -x /usr/bin/amixer ] ; then
- eerror "amixer binary not available. Can not set sound volumes therefore."
- eend 1
- else
- if ! [ -r /proc/asound/cards ] ; then
- ewarn "No soundcard present, skipping mixer settings therefore."
- eend 0
- return
+ if ! [ -x /usr/bin/amixer ] ; then
+ logger -t grml-autoconfig "amixer binary not available"
+ return
+ fi
+
+ if ! [ -r /proc/asound/cards ] ; then
+ ewarn "No soundcard present, skipping mixer settings therefore."
+ eend 0
+ return
+ fi
+
+ for card in $(cat /proc/asound/cards| grep -e '^\s*[0-9]' | awk '{print $1}') ; do
+ einfo "Configuring soundcard \"$(awk -F\[ '/^ *'$card' \[/{ FS=" "; $0=$2; print $1}' < /proc/asound/cards)\""
+ eindent
+
+ if checkbootparam 'vol' ; then
+ VOL="$(getbootparam 'vol' 2>>$DEBUG)"
+ if [ -z "$VOL" ] ; then
+ eerror "Bootoption vol found but no volume level/parameter given. Using defaults (75%)."
+ VOL='75'
+ eend 1
fi
+ else
+ VOL='75'
+ fi
- for card in $(cat /proc/asound/cards| grep -e '^\s*[0-9]' | awk '{print $1}') ; do
- einfo "Configuring soundcard \"$(awk -F\[ '/^ *'$card' \[/{ FS=" "; $0=$2; print $1}' < /proc/asound/cards)\""
- eindent
+ if checkbootparam 'nosound' ; then
+ einfo "Muting sound devices on request."
+ ERROR=$(amixer -q set Master mute)
+ RC=$?
+ if [ -n "$ERROR" ] ; then
+ eindent
+ eerror "Problem muting sound devices: $ERROR"
+ eoutdent
+ fi
+ eend $RC
+ elif [ -z "$INSTALLED" ] ; then
+ einfo "Setting mixer volumes to level ${WHITE}${VOL}${NORMAL}."
- if checkbootparam 'vol' ; then
- VOL="$(getbootparam 'vol' 2>>$DEBUG)"
- if [ -z "$VOL" ] ; then
- eerror "Bootoption vol found but no volume level/parameter given. Using defaults (75%)."
- VOL='75'
- eend 1
- fi
- else
- VOL='75'
- fi
-
- if checkbootparam 'nosound' ; then
- einfo "Muting sound devices on request."
- ERROR=$(amixer -q set Master mute)
- RC=$?
- if [ -n "$ERROR" ] ; then
- eindent
- eerror "Problem muting sound devices: $ERROR"
- eoutdent
- fi
- eend $RC
- elif [ -z "$INSTALLED" ] ; then
- einfo "Setting mixer volumes to level ${WHITE}${VOL}${NORMAL}."
+ if checkbootparam 'micvol' ; then
+ MICVOL="$(getbootparam 'micvol' 2>>$DEBUG)"
+ einfo "Setting microphone to ${WHITE}${MICVOL}${NORMAL}."
+ else
+ MICVOL=0
+ fi
- if checkbootparam 'micvol' ; then
- MICVOL="$(getbootparam 'micvol' 2>>$DEBUG)"
- einfo "Setting microphone to ${WHITE}${MICVOL}${NORMAL}."
- else
- MICVOL=0
- fi
+ CONTROLS=$(amixer -c $card scontrols | awk -F"Simple mixer control " '{print $2}')
+ IFSOLD=${IFS:-}
+ IFS='
+ '
+ for CONTROL in ${=CONTROLS} ; do
+ # such devices can not be controlled with amixer ... unmute
+ [[ "$CONTROL" == *Console* ]] && continue
+
+ if ! echo "${CONTROL}" | grep -q -i "mic" ; then
+ if amixer -c $card sget "${CONTROL}" | grep -q 'Capabilities:.*pswitch' ; then
+ amixer -c $card -q set "${CONTROL}" unmute
+ fi
+ if amixer -c $card sget "${CONTROL}" | grep -q -P 'Capabilities:.*(pvolume| volume)' ; then
+ amixer -c $card -q set "${CONTROL}" "${VOL}"%
+ fi
+ fi
- CONTROLS=$(amixer -c $card scontrols | awk -F"Simple mixer control " '{print $2}')
- IFSOLD=${IFS:-}
- IFS='
-'
- for CONTROL in ${=CONTROLS} ; do
- # such devices can not be controlled with amixer ... unmute
- [[ "$CONTROL" == *Console* ]] && continue
-
- if ! echo "${CONTROL}" | grep -q -i "mic" ; then
- if amixer -c $card sget "${CONTROL}" | grep -q 'Capabilities:.*pswitch' ; then
- amixer -c $card -q set "${CONTROL}" unmute
- fi
- if amixer -c $card sget "${CONTROL}" | grep -q -P 'Capabilities:.*(pvolume| volume)' ; then
- amixer -c $card -q set "${CONTROL}" "${VOL}"%
- fi
- fi
-
- if [ ${MICVOL} -ne 0 ] ; then
- if amixer -c $card sget "${CONTROL}" | grep -q 'Capabilities:.*cswitch' ; then
- amixer -c $card -q set "${CONTROL}" unmute
- fi
- if amixer -c $card sget "${CONTROL}" | grep -q 'Capabilities:.*cvolume' ; then
- amixer -c $card -q set "${CONTROL}" $MICVOL%
- fi
- eend $?
- fi
- done
- IFS=$IFSOLD
- fi # checkbootparam 'nosound'
- eoutdent
+ if [ ${MICVOL} -ne 0 ] ; then
+ if amixer -c $card sget "${CONTROL}" | grep -q 'Capabilities:.*cswitch' ; then
+ amixer -c $card -q set "${CONTROL}" unmute
+ fi
+ if amixer -c $card sget "${CONTROL}" | grep -q 'Capabilities:.*cvolume' ; then
+ amixer -c $card -q set "${CONTROL}" $MICVOL%
+ fi
+ eend $?
+ fi
done
- fi
+ IFS=$IFSOLD
+ fi # checkbootparam 'nosound'
+ eoutdent
+ done
}
# }}}
}
# }}}
-# {{{ stats
-config_stats() {
- if ! checkbootparam 'nostats' ; then
- BASE_URL="http://stats.grml.org/report/"
- ACTION_NAME=Boot
-
- HOST_ID=$(cat /proc/sys/kernel/random/boot_id)
-
- grep -q " lm " /proc/cpuinfo && HAS_64BIT="1" || HAS_64BIT="0"
- DATE_STRING=$(date +'h=%H&m=%M&s=%S')
- [ -e /etc/grml_version ] && VERSION=$(cat /etc/grml_version) || \
- VERSION=$(lsb_release -d | awk -F: '{gsub(/^[ \t]+/, "", $2); print $2}')
-
- PARAMS="$( echo "$CMDLINE" | sed -e 's/=[^ ]*/=x/g' | tr " " "\n"|sort|tr "\n" " " )"
-
- echo "$CMDLINE" | grep -q -e "fetch" -e "nfsroot" && BOOT="remote"
- [ -z "$BOOT" ] && BOOT="local"
-
- ADDITIONAL_PARAMS=""
- ( [ -n "$COLUMNS" ] && [ -n "$LINES" ] ) && \
- ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS&res=$((COLUMNS * 8))x$((LINES * 16))"
-
- URI='$BASE_URL?action=${ACTION_NAME}\&$DATE_STRING\&unique_id=${HOST_ID}\&support_64bit=$HAS_64BIT\&version=$VERSION\&bootup=$BOOT\¶ms=$PARAMS$ADDITIONAL_PARAMS'
-
- get_remote_file "$URI" "/dev/null" >/dev/null 2>&1 &!
- fi
-}
-# }}}
-
# {{{ start X window system via grml-x
config_x_startup(){