Beeping grub in Ubuntu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 16 Jun 2008, luke wrote:

> For Ubuntu, this file is /boot/grub/menu.lst.
> With nano, I simply went to a title line which wasn't commented out, 
> pressed alt-v once I was on the first letter of the word "Ubuntu" in the 
> title, and then hit control-g.  Did it for several, in fact.
> 
> Worked like a charm to get a beeping grub.
> 
> It beeps several times fast on my system when first starting grub, and as 
> a side benefit it also beeps every time I change lines with the up/down 
> keys, and just for good measure also beeps when I select a kernel for 
> booting.
> 
> Sadly it doesn't survive an update-grub.

Okay, here's how to make this easy.  Put a file somewhere, maybe 
/usr/local/sbin, or /boot/grub, or somewhere that makes sense to you, and 
call it something like "beepinggrub" or "beeps2grub" or what ever makes 
you feel all fuzzy and satisfied.  In it, place the following three 
lines:

#!/bin/sh
/bin/sed -ri.pre-beeps -e 's/^(title[ \t]+)([[:alnum:]_-])/\1\a\2/i' \
/boot/grub/menu.lst;

Of course, if your grub doesn't keep its control file in 
/boot/grub/menu.list, then change that path.  If you don't keep sh or sed 
in /bin, change that/those path(s) as well.

Then, "chmod 700 /usr/local/sbin/beeps2grub" or what ever you called it, 
and you are set.

Run beeps2grub any time you want to make sure that your grub will beep on 
the next boot (basically, any time you alter your menu.lst, thus removing 
the old beeps).

Before it makes any changes, sed will backup your menu.lst into a file 
called "menu.lst.pre-beeps".  If you don't like that name, change the 
".pre-beeps" after the "-ri".  If you don't want a backup at all, just 
remove the ".pre-beeps".

Buyer beware; no warranty of any kind is offered; if you explode in a ball 
of flames don't blame me; etc., etc..

 > Luke
> 
>  On Mon, 6 Nov 2006, Chuck Hallenbeck wrote:
> 
> > Thanks to Janina and the FC6 HOWTO-INSTALL for the inspiration for the 
> > following, although the details differ some:
> > 
> > 1. Edit the file /etc/grub/grub.lst with an editor that allows you to 
> > use control characters as data. I use edbrowse, but ed will do nicely, 
> > or vi.
> > 
> > 2. Look for lines containing the word "title" (lower case, no quotes) 
> > that are not commented out, i.e. have no hash mark in column 1.
> > 
> > 3. Replace the first letter of the word that follows "title" with a 
> > control-g and that very letter. That is, place the control-g just ahead 
> > of the first letter of the word that follows "title". The word is 
> > "Debian".
> > 
> > 4. Save your changes and exit.
> > 
> > That's it. It works great. However, although I haven't checked this, you 
> > will probably loose the beep when you do an update-grub, and will then 
> > have to repeat this procedure.
> > 
> > Theoretically you should do the above for every such line in the 
> > grub.lst file, but I doubt that you will be able to count the beeps, 
> > they will occur so rapidly. I only have one such line myself, so I have 
> > not checked that either.
> > 
> > HTH
> > 
> > Chuck
> > 
> > 
> 
> 

-- 
"Fiat money and sustainable society are not compatible." - Peter Cajander



[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]
  Powered by Linux