From dda0435e12624f4123dda850d5fec6f8a091b31a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Sat, 24 Oct 2026 01:14:57 -0300 Subject: [PATCH] fix(genesis): report the system UUID that the kernel prints Genesis discovery swapped the first three fields of product_uuid before it sent the UUID. When that was written, the kernel printed the SMBIOS bytes in their stored order, and the swap gave the UUID that dmidecode prints. Since Linux 3.8 product_uuid is that UUID already, so the swap stores vpd.uuid in SMBIOS byte order. makedhcp then reverses it again, and the DHCPv6 reservation does not match the DUID that UEFI firmware sends. Discovery now reports product_uuid as it is, as the OpenEmbedded Genesis does. doxcat keeps the swap in the DUID that it writes for dhclient, because the swap gives the DUID that the firmware sends. Windows provisioning links the node file under both UUID orders and does not change. (cherry picked from commit 1a6cd4259ca8b71fc12aa03e61b88b60705d7889) (cherry picked from commit dfdc48b96d8345152756f25b4e1590ae543863d9) --- xCAT-genesis-scripts/usr/bin/dodiscovery | 3 ++- xCAT-genesis-scripts/usr/bin/doxcat | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xCAT-genesis-scripts/usr/bin/dodiscovery b/xCAT-genesis-scripts/usr/bin/dodiscovery index 9657c6bbe9..1fe0e05901 100755 --- a/xCAT-genesis-scripts/usr/bin/dodiscovery +++ b/xCAT-genesis-scripts/usr/bin/dodiscovery @@ -112,7 +112,8 @@ if [ -r /sys/devices/virtual/dmi/id/product_name ]; then #x86 echo $line > /tmp/cpumod done CPUTYPE=`cat /tmp/cpumod|awk -F':' '{print $2}'|sed -e 's/^ //'` - UUID=`sed -e 's/\(..\)\(..\)\(..\)\(..\)-\(..\)\(..\)-\(..\)\(..\)/\4\3\2\1-\6\5-\8\7/' /sys/devices/virtual/dmi/id/product_uuid` + # makedhcp derives the firmware DUID from vpd.uuid, so report the UUID that dmidecode prints. + UUID=`cat /sys/devices/virtual/dmi/id/product_uuid` elif [ -r /proc/device-tree/model ]; then #POWER MTM=`cat /proc/device-tree/model -vT | sed -e 's/^.*,//' | sed -e 's/^[\t ]*//'| sed -e 's/[\t ]*\^@//'` diff --git a/xCAT-genesis-scripts/usr/bin/doxcat b/xCAT-genesis-scripts/usr/bin/doxcat index 2338e3337b..76fdd69ab8 100755 --- a/xCAT-genesis-scripts/usr/bin/doxcat +++ b/xCAT-genesis-scripts/usr/bin/doxcat @@ -67,7 +67,7 @@ fi if [ -r /sys/devices/virtual/dmi/id/product_uuid ]; then duid='default-duid "\\000\\004'; - #product_uuid in sysfs fails to cope with endianness of SMBIOS 2.6, unconditionnaly swap. Technically leads to incorrect DUID in 'older' systems but matches MS behavior + # EDK2 firmware sends the SMBIOS bytes, and product_uuid prints the first three fields byte-swapped. for i in `sed -e 's/\(..\)\(..\)\(..\)\(..\)-\(..\)\(..\)-\(..\)\(..\)/\4\3\2\1-\6\5-\8\7/;s/-//g;s/\(..\)/\1 /g' /sys/devices/virtual/dmi/id/product_uuid`; do octnum="\\"`printf "\\%03o" 0x$i` duid=$duid$octnum