feat: differentiate machine-id generation in x86 target

This commit is contained in:
2023-03-10 11:21:22 +01:00
parent 55b49679f1
commit 50025decc1
7 changed files with 38 additions and 15 deletions

View File

@ -12,13 +12,13 @@ main() {
# Accumulate data to create unique machine id
local mac_addresses=$(cat /sys/class/net/*/address | uniq | sort)
local device_uuid=$(dmidecode | grep UUID)
local device_model=$(cat /sys/firmware/devicetree/base/model)
# Ensure destination directory
mkdir -p "$(dirname "$machine_id_file")"
# Generate SHA256 hash of data and save it to $machine_id_file
echo "$mac_adresses $device_uuid" | sha256sum | cut -d ' ' -f1 > "$machine_id_file"
echo "$mac_adresses $device_model" | sha256sum | cut -d ' ' -f1 > "$machine_id_file"
}
main