All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephane Chazelas <stephane.chazelas@googlemail.com>
To: Colin Watson <cjwatson@ubuntu.com>
Cc: grub-devel@gnu.org, 632048@bugs.debian.org
Subject: Re: Bug#632048: segfault  in grub-setup
Date: Tue, 6 Sep 2011 15:50:10 +0100	[thread overview]
Message-ID: <20110906145010.GA15096@yahoo.fr> (raw)
In-Reply-To: <20110906081857.GE3355@riva.dynamic.greenend.org.uk>

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


  parent reply	other threads:[~2011-09-06 18:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <chaz20110906073924.GE23847@seebyte.com>
2011-09-06  8:18 ` Bug#632048: segfault in grub-setup Colin Watson
2011-09-06 10:45   ` Stephane Chazelas
2011-09-06 14:50   ` Stephane Chazelas [this message]
2011-09-06 18:50     ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-04 12:44     ` Vladimir 'φ-coder/phcoder' Serbinenko

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=20110906145010.GA15096@yahoo.fr \
    --to=stephane.chazelas@googlemail.com \
    --cc=632048@bugs.debian.org \
    --cc=cjwatson@ubuntu.com \
    --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.