GRUB2 issue [solved and at the end of the mail I added a wish for a default] - was: No audio - was: Real time for Ubuntu Studio 10.04 amd64

Ralf Mardorf ralf.mardorf at alice-dsl.net
Thu Aug 12 13:41:11 BST 2010


On Wed, 2010-07-28 at 20:34 +0100, Matt Wheeler wrote:
[snip]

On Thu, 2010-07-29 at 00:18 +0200, Gerhard Lang wrote:
[snip]

Hi :)

again thank you for the help, but I go another way.

I was annoyed after my manually edited grub.cfg was overwritten
by /usr/sbin/update-grub automatically, after installing a new kernel,
because it changed entries to boot from a broken, non-existing hard disk
after reading outdated menu.lsts, added unwanted boot splashes, changed
the wanted sequence for the menu entries.

First I removed any unwanted grub.cfg:


 # rm /boot/grub/grub.cfg*


Then I changed update-grub not to overwrite grub.cfg, but to generate a
file grub.cfg_date_time:


 # cat /usr/sbin/update-grub
 #!/bin/sh -e
 exec grub-mkconfig -o /boot/grub/grub.cfg "$@"

 # gedit /usr/sbin/update-grub

 # cat /usr/sbin/update-grub
 #!/bin/sh -e
 exec grub-mkconfig -o /boot/grub/grub.cfg_$(date +"%b-%d-%Y_%H-%M-%S")
"$@"


Generating a grub.cfg_date_time:


 # /usr/sbin/update-grub


Installing a new kernel:


 # synaptic


List all available grub.cfg*:


 # ls /boot/grub/grub.cfg* -hAl
 -r--r--r-- 1 root root 14K 2010-08-12
13:20 /boot/grub/grub.cfg_Aug-12-2010_13-20-02
 -r--r--r-- 1 root root 15K 2010-08-12
13:25 /boot/grub/grub.cfg_Aug-12-2010_13-25-35


Btw. update-grub is not only automatically run while a new kernel is
installed, but also if some other packages are upgraded.
If somebody wishes to see any changes, it's only needed to run diff:


 #
diff /boot/grub/grub.cfg_Aug-12-2010_13-20-02 /boot/grub/grub.cfg_Aug-12-2010_13-25-35
 133a134,151
 > menuentry 'Ubuntu, with Linux 2.6.31-11-rt' --class ubuntu --class
gnu-linux --class gnu --class os {
 > 	recordfail
 > 	insmod ext2
 > 	set root='(hd1,11)'
 > 	search --no-floppy --fs-uuid --set
54b5bb8c-356a-4268-8592-e76aac7941a8
 > 	linux	/boot/vmlinuz-2.6.31-11-rt
root=UUID=54b5bb8c-356a-4268-8592-e76aac7941a8 ro   quiet splash
 > 	initrd	/boot/initrd.img-2.6.31-11-rt
 > }
 > menuentry 'Ubuntu, with Linux 2.6.31-11-rt (recovery mode)' --class
ubuntu --class gnu-linux --class gnu --class os {
 > 	recordfail
 > 	insmod ext2
 > 	set root='(hd1,11)'
 > 	search --no-floppy --fs-uuid --set
54b5bb8c-356a-4268-8592-e76aac7941a8
 > 	echo	'Loading Linux 2.6.31-11-rt ...'
 > 	linux	/boot/vmlinuz-2.6.31-11-rt
root=UUID=54b5bb8c-356a-4268-8592-e76aac7941a8 ro single 
 > 	echo	'Loading initial ramdisk ...'
 > 	initrd	/boot/initrd.img-2.6.31-11-rt
 > }


So this will keep a customized grub.cfg, but also shows changes on the
machine. Unfortunately I don't have my customized grub.cfg anymore and
still have no time to edit a new one. Anyway, I could get one of those
annoying auto-generated grub.cfgs, just by renaming a
grub.cfg_date_time ;):


 # rm /boot/grub/grub.cfg_Aug-12-2010_13-20-02

 # mv /boot/grub/grub.cfg_Aug-12-2010_13-25-35 /boot/grub/grub.cfg

 # ls /boot/grub/grub.cfg* -hAl
 -r--r--r-- 1 root root 15K 2010-08-12 13:25 /boot/grub/grub.cfg


IMO at least generating a backup should be added to update-grub for
Ubuntu Studio by default, similar to this test:


 # cat update-grub-test
 #!/bin/sh -e
 mv /boot/grub/grub.cfg /boot/grub/grub.cfg~
 exec grub-mkconfig -o /boot/grub/grub.cfg "$@"

 # sh update-grub-test

 # ls /boot/grub/grub.cfg* -hAl
 -r--r--r-- 1 root root 15K 2010-08-12 14:13 /boot/grub/grub.cfg
 -r--r--r-- 1 root root 15K 2010-08-12 13:25 /boot/grub/grub.cfg~


Cheers!

Ralf




More information about the Ubuntu-Studio-users mailing list