mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-26 12:22:15 +00:00
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 dfdc48b96d)
This commit is contained in:
committed by
Daniel Hilst
parent
cfd9bdd4b4
commit
dda0435e12
@@ -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 ]*\^@//'`
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user