X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=7af72a231900ecd392b440cc8ff682b3a8fb2b70;hp=904bbdb539655df73554f231041d4fee53aa1812;hb=b934d28953c11d52b45a6d4165dd9dfa565920af;hpb=80de8629cb3c1585c7b64247b9316c40cdb53593 diff --git a/autoconfig.functions b/autoconfig.functions index 904bbdb..7af72a2 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -76,6 +76,11 @@ checkgrmlsmall(){ checkgrmlusb(){ grep -q usb /etc/grml_version 2>>$DEBUG && return 0 || return 1 } + +# execute flite only if it's present +flitewrapper() { + [ -x /usr/bin/flite ] && flite -o play -t "$*" +} ### }}} # {{{ filesystems (proc, pts, sys) and fixes @@ -828,7 +833,7 @@ config_swspeak(){ if modprobe speakup_soft ; then eend 0 else - flite -o play -t "Fatal error setting up software speakup" + flitewrapper "Fatal error setting up software speakup" eend 1 return 1 fi @@ -841,18 +846,25 @@ config_swspeak(){ if [ -x /etc/init.d/speech-dispatcher ] ; then einfo "Starting speech-dispatcher." /etc/init.d/speech-dispatcher start 1>>DEBUG ; eend $? - einfo "Activating sftsyn in Kernel." - echo sftsyn >/proc/speakup/synth_name ; eend $? + if [ -r /proc/speakup/synth_name ] ; then + einfo "Activating sftsyn via /proc in Kernel." + echo sftsyn > /proc/speakup/synth_name ; eend $? + elif [ -r /sys/modules/speakup/parameters/synth ] ; then + einfo "Activating sftsyn via /sys in Kernel." + echo sftsyn > /sys/modules/speakup/parameters/synth ; eend $? + else + eerror "Error when configuring sftsyn via /proc or /sys." ; eend 1 + fi einfo "Just run swspeak if you want to use software synthesizer via speakup." - flite -o play -t "Finished activating software speakup. Just run swspeak when booting finished." + flitewrapper "Finished activating software speakup. Just run swspeak when booting finished." else eerror "speech-dispatcher not available. swspeak will not work without it." ; eend 1 - flite -o play -t "speech-dispatcher not available. speakup will not work without it." + flitewrapper "speech-dispatcher not available. speakup will not work without it." fi eoutdent else eerror "Kernel does not seem to support speakup. Skipping swspeak." ; eend 1 - flite -o play -t "Kernel does not seem to support speakup. Sorry." + flitewrapper "Kernel does not seem to support speakup. Sorry." fi fi } @@ -877,11 +889,11 @@ config_hwspeak(){ fi if [ -d /proc/speakup/ ] || grep -q speakup /proc/modules ; then - einfo "Kernel supports speakup now." ; eend 0 - flite -o play -t "Kernel supports speakup now." + 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 - flite -o play -t "Kernel or hardware do not seem to support speakup. Sorry." + flitewrapper "Kernel or hardware do not seem to support speakup. Sorry." fi fi } @@ -1771,7 +1783,7 @@ config_netconfig(){ config_blindsound(){ if checkbootparam "blind" ; then beep - flite -o play -t "welcome to the gremel system" + flitewrapper "welcome to the gremel system" fi } # }}} @@ -1779,7 +1791,7 @@ config_blindsound(){ # {{{ welcome sound config_welcome(){ if checkbootparam welcome ; then - flite -o play -t "welcome to the gremel system" + flitewrapper "welcome to the gremel system" fi } # }}}