From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JMhGX-0008JB-CN for mharc-grub-devel@gnu.org; Wed, 06 Feb 2008 05:12:29 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMhGV-0008Hr-Nh for grub-devel@gnu.org; Wed, 06 Feb 2008 05:12:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMhGU-0008Gi-Ln for grub-devel@gnu.org; Wed, 06 Feb 2008 05:12:27 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMhGU-0008GS-CK for grub-devel@gnu.org; Wed, 06 Feb 2008 05:12:26 -0500 Received: from mx2.rz.ruhr-uni-bochum.de ([134.147.64.30]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JMhGU-00054q-0x for grub-devel@gnu.org; Wed, 06 Feb 2008 05:12:26 -0500 X-Queued: (qmail 7837 invoked by uid 281); 6 Feb 2008 10:12:24 -0000 X-Qmailscanner: from 134.147.252.214 by mx2.rz.ruhr-uni-bochum.de (envelope-from , uid 80) with qmail-scanner-2.01 (sophie: 3.05/2.52/4.24. Clear:RC:1(134.147.252.214):. Processed in 0.053895 secs); 06 Feb 2008 10:12:24 -0000 Received: from router.leat.ruhr-uni-bochum.de (134.147.252.214) by mx2.rz.ruhr-uni-bochum.de with SMTP; 6 Feb 2008 10:12:24 -0000 Received: from [134.147.55.45] (frodo.leat.ruhr-uni-bochum.de [134.147.55.45]) by router.leat.ruhr-uni-bochum.de (8.12.2/8.12.2/SuSE Linux 0.6) with ESMTP id m16AHC1l027253 for ; Wed, 6 Feb 2008 11:17:12 +0100 Message-ID: <47A9881C.70908@leat.rub.de> Date: Wed, 06 Feb 2008 11:12:44 +0100 From: Fabian Greffrath User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: The development of GRUB 2 References: 87lk6091xl.fsf@xs4all.nl Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 Subject: Re: Bug#461442: detection of other OSes in update-grub X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2008 10:12:28 -0000 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