All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabian Greffrath <greffrath@leat.rub.de>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Bug#461442: detection of other OSes in update-grub
Date: Wed, 06 Feb 2008 11:12:44 +0100	[thread overview]
Message-ID: <47A9881C.70908@leat.rub.de> (raw)

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:  greffrath@leat.ruhr-uni-bochum.de




             reply	other threads:[~2008-02-06 10:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-06 10:12 Fabian Greffrath [this message]
2008-02-06 12:02 ` Bug#461442: detection of other OSes in update-grub Robert Millan
     [not found] <4790C888.6040007@leat.rub.de>
     [not found] ` <87sl0v6iod.fsf@ossystems.com.br>
     [not found]   ` <20080119114939.GB10722@thorin>
     [not found]     ` <479450A9.90601@leat.rub.de>
     [not found]       ` <20080121112448.GD7378@thorin>
     [not found]         ` <47948422.8000208@leat.rub.de>
     [not found]           ` <20080121121828.GA9244@thorin>
     [not found]             ` <4795B435.20102@leat.rub.de>
     [not found]               ` <20080122124642.GC2017@thorin>
2008-01-22 13:14                 ` Fabian Greffrath
2008-01-22 16:56                   ` Robert Millan
2008-01-30 10:41                   ` Fabian Greffrath
2008-01-30 19:48                     ` Robert Millan
2008-01-31  8:31                       ` Fabian Greffrath
2008-01-31 10:10                         ` Otavio Salvador
2008-01-31 11:58                         ` Robert Millan
2008-01-31 14:26                           ` Fabian Greffrath
2008-01-31 14:39                             ` Robert Millan
2008-02-04  8:43                           ` Fabian Greffrath
2008-02-04 14:18                             ` Robert Millan
2008-02-04 14:47                               ` Fabian Greffrath
2008-02-04 15:04                                 ` Robert Millan
2008-02-04 15:27                             ` Marco Gerards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47A9881C.70908@leat.rub.de \
    --to=greffrath@leat.rub.de \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.