2021-02-24 13:12:38 +08:00
|
|
|
#!/bin/bash
|
|
|
|
# ____ __ ____ ______ __
|
|
|
|
# / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ /
|
|
|
|
# / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| /
|
|
|
|
# / /_/ / /_/ / /__/ ,< / __/ / / /_/ /___/ / |
|
|
|
|
# /_____/\____/\___/_/|_|\___/_/ \____//____/_/|_| SERIALIZER
|
|
|
|
#
|
|
|
|
# Repo: https://github.com/sickcodes/Docker-OSX/
|
|
|
|
# Title: Mac on Docker (Docker-OSX)
|
|
|
|
# Author: Sick.Codes https://sick.codes/
|
|
|
|
# Version: 3.1
|
|
|
|
# License: GPLv3+
|
|
|
|
|
2021-03-07 01:21:14 +08:00
|
|
|
help_text="Usage: ./generate-unique-machine-values.sh
|
2021-02-24 13:12:38 +08:00
|
|
|
|
|
|
|
General options:
|
|
|
|
--count, -n, -c <count> Number of serials to generate
|
2021-02-24 17:46:18 +08:00
|
|
|
--model, -m <model> Device model, e.g. 'iMacPro1,1'
|
2021-03-07 01:21:14 +08:00
|
|
|
--csv <filename> Optionally change the CSV output filename
|
|
|
|
--tsv <filename> Optionally change the TSV output filename
|
|
|
|
--output-dir <directory> Optionally change the script output location
|
|
|
|
--width <string> Resolution x axis length in px, default 1920
|
|
|
|
--height <string> Resolution y axis length in px, default 1080
|
|
|
|
--master-plist-url <url> Specify an alternative master plist, via URL
|
|
|
|
--master-plist <filename> Optionally change the input plist
|
|
|
|
--custom-plist <filename> Same as --master-plist
|
|
|
|
--output-bootdisk <filename> Optionally change the bootdisk filename
|
|
|
|
--envs Create all corresponding sourcable envs
|
|
|
|
--plists Create all corresponding config.plists
|
|
|
|
--bootdisks Create all corresponding bootdisks [SLOW]
|
2021-02-24 13:12:38 +08:00
|
|
|
--help, -h, help Display this help and exit
|
2021-03-07 01:21:14 +08:00
|
|
|
|
|
|
|
Additional options only if you are creating only ONE serial set:
|
|
|
|
--output-bootdisk <filename> Optionally change the bootdisk filename
|
|
|
|
--output-env <filename> Optionally change the serials env filename
|
|
|
|
|
|
|
|
Custom plist placeholders:
|
|
|
|
{{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}},
|
|
|
|
{{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}}
|
2021-02-24 13:12:38 +08:00
|
|
|
|
2021-02-24 17:46:18 +08:00
|
|
|
Example:
|
2021-03-07 01:21:14 +08:00
|
|
|
./generate-unique-machine-values.sh --count 1 --plists --bootdisks --envs
|
|
|
|
|
|
|
|
Defaults:
|
|
|
|
- One serial, for 'iMacPro1,1', in the current working directory
|
|
|
|
- CSV and TSV output
|
|
|
|
- plists in ./plists/ & bootdisks in ./bootdisks/ & envs in ./envs
|
|
|
|
- if you set --bootdisk name, --bootdisks is assumed
|
|
|
|
- if you set --custom-plist, --plists is assumed
|
|
|
|
- if you set --output-env, --envs is assumed
|
2021-02-24 13:12:38 +08:00
|
|
|
|
|
|
|
Author: Sick.Codes https://sick.codes/
|
|
|
|
Project: https://github.com/sickcodes/Docker-OSX/
|
|
|
|
"
|
|
|
|
|
|
|
|
MACINFOPKG_VERSION=2.1.2
|
2021-03-07 01:21:14 +08:00
|
|
|
OPENCORE_IMAGE_MAKER_URL='https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/opencore-image-ng.sh'
|
2021-02-24 13:12:38 +08:00
|
|
|
|
|
|
|
# gather arguments
|
|
|
|
while (( "$#" )); do
|
|
|
|
case "${1}" in
|
|
|
|
|
|
|
|
--help | -h | h | help )
|
|
|
|
echo "${help_text}" && exit 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
--count=* | -c=* | -n=* )
|
|
|
|
export SERIAL_SET_COUNT="${1#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--count* | -c* | -n* )
|
|
|
|
export SERIAL_SET_COUNT="${2}"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
|
|
|
--csv=* )
|
|
|
|
export CSV_OUTPUT_FILENAME="${1#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--csv* )
|
|
|
|
export CSV_OUTPUT_FILENAME="${2}"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
2021-02-24 17:46:18 +08:00
|
|
|
--tsv=* )
|
|
|
|
export TSV_OUTPUT_FILENAME="${1#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--tsv* )
|
|
|
|
export TSV_OUTPUT_FILENAME="${2}"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
2021-02-24 13:12:38 +08:00
|
|
|
--output-dir=* )
|
|
|
|
export OUTPUT_DIRECTORY="${1#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--output-dir* )
|
|
|
|
export OUTPUT_DIRECTORY="${2}"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
2021-02-24 19:49:20 +08:00
|
|
|
--output-bootdisk=* )
|
2021-03-07 01:21:14 +08:00
|
|
|
export OUTPUT_BOOTDISK="${1#*=}"
|
2021-02-24 19:49:20 +08:00
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--output-bootdisk* )
|
|
|
|
export OUTPUT_QCOW="${2}"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
|
|
|
--output-env=* )
|
|
|
|
export OUTPUT_ENV="${1#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--output-env* )
|
|
|
|
export OUTPUT_ENV="${2}"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
2021-02-24 13:12:38 +08:00
|
|
|
--model=* | -m=* )
|
|
|
|
export DEVICE_MODEL="${1#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--model* | -m* )
|
|
|
|
export DEVICE_MODEL="${2}"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
2021-03-04 00:54:45 +08:00
|
|
|
--width=* )
|
|
|
|
export WIDTH="${1#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
|
|
|
--width* )
|
|
|
|
export WIDTH="${2}"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
|
|
|
--height=* )
|
|
|
|
export HEIGHT="${1#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--height* )
|
|
|
|
export HEIGHT="${2}"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
2021-03-04 17:48:04 +08:00
|
|
|
--master-plist-url=* )
|
|
|
|
export MASTER_PLIST_URL="${1#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
|
|
|
--master-plist-url* )
|
|
|
|
export MASTER_PLIST_URL="${2}"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
|
|
|
--master-plist=* )
|
|
|
|
export MASTER_PLIST="${1#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
|
|
|
--master-plist* )
|
|
|
|
export MASTER_PLIST="${2}"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
|
|
|
--custom-plist=* )
|
|
|
|
export MASTER_PLIST="${1#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
|
|
|
--custom-plist* )
|
|
|
|
export MASTER_PLIST="${2}"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
2021-02-24 13:52:17 +08:00
|
|
|
--plists )
|
|
|
|
export CREATE_PLISTS=1
|
|
|
|
shift
|
|
|
|
;;
|
2021-02-24 19:49:20 +08:00
|
|
|
--bootdisks )
|
2021-03-07 01:21:14 +08:00
|
|
|
export CREATE_BOOTDISKS=1
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--envs )
|
|
|
|
export CREATE_ENVS=1
|
2021-02-24 13:52:17 +08:00
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
2021-02-24 13:12:38 +08:00
|
|
|
*)
|
|
|
|
echo "Invalid option. Running with default values..."
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
build_mac_serial () {
|
2021-02-24 13:29:17 +08:00
|
|
|
export MACINFOPKG_VERSION="${MACINFOPKG_VERSION:=2.1.2}"
|
2021-02-24 13:12:38 +08:00
|
|
|
wget -O "${TARBALL:=./MacInfoPkg.tar.gz}" \
|
2021-02-24 13:29:17 +08:00
|
|
|
"https://github.com/acidanthera/MacInfoPkg/archive/${MACINFOPKG_VERSION}.tar.gz"
|
2021-02-24 13:12:38 +08:00
|
|
|
tar -xzvf "${TARBALL}"
|
|
|
|
cd "./MacInfoPkg-${MACINFOPKG_VERSION}/macserial" \
|
2021-02-24 13:29:17 +08:00
|
|
|
&& ./build.tool \
|
2021-02-24 13:12:38 +08:00
|
|
|
&& cd -
|
|
|
|
mv "./MacInfoPkg-${MACINFOPKG_VERSION}/macserial/bin/macserial" .
|
|
|
|
rm -f "${TARBALL}"
|
|
|
|
rm -rf "./MacInfoPkg-${MACINFOPKG_VERSION}/"
|
2021-02-24 13:29:17 +08:00
|
|
|
chmod +x ./macserial
|
2021-02-24 13:12:38 +08:00
|
|
|
stat ./macserial
|
|
|
|
}
|
|
|
|
|
|
|
|
download_vendor_mac_addresses () {
|
|
|
|
# download the MAC Address vendor list
|
|
|
|
[[ -e "${MAC_ADDRESSES_FILE:=vendor_macs.tsv}" ]] || wget -O "${MAC_ADDRESSES_FILE}" https://gitlab.com/wireshark/wireshark/-/raw/master/manuf
|
|
|
|
}
|
|
|
|
|
2021-02-24 13:52:17 +08:00
|
|
|
download_qcow_efi_folder () {
|
2021-02-24 17:46:18 +08:00
|
|
|
git clone --depth 1 https://github.com/kholia/OSX-KVM.git
|
2021-02-24 13:52:17 +08:00
|
|
|
cp -ra ./OSX-KVM/OpenCore-Catalina/EFI .
|
|
|
|
mkdir -p ./EFI/OC/Resources
|
|
|
|
# clone some Apple drivers
|
2021-02-24 17:46:18 +08:00
|
|
|
git clone --depth 1 https://github.com/acidanthera/OcBinaryData.git
|
2021-02-24 13:52:17 +08:00
|
|
|
# copy said drivers into EFI/OC/Resources
|
|
|
|
cp -a ./OcBinaryData/Resources/* ./EFI/OC/Resources
|
|
|
|
# EFI Shell commands
|
|
|
|
touch startup.nsh && echo 'fs0:\EFI\BOOT\BOOTx64.efi' > startup.nsh
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-02-24 13:12:38 +08:00
|
|
|
generate_serial_sets () {
|
2021-03-04 17:48:04 +08:00
|
|
|
|
|
|
|
|
2021-02-24 13:12:38 +08:00
|
|
|
|
2021-03-07 01:21:14 +08:00
|
|
|
if [[ "${CSV_OUTPUT_FILENAME}" ]]; then
|
2021-02-24 17:46:18 +08:00
|
|
|
[[ ${CSV_OUTPUT_FILENAME} ]] && export CSV_SERIAL_SETS_FILE="${CSV_OUTPUT_FILENAME}"
|
2021-03-07 01:21:14 +08:00
|
|
|
elif [[ "${TSV_OUTPUT_FILENAME}" ]]; then
|
2021-02-24 17:46:18 +08:00
|
|
|
[[ ${TSV_OUTPUT_FILENAME} ]] && export TSV_SERIAL_SETS_FILE="${TSV_OUTPUT_FILENAME}"
|
2021-03-07 01:21:14 +08:00
|
|
|
else
|
|
|
|
export CSV_SERIAL_SETS_FILE="${OUTPUT_DIRECTORY}/serial_sets-${DATE_NOW}.csv"
|
|
|
|
export TSV_SERIAL_SETS_FILE="${OUTPUT_DIRECTORY}/serial_sets-${DATE_NOW}.tsv"
|
2021-02-24 13:12:38 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
./macserial \
|
2021-03-07 01:21:14 +08:00
|
|
|
--num "${SERIAL_SET_COUNT}" \
|
2021-02-24 13:12:38 +08:00
|
|
|
--model "${DEVICE_MODEL}" \
|
2021-02-25 16:52:56 +08:00
|
|
|
| while IFS='\ \|\ ' read -r SERIAL BOARD_SERIAL; do
|
2021-02-24 13:12:38 +08:00
|
|
|
# make a uuid...
|
2021-02-25 16:52:56 +08:00
|
|
|
UUID="$(uuidgen)"
|
|
|
|
UUID="${UUID^^}"
|
2021-02-24 13:12:38 +08:00
|
|
|
|
|
|
|
# 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}")"
|
2021-02-25 16:52:56 +08:00
|
|
|
MAC_ADDRESS="$(printf "${RANDOM_MAC_PREFIX}:%02X:%02X:%02X" $[RANDOM%256] $[RANDOM%256] $[RANDOM%256])"
|
2021-02-24 13:12:38 +08:00
|
|
|
|
2021-03-07 01:21:14 +08:00
|
|
|
[[ -z "${WIDTH}" ]] && WIDTH=1920
|
|
|
|
[[ -z "${HEIGHT}" ]] && HEIGHT=1080
|
|
|
|
|
2021-02-24 17:46:18 +08:00
|
|
|
# append to csv file
|
2021-03-07 01:21:14 +08:00
|
|
|
cat <<EOF >> "${CSV_SERIAL_SETS_FILE}"
|
|
|
|
"${DEVICE_MODEL}","${SERIAL}","${BOARD_SERIAL}","${UUID}","${MAC_ADDRESS}","${WIDTH}","${HEIGHT}"
|
|
|
|
EOF
|
2021-02-24 17:46:18 +08:00
|
|
|
|
|
|
|
# append to tsv file
|
2021-03-07 01:21:14 +08:00
|
|
|
T=$'\t'
|
|
|
|
cat <<EOF >> "${TSV_SERIAL_SETS_FILE}"
|
|
|
|
${DEVICE_MODEL}${T}${SERIAL}${T}${BOARD_SERIAL}${T}${UUID}${T}${MAC_ADDRESS}${T}${WIDTH}${T}${HEIGHT}
|
|
|
|
EOF
|
2021-02-24 17:46:18 +08:00
|
|
|
|
2021-03-07 01:21:14 +08:00
|
|
|
# make envs if --envs, but also if you set the env filename it will switch on by itself
|
|
|
|
if [[ "${CREATE_ENVS}" ]] || [[ "${OUTPUT_ENV}" ]]; then
|
|
|
|
mkdir -p "${OUTPUT_DIRECTORY}/envs"
|
|
|
|
OUTPUT_ENV_FILE="${OUTPUT_ENV:-"${OUTPUT_DIRECTORY}/envs/${SERIAL}.env.sh"}"
|
|
|
|
touch "${OUTPUT_ENV_FILE}"
|
|
|
|
cat <<EOF > "${OUTPUT_ENV_FILE}"
|
2021-02-25 16:52:56 +08:00
|
|
|
export DEVICE_MODEL="${DEVICE_MODEL}"
|
|
|
|
export SERIAL="${SERIAL}"
|
|
|
|
export BOARD_SERIAL="${BOARD_SERIAL}"
|
|
|
|
export UUID="${UUID}"
|
|
|
|
export MAC_ADDRESS="${MAC_ADDRESS}"
|
2021-03-07 01:21:14 +08:00
|
|
|
export WIDTH="${WIDTH}"
|
|
|
|
export HEIGHT="${HEIGHT}"
|
2021-02-24 13:12:38 +08:00
|
|
|
EOF
|
2021-02-24 13:52:17 +08:00
|
|
|
|
2021-03-07 01:21:14 +08:00
|
|
|
fi
|
|
|
|
|
2021-02-24 19:49:20 +08:00
|
|
|
# plist required for bootdisks, so create anyway.
|
2021-03-07 01:21:14 +08:00
|
|
|
if [[ "${CREATE_PLISTS}" ]] || [[ "${CREATE_BOOTDISKS}" ]]; then
|
|
|
|
|
|
|
|
# need a config.plist
|
|
|
|
if [[ "${MASTER_PLIST}" ]]; then
|
|
|
|
[[ -e "${MASTER_PLIST}" ]] || echo "Could not find: ${MASTER_PLIST}"
|
|
|
|
elif [[ "${MASTER_PLIST}" ]] && [[ "${MASTER_PLIST_URL}" ]]; then
|
|
|
|
echo 'You specified both a custom plist FILE AND a custom plist URL. Only use one of those options.'
|
|
|
|
elif [[ "${MASTER_PLIST_URL}" ]]; then
|
|
|
|
wget -O "${MASTER_PLIST:=./config-custom.plist}" "${MASTER_PLIST_URL}" \
|
|
|
|
|| { echo "Could not download ${MASTER_PLIST_URL}" && exit 1 ; }
|
|
|
|
else
|
|
|
|
MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist'
|
|
|
|
wget -O "${MASTER_PLIST:=./config-nopicker-custom.plist}" "${MASTER_PLIST_URL}" \
|
|
|
|
|| { echo "Could not download ${MASTER_PLIST_URL}" && exit 1 ; }
|
|
|
|
fi
|
|
|
|
|
2021-02-24 13:52:17 +08:00
|
|
|
mkdir -p "${OUTPUT_DIRECTORY}/plists"
|
2021-02-24 19:49:20 +08:00
|
|
|
source "${OUTPUT_ENV_FILE}"
|
2021-02-25 16:52:56 +08:00
|
|
|
ROM_VALUE="${MAC_ADDRESS//\:/}"
|
2021-02-24 17:46:18 +08:00
|
|
|
ROM_VALUE="${ROM_VALUE,,}"
|
2021-02-25 16:52:56 +08:00
|
|
|
sed -e s/{{DEVICE_MODEL}}/"${DEVICE_MODEL}"/g \
|
|
|
|
-e s/{{SERIAL}}/"${SERIAL}"/g \
|
|
|
|
-e s/{{BOARD_SERIAL}}/"${BOARD_SERIAL}"/g \
|
|
|
|
-e s/{{UUID}}/"${UUID}"/g \
|
|
|
|
-e s/{{ROM}}/"${ROM}"/g \
|
2021-03-04 00:54:45 +08:00
|
|
|
-e s/{{WIDTH}}/"${WIDTH}"/g \
|
|
|
|
-e s/{{HEIGHT}}/"${HEIGHT}"/g \
|
2021-03-04 17:48:04 +08:00
|
|
|
"${MASTER_PLIST}" > "${OUTPUT_DIRECTORY}/plists/${SERIAL}.config.plist" || exit 1
|
2021-02-24 13:52:17 +08:00
|
|
|
fi
|
|
|
|
|
2021-03-07 01:21:14 +08:00
|
|
|
# make bootdisk qcow2 format if --bootdisks, but also if you set the bootdisk filename
|
|
|
|
if [[ "${CREATE_BOOTDISKS}" ]] || [[ "${OUTPUT_BOOTDISK}" ]]; then
|
|
|
|
[[ -e ./opencore-image-ng.sh ]] \
|
|
|
|
|| { wget "${OPENCORE_IMAGE_MAKER_URL}" \
|
|
|
|
&& chmod +x opencore-image-ng.sh ; }
|
|
|
|
mkdir -p "${OUTPUT_DIRECTORY}/bootdisks"
|
2021-02-24 13:52:17 +08:00
|
|
|
./opencore-image-ng.sh \
|
2021-02-25 16:52:56 +08:00
|
|
|
--cfg "${OUTPUT_DIRECTORY}/plists/${SERIAL}.config.plist" \
|
2021-03-07 01:21:14 +08:00
|
|
|
--img "${OUTPUT_BOOTDISK:-${OUTPUT_DIRECTORY}/bootdisks/${SERIAL}.OpenCore-nopicker.qcow2}" || exit 1
|
2021-02-24 13:52:17 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
2021-02-24 13:12:38 +08:00
|
|
|
|
2021-02-24 17:46:18 +08:00
|
|
|
[[ -e "${CSV_SERIAL_SETS_FILE}" ]] && \
|
2021-02-25 16:52:56 +08:00
|
|
|
cat <(echo "DEVICE_MODEL,SERIAL,BOARD_SERIAL,UUID,MAC_ADDRESS") "${CSV_SERIAL_SETS_FILE}"
|
2021-02-24 17:46:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
[[ -e "${TSV_SERIAL_SETS_FILE}" ]] && \
|
2021-02-26 14:42:57 +08:00
|
|
|
cat <(printf "DEVICE_MODEL\tSERIAL\tBOARD_SERIAL\tUUID\tMAC_ADDRESS\n") "${TSV_SERIAL_SETS_FILE}"
|
2021-03-07 01:21:14 +08:00
|
|
|
|
2021-02-24 13:12:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
main () {
|
|
|
|
# setting default variables if there are no options
|
2021-03-07 01:21:14 +08:00
|
|
|
export DATE_NOW="$(date +%F-%T)"
|
2021-02-24 13:29:17 +08:00
|
|
|
export DEVICE_MODEL="${DEVICE_MODEL:=iMacPro1,1}"
|
2021-03-07 01:21:14 +08:00
|
|
|
export VENDOR_REGEX="${VENDOR_REGEX:=Apple, Inc.}"
|
2021-02-24 13:29:17 +08:00
|
|
|
export SERIAL_SET_COUNT="${SERIAL_SET_COUNT:=1}"
|
|
|
|
export OUTPUT_DIRECTORY="${OUTPUT_DIRECTORY:=.}"
|
2021-02-24 13:12:38 +08:00
|
|
|
cat <<EOF
|
2021-02-24 13:29:17 +08:00
|
|
|
DEVICE_MODEL: ${DEVICE_MODEL}
|
|
|
|
SERIAL_SET_COUNT: ${SERIAL_SET_COUNT}
|
|
|
|
OUTPUT_DIRECTORY: ${OUTPUT_DIRECTORY}
|
2021-02-24 13:12:38 +08:00
|
|
|
EOF
|
|
|
|
[[ -d "${OUTPUT_DIRECTORY}" ]] || mkdir -p "${OUTPUT_DIRECTORY}"
|
|
|
|
[[ -e ./macserial ]] || build_mac_serial
|
|
|
|
download_vendor_mac_addresses
|
2021-02-24 13:52:17 +08:00
|
|
|
download_qcow_efi_folder
|
2021-02-24 13:12:38 +08:00
|
|
|
generate_serial_sets
|
|
|
|
echo "${SERIAL_SETS_FILE}"
|
|
|
|
}
|
|
|
|
|
|
|
|
main
|
|
|
|
|