From 613236ffc9711a708208a8dcdacf22d9350c9909 Mon Sep 17 00:00:00 2001 From: sickcodes Date: Thu, 15 Apr 2021 09:55:15 +0000 Subject: [PATCH] Update custom from https://github.com/sickcodes/osx-serial-generator.git --- custom/generate-specific-bootdisk.sh | 2 +- custom/generate-unique-machine-values.sh | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/custom/generate-specific-bootdisk.sh b/custom/generate-specific-bootdisk.sh index 89ecad7..386c13b 100755 --- a/custom/generate-specific-bootdisk.sh +++ b/custom/generate-specific-bootdisk.sh @@ -210,7 +210,7 @@ download_qcow_efi_folder () { # EFI Shell commands touch startup.nsh && echo 'fs0:\EFI\BOOT\BOOTx64.efi' > startup.nsh - cp -ra "${EFI_FOLDER}" . + cp -a "${EFI_FOLDER}" . mkdir -p ./EFI/OC/Resources diff --git a/custom/generate-unique-machine-values.sh b/custom/generate-unique-machine-values.sh index ad5bd1f..1cdd707 100755 --- a/custom/generate-unique-machine-values.sh +++ b/custom/generate-unique-machine-values.sh @@ -243,7 +243,7 @@ download_qcow_efi_folder () { # EFI Shell commands touch startup.nsh && echo 'fs0:\EFI\BOOT\BOOTx64.efi' > startup.nsh - cp -ra "${EFI_FOLDER}" . + cp -a "${EFI_FOLDER}" . mkdir -p ./EFI/OC/Resources @@ -275,28 +275,30 @@ generate_serial_sets () { | while IFS='\ \|\ ' read -r SERIAL BOARD_SERIAL; do # make a uuid... UUID="$(uuidgen)" - UUID="${UUID^^}" + # bash 3-5 compatible + # UUID="${UUID^^}" + UUID="$(tr '[:lower:]' '[:upper:]' <<< "${UUID}")" # get a random vendor specific MAC address. RANDOM_MAC_PREFIX="$(grep -e "${VENDOR_REGEX}" < "${MAC_ADDRESSES_FILE:=vendor_macs.tsv}" | sort --random-sort | head -n1)" RANDOM_MAC_PREFIX="$(cut -d$'\t' -f1 <<< "${RANDOM_MAC_PREFIX}")" - MAC_ADDRESS="$(printf "${RANDOM_MAC_PREFIX}:%02X:%02X:%02X" $[RANDOM%256] $[RANDOM%256] $[RANDOM%256])" + MAC_ADDRESS="$(printf "${RANDOM_MAC_PREFIX}:%02X:%02X:%02X" "$((RANDOM%256))" "$((RANDOM%256))" "$((RANDOM%256))")" [ -z "${WIDTH}" ] && WIDTH=1920 [ -z "${HEIGHT}" ] && HEIGHT=1080 # append to csv file - cat <> "${CSV_SERIAL_SETS_FILE}" + tee -a "${CSV_SERIAL_SETS_FILE}" <> "${TSV_SERIAL_SETS_FILE}" + tee -a "${TSV_SERIAL_SETS_FILE}" <