On Fri, May 25, 2007 at 09:56:31AM +0200, Bart Samwel wrote: > Nathaniel Smith wrote: > >On Fri, May 25, 2007 at 09:48:00AM +0200, Bart Samwel wrote: > >>Hi Nathaniel, > >> > >>Thanks for the patch, I'll include it in the next update! Just checking: > >>why does the laptop_mode script crash if the modprobe fails? The way I > >>understand the code, when the modprobe fails it should just print an > >>error message about the modprobe and continue. > > > >Hmm, I didn't actually follow up in detail, it just printed some loud > >error message at me and didn't seem to be setting the governor, so I > >assumed that it must be using set -e or something. > > > >Though on further investigation, it looks like the error message may > >have just come from modprobe: > > ~$ sudo modprobe cpufreq_asdfsadf > > FATAL: Module cpufreq_asdfsadf not found. > >and perhaps I just didn't check closely enough whether it was actually > >working -- FATAL tends to be a discouraging thing to get from an > >/etc/init.d script :-). > > Yeah, I get that. :-) I'll include your patch, it'll shut up the error > message when the governor is already available, and it'll still show the > error message when it isn't. Or perhaps I should output something myself > when this fails, to give users a hint what they've done wrong.
Yeah... perhaps better would be something like modprobe cpufreq_$GOV >/dev/null 2>&1 # unconditional echo $GOV $CPU/cpufreq/governor if [ "x$(cat $CPU/cpufreq/governor)" != "x$GOV" ]; then echo Failed to set governer to $GOV fi -- Nathaniel -- Electrons find their paths in subtle ways. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]