Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.auto.reg
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ sysuuid=$(echo $sysuuid | base64)
sysserial=$(dmidecode -s system-serial-number)
sysserial=${sysserial,,}
sysserial=$(echo $sysserial | base64)
# The board serial and chassis asset tag join the UUID and system serial
# so the server can identify this machine by firmware, not only by MAC
# (fogproject #198). A server that does not know the fields ignores them.
mbserial=$(dmidecode -s baseboard-serial-number)
mbserial=${mbserial,,}
mbserial=$(echo $mbserial | base64)
caseasset=$(dmidecode -s chassis-asset-tag)
caseasset=${caseasset,,}
caseasset=$(echo $caseasset | base64)
dots "Attempting to register host"
count=0
res=""
Expand All @@ -73,7 +82,7 @@ if [[ -f /sys/firmware/acpi/tables/MSDM ]]; then
productKey=$(tail -c+57 /sys/firmware/acpi/tables/MSDM | base64)
fi
while [[ -z $res ]]; do
callServer "${web}service/auto.register.php" "sysserial=${sysserial}&sysuuid=${sysuuid}&mac=$mac&productKey=${productKey}"
callServer "${web}service/auto.register.php" "sysserial=${sysserial}&sysuuid=${sysuuid}&mbserial=${mbserial}&caseasset=${caseasset}&mac=$mac&productKey=${productKey}"
res="$serverBody"
case $count in
[0-8])
Expand Down
16 changes: 14 additions & 2 deletions Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.man.reg
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,19 @@ mac=$(getMACAddresses | base64)
sysuuid=$(dmidecode -s system-uuid)
sysuuid=${sysuuid,,}
sysuuid=$(echo $sysuuid | base64)
callServer "${web}service/man.hostexists.php" "sysuuid=${sysuuid}&mac=$mac"
sysserial=$(dmidecode -s system-serial-number)
sysserial=${sysserial,,}
sysserial=$(echo $sysserial | base64)
# The board serial and chassis asset tag join the UUID and system serial
# so the server can identify this machine by firmware, not only by MAC
# (fogproject #198). A server that does not know the fields ignores them.
mbserial=$(dmidecode -s baseboard-serial-number)
mbserial=${mbserial,,}
mbserial=$(echo $mbserial | base64)
caseasset=$(dmidecode -s chassis-asset-tag)
caseasset=${caseasset,,}
caseasset=$(echo $caseasset | base64)
callServer "${web}service/man.hostexists.php" "sysuuid=${sysuuid}&sysserial=${sysserial}&mbserial=${mbserial}&caseasset=${caseasset}&mac=$mac"
exists="$serverBody"
checkAndSet() {
local testvar="$1"
Expand Down Expand Up @@ -382,7 +394,7 @@ res=""
# two seconds when the server was unreachable, so the operator watched a blank
# console with no idea anything was wrong.
while [[ -z $res ]]; do
callServer "${web}service/auto.register.php" "sysuuid=${sysuuid}&mac=$mac&advanced=$(echo -n 1 | base64)&host=$host&imageid=$imageid&primaryuser=$primaryuser&other1=$other1&other2=$other2&doimage=$realdoimage&doad=$blDoAD&location=$location64&ou=$ou64&username=$user64&password=$pass64&groupid=$group64&snapinid=$snapin64&productKey=$productKey"
callServer "${web}service/auto.register.php" "sysuuid=${sysuuid}&sysserial=${sysserial}&mbserial=${mbserial}&caseasset=${caseasset}&mac=$mac&advanced=$(echo -n 1 | base64)&host=$host&imageid=$imageid&primaryuser=$primaryuser&other1=$other1&other2=$other2&doimage=$realdoimage&doad=$blDoAD&location=$location64&ou=$ou64&username=$user64&password=$pass64&groupid=$group64&snapinid=$snapin64&productKey=$productKey"
res="$serverBody"
echo "${serverReason:-$res}"
usleep 2000000
Expand Down
Loading