grub-devel
[Top][All Lists]
Advanced

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

Re: Bug#461442: detection of other OSes in update-grub


From: Fabian Greffrath
Subject: Re: Bug#461442: detection of other OSes in update-grub
Date: Wed, 06 Feb 2008 11:12:44 +0100
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Hi!

From:     Marco Gerards
Thanks for this patch, however you didn't really describe the problem
you are solving.  I am not sure if this patch replaces your patch.
This thread was initiated with a follow up to a mail Robert sent
off-list.  So can you please describe what you are doing and why,
otherwise this is simply a piece of code to me that I have to review
;-)

So please explain what this is, I cannot accept patches if I do not
know why I should accept them.

Sorry, I wasn't aware of the fact that somebody might not know which context this patch is associated with. ;)

I have both Debian sid and Windows XP installed on my computer at work. Each time I install a new kernel in Debian the update-grub script is run and the new kernel is added to the boot menu. Fine so far, but I was annoyed by the fact that the update-grub script is not able to detect Windows on the other partition and add it to the boot menu as well (please see Debian bugs #461442 [1] and #462218 [2]).

However, there is the os-prober package [3] in Debian. This program test-mounts all possible partitions on your computer and checks for installled operating systems on these. It prints out a line for each OS it can find containing the corrensponding partition, the name, a short name and a boot keyword as a colon-separated string, e.g. "/dev/sda1:Windows NT/2000/XP:WinNT:chain". Based on this information it should be possible to add further operating systems to the boot menu via a script in /etc/grub.d that interprets the output of os-prober. This is what the second of the attached files from my previous email does.

You will notice that os-prober prints the operating system's partition as a system device, whereas GRUB has its own nomenclature for disc partitions. The first of the attached files from my previous email is a patch, that adds the ability to grub-probe to convert between systems devices and grub drives (but not vice versa ATM).

Hope this provides some clarity... ;)

Is this code only yours or did you use code from other places?

No, it's only my code. Of course there is a chance to find similar code in Debian-Installer or parts of GRUB, but this is only mine.

Huh, you are mixing C code with a shellscript?

Hey, of course not!

What does this code below do and why does it appear to be in this .c
file?

I have attached two files to my last mail (as explained before), which were mistakenly formatted in Thunderbird to appear inline as only one file. I believe it is obvious where the diff ends and where the shell scripts begins.

From:     Robert Millan
Uhm I'm not sure if that's a good thing or may be overkill.  What does everyone
else think about this?

I do not believe this is an overkill. Do you want grub-probe to print "i-dont-check-my-arguments" (grub-probe --target=device --device i-dont-check-my-arguments) ? Even worse, if you select another target than 'device' and if you don't check if the given parameter is *really* a device name, you will pass the faulty parameter over to the other functions that are called in probe () and fail with some "cannot stat ..." message . In my opinion this should not happen. Instead, grub-probe should fail gracefully with a dedicated error messge in this situation as proposed by my patch.

cheers,
Fabian

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=461442
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=462218
[3] http://packages.debian.org/sid/os-prober

--
Dipl.-Phys. Fabian Greffrath

Ruhr-Universität Bochum
Lehrstuhl für Energieanlagen und Energieprozesstechnik (LEAT)
Universitätsstr. 150, IB 3/134
D-44780 Bochum

Telefon: +49 (0)234 / 32-26334
Fax:     +49 (0)234 / 32-14227
E-Mail:  address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]