On Sat, 7 Nov 2020 12:36:42 -0500 Bruce Lilly <bruce.li...@gmail.com> wrote:
> I have a multiboot system with several OSes on the same hardware. > > Summary: OpenBSD UUID reported by dmidecode and from sysctl differ > significantly w.r.t. byte ordering. Multiple OSes report the same dmidecode > UUID, and most other OSes provide one or more alternate ways of accessing > the UUID which yields results consistent with dmidecode. > > Details: > dmidecode (after fiddling with kern.allowkmem via /etc/sysctl.conf on OpenBSD) > run on each OS that has a dmidecode utility reports the same hardware UUID > (modulo hexadecimal digit case), viz. > > UUID: 484B1340-D7AA-81E5-3CED-9C5C8E3D6756 > > OpenBSD (6.8) `sysctl hw.uuid` instead reports: > > hw.uuid=40134b48-aad7-e581-3ced-9c5c8e3d6756 > > Note that the differences are: > 1. case of hexadecimal digits (inconsequential) > 2. byte ordering (but inconsistently so between the initial part > and the last 64 bits (the latter part's byte ordering is consistent > with dmidecode)) > According to SMBIOS Reference Specification, you are correct. 7.2.1 Although RFC 4122 recommends network byte order for all fields, the PC industry (including the ACPI, UEFI, and Microsoft specifications) has consistently used little-endian byte encoding for the first three fields: time_low, time_mid, time_hi_and_version. The same encoding, also known as wire format, should also be used for the SMBIOS representation of the UUID. The UUID {00112233-4455-6677-8899-AABBCCDDEEFF} would thus be represented as: 33 22 11 00 55 44 77 66 88 99 AA BB CC DD EE FF. What are the ramifications of a changed UUID? What software depends on hw.uuid not changing? Greetings Ben --- Index: amd64/amd64/bios.c =================================================================== RCS file: /var/cvs/src/sys/arch/amd64/amd64/bios.c,v retrieving revision 1.43 diff -u -p -r1.43 bios.c --- amd64/amd64/bios.c 26 Aug 2020 03:29:05 -0000 1.43 +++ amd64/amd64/bios.c 7 Nov 2020 20:58:51 -0000 @@ -501,9 +501,9 @@ smbios_info(char *str) if (hw_uuid) { snprintf(hw_uuid, SMBIOS_UUID_REPLEN, SMBIOS_UUID_REP, - sys->uuid[0], sys->uuid[1], sys->uuid[2], - sys->uuid[3], sys->uuid[4], sys->uuid[5], - sys->uuid[6], sys->uuid[7], sys->uuid[8], + sys->uuid[3], sys->uuid[2], sys->uuid[1], + sys->uuid[0], sys->uuid[5], sys->uuid[4], + sys->uuid[7], sys->uuid[6], sys->uuid[8], sys->uuid[9], sys->uuid[10], sys->uuid[11], sys->uuid[12], sys->uuid[13], sys->uuid[14], sys->uuid[15]); Index: arm64/dev/smbios.c =================================================================== RCS file: /var/cvs/src/sys/arch/arm64/dev/smbios.c,v retrieving revision 1.6 diff -u -p -r1.6 smbios.c --- arm64/dev/smbios.c 26 Aug 2020 03:29:05 -0000 1.6 +++ arm64/dev/smbios.c 7 Nov 2020 21:00:32 -0000 @@ -410,9 +410,9 @@ smbios_info(char *str) if (hw_uuid) { snprintf(hw_uuid, SMBIOS_UUID_REPLEN, SMBIOS_UUID_REP, - sys->uuid[0], sys->uuid[1], sys->uuid[2], - sys->uuid[3], sys->uuid[4], sys->uuid[5], - sys->uuid[6], sys->uuid[7], sys->uuid[8], + sys->uuid[3], sys->uuid[2], sys->uuid[1], + sys->uuid[0], sys->uuid[5], sys->uuid[4], + sys->uuid[7], sys->uuid[6], sys->uuid[8], sys->uuid[9], sys->uuid[10], sys->uuid[11], sys->uuid[12], sys->uuid[13], sys->uuid[14], sys->uuid[15]); Index: i386/i386/bios.c =================================================================== RCS file: /var/cvs/src/sys/arch/i386/i386/bios.c,v retrieving revision 1.126 diff -u -p -r1.126 bios.c --- i386/i386/bios.c 26 Aug 2020 03:29:05 -0000 1.126 +++ i386/i386/bios.c 7 Nov 2020 21:02:17 -0000 @@ -1080,9 +1080,9 @@ smbios_info(char *str) if (hw_uuid) { snprintf(hw_uuid, SMBIOS_UUID_REPLEN, SMBIOS_UUID_REP, - sys->uuid[0], sys->uuid[1], sys->uuid[2], - sys->uuid[3], sys->uuid[4], sys->uuid[5], - sys->uuid[6], sys->uuid[7], sys->uuid[8], + sys->uuid[3], sys->uuid[2], sys->uuid[1], + sys->uuid[0], sys->uuid[5], sys->uuid[4], + sys->uuid[7], sys->uuid[6], sys->uuid[8], sys->uuid[9], sys->uuid[10], sys->uuid[11], sys->uuid[12], sys->uuid[13], sys->uuid[14], sys->uuid[15]);