All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Bug#632048: segfault  in grub-setup
       [not found] <chaz20110906073924.GE23847@seebyte.com>
@ 2011-09-06  8:18 ` Colin Watson
  2011-09-06 10:45   ` Stephane Chazelas
  2011-09-06 14:50   ` Stephane Chazelas
  0 siblings, 2 replies; 5+ messages in thread
From: Colin Watson @ 2011-09-06  8:18 UTC (permalink / raw)
  To: grub-devel; +Cc: 632048-forwarded, Stephane Chazelas

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;
>    }

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug#632048: segfault  in grub-setup
  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
  1 sibling, 0 replies; 5+ messages in thread
From: Stephane Chazelas @ 2011-09-06 10:45 UTC (permalink / raw)
  To: Colin Watson; +Cc: grub-devel, 632048-forwarded

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;
> >    }
[...]

The fact that the problem doesn't occur with mdraid-0.9 makes me
think the problem might be somewhere else though (like that
dest_dev->disk should be a biosdisk above)..

-- 
Stephane


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug#632048: segfault  in grub-setup
  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
  2011-09-06 18:50     ` Vladimir 'φ-coder/phcoder' Serbinenko
  2012-02-04 12:44     ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 2 replies; 5+ messages in thread
From: Stephane Chazelas @ 2011-09-06 14:50 UTC (permalink / raw)
  To: Colin Watson; +Cc: grub-devel, 632048

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug#632048: segfault  in grub-setup
  2011-09-06 14:50   ` Stephane Chazelas
@ 2011-09-06 18:50     ` Vladimir 'φ-coder/phcoder' Serbinenko
  2012-02-04 12:44     ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 5+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2011-09-06 18:50 UTC (permalink / raw)
  To: pkg-grub-devel, stephane.chazelas, 632048,
	The development of GRUB 2, Colin Watson

[-- Attachment #1: Type: text/plain, Size: 2324 bytes --]

On 06.09.2011 18:50, Stephane Chazelas wrote:
> 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.
>
This command supposes that md0 is used as a disk for a VM
> grub-install /dev/sda
>           or /dev/sdb
>
> doesn't work because it complains about a partition-less disk.
>
Because you can't use RAID on disks for booting (except some cases but
it's not recommended even if they apply). Make a RAID of partitions and
leave 1M before the start of the single partition on the disk.
GRUB has done its job in telling that your setup is unbootable.
> 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.
>


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug#632048: segfault  in grub-setup
  2011-09-06 14:50   ` Stephane Chazelas
  2011-09-06 18:50     ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-04 12:44     ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 5+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-04 12:44 UTC (permalink / raw)
  To: Stephane Chazelas, 632048-done; +Cc: grub-devel, Colin Watson

The problem with floppy part was fixed and the attempt to install on 
partionless disk was a user error. Closing
On 06.09.2011 16:50, Stephane Chazelas wrote:
> 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.
>


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-02-04 12:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
2011-09-06 18:50     ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-04 12:44     ` Vladimir 'φ-coder/phcoder' Serbinenko

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.