On 05/31/2010 11:16 PM, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
Looks like we have to have different behaviour for different BSDs. Since it looks like generic code would fail for ThisBSD or ThatBSD, I propose to go by as-needed basis. So I think we should: -restrict bsdlabel to being embed into msdos partitions of types a5, a6 or a9. -conditionalise the behaviour and use my patch for a5 (FreeBSD) and current behaviour for a6 (OpenBSD) and a9 (NetBSD).
We could be a bit more general and assume that BSD label offsets are always relative except for NetBSD and OpenBSD msdos-embedded partitions. In particular, we should support BSD labels that are not embedded in an msdos partition. So bsdlabel_partition_map_iterate would do (in pseudo code): if disk->partition is not NULL /* embedded partition */ and disk->partition's partmap is msdos and disk->partition's msdos partition type is NetBSD or OpenBSD then interpret BSD label offsets as absolute /* (a) */ else interpret BSD label offsets as relative /* (b) */ fi In short, the normal interpretation of BSD label offsets would be the relative one (b), and we would make an exception to handle NetBSD and OpenBSD (a). Now, when BSD label offsets are detected absolute (a), should we consider them as absolute: - w.r.t. to the start of the disk (as is done in the code right now), or - w.r.t to the location of the msdos partmap? I prefer the second option since it is compatible with dd-ing an entire disk into an msdos partition. Maybe the loopback feature also requires the second option (I don't know the internals). Grégoire _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel