[Sussex] Etch GRUB naughtiness

Steve Dobson steve at dobson.org
Sat Mar 8 07:07:49 UTC 2008


Hi Gavin

I think this is a PEBKAC error [1] not naughtiness on the part of
Debian.  My guess is that you're not obeying the Debian packaging rules
and you are pulling Tracy's Window boot stanza in the wrong place.

On Sat, 2008-03-08 at 00:56 +0000, Gavin Stevens wrote:
> This is the second time this has happened:
> 
> Tracy's PC has a dual boot of Windows & Etch. When I do a software
> update via the orange starburst icon & it includes a kernel update, the
> Windows entry in /boot/grub/menu.lst is wiped when the computer is
> restarted.
> 
> Personally, I am admire the spirit & thinking behind this, but it seems
> a bit naughty. It's also true that it takes seconds to fix it - or more
> to the point, it takes _me_ seconds to fix it. Tracy would be a bit
> stuck if it happened to her while I was out & she needed Windows (her
> migration to Debian is nearly complete, but not done just yet).
> 
> Is this normal behaviour for GRUB after such an update? Maybe it is but
> I don't recall Sarge ever doing it on Tracy's PC & she had the same dual
> boot with Sarge.

When a new kernel package is installed the post-install package scripts
runs update-grub(8) to generate the new grub menu.lst file.  This script
reads the old menu.lst and extracts some information from it.  It also
scans the /boot directory for kernel images that need stanzas.

The comments in the file do say how and where you apply your edits to be
compatible with update-grub(8).  For example if you wanted to add an
option to the change the console to the first serial port as console you
would added the option to a comment where the kernel boot options are
stored (it is the last line in the example below that is edited):

Before:
	## ## Start Default Options ##
	## default kernel options
	## default kernel options for automagic boot options
	## If you want special options for specific kernels use
	##         kopt_x_y_z
	## where x.y.z is kernel version. Minor versions can be
	##    omitted.
	## e.g. kopt=root=/dev/hda1 ro
	##      kopt_2_6_8=root=/dev/hdc1 ro
	##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
	# kopt=root=/dev/hda5 ro

After:
	## ## Start Default Options ##
	## default kernel options
	## default kernel options for automagic boot options
	## If you want special options for specific kernels use
	##         kopt_x_y_z
	## where x.y.z is kernel version. Minor versions can be
	##    omitted.
	## e.g. kopt=root=/dev/hda1 ro
	##      kopt_2_6_8=root=/dev/hdc1 ro
	##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
	# kopt=root=/dev/hda5 ro console=ttyS0,9600n8

Then you run update-grub(8) by hand and the console option is added to
all the boot options automagiclly.

Look for the text "AUTOMAGIC" in menu.lst.  The first instance of that
string, which is just above the snippet above, will be the comment:
	# 
	# Put static boot stanzas before and/or after AUTOMAGIC KERNEL
	# LIST

Then a on the next line is the start marker:
	### BEGIN AUTOMAGIC KERNELS LIST
	## lines between the AUTOMAGIC KERNELS LIST markers will be
	## modified by the debian update-grub script except for the
	## default options below

Then come the boot stanzas and finally the end marker:
	### END DEBIAN AUTOMAGIC KERNELS LIST

If you  follow the comments all should be fine.  Well it will if my
guess about how you've edited the file is correct.  So just move the
Windows stanza to before or after the markers (I would guess depend
weather you want Debian or Windows to be the top item in the boot menu)
and then run update-grub(8) by hand.

Note: The above code snippets have edited for e-mail width compatibility
and to retain the correct look.  On your system they may be laid out
slightly differently.

Steve

[1]	Problem
	Exists
	Between
	Keyboard
	And
	Chair
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20080308/46911c31/attachment.pgp 


More information about the Sussex mailing list