Interesting Behavior from Grub, How to Make it Beep

Martin McCormick martin at dc.cis.okstate.edu
Tue Nov 28 14:58:23 UTC 2006


	I am building a 2.6.5 kernel to go on a system that is
going to be a "tape recorder." so needs the sound to be working.
I have built a couple of dead on arrival kernels and am getting
tired of booting a rescue floppy, (tomsrtbt), and putting the
original menu.lst file back so it will boot in to the old but
working kernel that the Debian distribution disk put on.  This
means I must edit menu.lst which grub uses to let you choose
which kernel or even which operating system to boot from such as
Windows, etc.

	For anybody who is interested, making grub beep on a
system with a local speaker that can beep is very easy.  You just
fine the line that begins with the word "title" that isn't a
comment and put a Control-G at the end of the line since that
line is printed on the screen anyway.  The system I tried it on
gave a nice loud tone.

	Now, here's the parts of menu.lst I don't completely
understand.  In the menu.lst file for a Debian distribution, here
is what is in the two active booting paragraphs that are present.
Remember that if you use the serial install method on a Debian
distribution disk as in

linux console=ttyS1,9600n81

You will automatically get a talking installation through a
second computer if it is accessible and your console will default
to serial when the system is up and running.  The two paragraphs follow.

title		Debian GNU/Linux, kernel 2.4.27-2-386 
root		(hd0,0)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hda1 ro console=ttyS1,9600n81 
initrd		/boot/initrd.img-2.4.27-2-386
savedefault
boot

title		Debian GNU/Linux, kernel 2.4.27-2-386 (recovery mode)
root		(hd0,0)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hda1 ro console=ttyS1,9600n81 single
initrd		/boot/initrd.img-2.4.27-2-386
savedefault
boot

	The savedefault is supposed to make that paragraph the 0
entry.  Both of these have savedefault as their last line.

	If I want the 2.6.5 kernel to be an option, it should be
either 1 or 2 depending upon what that second savedefault did.
Now, for the really interesting part.

	After setting up this menu.lst file with the two original
paragraphs and my 2.6.5 start paragraph, I rebooted.  The system
gave the beep and I accidentally hit a number on the remote
keyboard which was on the second computer.  I should have  hit
the number on the computer that was booting to make the choice.
What happened was that the booting computer beeped again and
booted the recovery-mode version of that kernel.  grub must be
listening to the interrupts on the UARTS.  At the point where I
hit the number, there should have been no serial console alive yet.

	The number you hit on the remote keyboard makes no
difference and I think you could hit any key to get this
behavior, but it might be useful if it is consistent.

	Mainly, I am curious about the second savedefault line
and what it actually does.

	Thank you.

Martin McCormick WB5AGZ  Stillwater, OK 
Systems Engineer
OSU Information Technology Department Network Operations Group




More information about the Blinux-list mailing list