bug-parted
[Top][All Lists]
Advanced

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

Re: gcc bug causes parted to write bad GPT entries


From: Richard Hirst
Subject: Re: gcc bug causes parted to write bad GPT entries
Date: Mon, 18 Mar 2002 17:43:12 +0000
User-agent: Mutt/1.3.24i

On Mon, Mar 18, 2002 at 11:22:48AM -0600, address@hidden wrote:
> I don't think local CPU byte order matters.
> The RFC (hence libuuid) generates it in big-endian byte order always.
> EFI uses it in little-endian byte order always.
> So, the simple swab32 and swab16 calls make one into the other, but you've
> got to keep track of which way you're dealing with it to know when to call
> the swab.

Afer your patch, we call uuid_generate() which gives a BE struct, then
call the new swap_uuid_and_efi_guid(), giving a LE struct.  Then when we
come to write the data out to disk we call gpt_cpu_to_le_guid().  That
is fine on a LE CPU, but on a BE cpu it is going to swap, resulting in a
BE struct on disk.

> I've got no care one way or the other, as long as the EFI_GUID() macro
> follows suit also.  There, the values are written in big-endian notation (as
> all integers are when written out longhand), and those have some special
> globally-assigned meanings.

Right, I'd make sure the partition type GUIDs still loooked the same on
disk after any mods I make.

> If you'd like to make either patch, I'd be happy for it. :-)

OK, I'll give it a short while for any other comments to be made.

Cheers,
  Richard




reply via email to

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