[ipxe-devel] uuid mangling patch
Michael Brown
mbrown at fensystems.co.uk
Wed Mar 20 00:30:13 UTC 2013
On Tuesday 19 Mar 2013 16:16:10 Michael Brown wrote:
> Looks as though the endianness changed in SMBIOS 2.6, for some unknown
> reason:
>
> http://linux.derkeiler.com/Mailing-Lists/Kernel/2011-01/msg07703.html
>
> This is incredibly annoying to deal with; iPXE treats a UUID (from any
> source) as being an opaque sequence of bytes. It's only at the point of
> converting to a text string that we care about endianness, and at that
> point we have no knowledge of where the raw data came from.
I've pushed a patch to try to work around this problem:
http://git.ipxe.org/ipxe.git/commitdiff/9e896d0
UUIDs are still treated by iPXE as being in network byte order. At the point
of trying to read a UUID from SMBIOS (identified using a heuristic; it won't
catch all cases but should catch most), we check the SMBIOS version number
and, if it's 2.6 or newer, byte-swap the relevant fields to pretend that the
data was stored in network byte order to begin with.
The upshot is that using ${uuid} should perform magical byte-swapping as
needed, while the raw bytes can still be extracted using e.g. ${uuid:hex}.
Michael
More information about the ipxe-devel
mailing list