[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Are BSD partitions not supported?

From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: Are BSD partitions not supported?
Date: Tue, 18 May 2010 22:20:30 +0200
User-agent: Mozilla-Thunderbird (X11/20091109)

C. P. Ghost wrote:
> 2010/5/18 Vladimir 'φ-coder/phcoder' Serbinenko <address@hidden>:
>> C. P. Ghost wrote:
>>> On Sun, May 16, 2010 at 6:24 PM, C. P. Ghost <address@hidden> wrote:
>>>> is support for BSD partitions (or maybe ufs2) broken in grub2 (1.98)?
>>> No replies so far? Could a developer *please* have a closer look
>>> at this?
>> Your mail is quite long and looks like a tech support request. If it is
>> such it's not right mailing list. Use address@hidden or IRC. If it's
>> a bug report please supply an image file which triggers bug.
>> BSD partitions are supported as long as part_msdos and part_bsd (not
>> necessary in release) are loaded.
> (2nd try, mailer swallowed the attachment)
> Thank you for replying.
> Of course, it is a bug report. The steps to create the image are
> very detailed and should be enough to reproduce the bug on a
> FreeBSD/amd64 system.
> Here's a 362k 7z-compressed image of a 25MB disk
> that contains one slice 's1' with a BSD partition 'a' and
> a UFS2 filesystem on it:
> Don't expect it to boot, because grub-install wasn't able
> to complete the task (grub-probe failed as in the long mail).
> The file system contains the /boot/grub/* files though: those
> were properly installed by grub-install. Just not the MBR.
> If I can provide more help, please do ask. :)
This bsdlabel has 2 strangenesses. First one is seen in your log:

  a:   497936       16    unused        0     0
In other words for some strange reason it's declared as unused entry slot.
Second one is that offsets are stored relative to host partition, not relative 
to disk start. While the first can be easily fixed by checking length instead 
of type, second one isproblematic since it would break all other images (I've 
checked with FreeBSD andNetBSD images I had under my hand). So we need 
areliable way to determine which way is used. I found few differing bytes 
between your image and my FreeBSD image (specifically bytes 0x(80)30-0x(80)3f) 
but nothing that would allow a reliable detection. If you can find out the 
reason and a way of detecting this diskrepancy it will help

=== modified file 'partmap/bsdlabel.c'
--- partmap/bsdlabel.c    2010-03-26 14:44:13 +0000
+++ partmap/bsdlabel.c    2010-05-18 20:00:06 +0000
@@ -64,11 +72,13 @@ bsdlabel_partition_map_iterate (grub_dis
       if (grub_disk_read (disk, p.offset, p.index, sizeof (be),  &be))
     return grub_errno;
-      p.start = grub_le_to_cpu32 (be.offset) - delta;
+      p.start = grub_le_to_cpu32 (be.offset);// - delta;
       p.len = grub_le_to_cpu32 (be.size);
       p.partmap = &grub_bsdlabel_partition_map;
-      if (be.fs_type != GRUB_PC_PARTITION_BSD_TYPE_UNUSED)
+      grub_dprintf ("bsdlabel", "%d, %d, %d\n", be.offset, be.size,
+      if (p.len != 0)
     if (hook (disk, &p))
       return grub_errno;

>>> TIA,
>>> -cpghost.
>> --
>> Regards
>> Vladimir 'φ-coder/phcoder' Serbinenko
> -cpghost.

Vladimir 'φ-coder/phcoder' Serbinenko

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]