From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1R10ga-0005EH-2P for mharc-grub-devel@gnu.org; Tue, 06 Sep 2011 14:47:52 -0400 Received: from eggs.gnu.org ([140.186.70.92]:58490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0wym-0001IR-Tt for grub-devel@gnu.org; Tue, 06 Sep 2011 10:50:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0wyd-00034T-E0 for grub-devel@gnu.org; Tue, 06 Sep 2011 10:50:24 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:58707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0wyd-00034J-9d for grub-devel@gnu.org; Tue, 06 Sep 2011 10:50:15 -0400 Received: by wwf10 with SMTP id 10so5013440wwf.30 for ; Tue, 06 Sep 2011 07:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=9e3NvE4KKsdWoWNd81kzf9LotKMjF1VdO5MN5Jfwl6o=; b=FzoxoBuhLtg3/JQYIJBbhah7wZG4qcYJhyik8qeg766T1S/j77ifdXvDC/BsBIU+ln HhFyZanL6NNjL4H9FgmqwgW9vMvGft80jtBb+0Izt7HdluVkwL4oq6y+4woDWfEcWzoh p+MRw8bv5JLyCXXWNvnrh/ly5zzd0N3rzAHiI= Received: by 10.227.38.154 with SMTP id b26mr5160094wbe.14.1315320613544; Tue, 06 Sep 2011 07:50:13 -0700 (PDT) Received: from yahoo.fr (188-223-3-27.zone14.bethere.co.uk [188.223.3.27]) by mx.google.com with ESMTPS id fp5sm362174wbb.2.2011.09.06.07.50.11 (version=SSLv3 cipher=OTHER); Tue, 06 Sep 2011 07:50:12 -0700 (PDT) Date: Tue, 6 Sep 2011 15:50:10 +0100 From: Stephane Chazelas To: Colin Watson Subject: Re: Bug#632048: segfault in grub-setup Message-ID: <20110906145010.GA15096@yahoo.fr> References: <20110906081857.GE3355@riva.dynamic.greenend.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110906081857.GE3355@riva.dynamic.greenend.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 X-Mailman-Approved-At: Tue, 06 Sep 2011 14:47:51 -0400 Cc: grub-devel@gnu.org, 632048@bugs.debian.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2011 14:50:34 -0000 2011-09-06 09:18:57 +0100, Colin Watson: > On Tue, Sep 06, 2011 at 08:39:24AM +0100, Stephane Chazelas wrote: > > I do get a segfault as well when doing a grub-setup/grub-install > > on a mdraid with 1.2 metadata. > > > > The segv is in: > > > > grub_util_biosdisk_is_floppy() because the disk->id for the root > > device is not a bios disk id, but a big number that is the > > "array id". The patch below seems to fix it for me, though I > > can't tell it's the right fix or not (probably not). > > This fix makes sense to me; calling grub_util_biosdisk_is_floppy on > disks that aren't GRUB_DISK_DEVICE_BIOSDISK_ID doesn't make sense. > grub-devel, second opinion? > > > --- a/util/grub-setup.c 2011-09-05 12:11:31.864955442 +0100 > > +++ b/util/grub-setup.c 2011-09-05 13:00:24.891368760 +0100 > > @@ -315,7 +315,7 @@ > > /* If DEST_DRIVE is a hard disk, enable the workaround, which is > > for buggy BIOSes which don't pass boot drive correctly. Instead, > > they pass 0x00 or 0x01 even when booted from 0x80. */ > > - if (!allow_floppy && !grub_util_biosdisk_is_floppy (dest_dev->disk)) > > + if (!allow_floppy && dest_dev->disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID && !grub_util_biosdisk_is_floppy (dest_dev->disk)) > > /* Replace the jmp (2 bytes) with double nop's. */ > > *boot_drive_check = 0x9090; > > } [...] Well, anyway, even after that patch, it still doesn't work grub-install /dev/md0 reports success for nothing is written to any disk. grub-install /dev/sda or /dev/sdb doesn't work because it complains about a partition-less disk. Looks like it's not supported. Strange, as when started, grub can happily see files on 1.2 raids (using mdraid1x). Or did I miss something. I'll have to revert to 0.9 metadata for now. -- Stephane