Update legacy folder ./custom so README works

This commit is contained in:
sickcodes 2021-11-29 19:09:41 +00:00
parent 7300479b9a
commit 030258ef67
4 changed files with 686 additions and 141 deletions

File diff suppressed because it is too large Load Diff

View File

@ -30,10 +30,11 @@ Optional options:
--master-plist <filename> Same as above. --master-plist <filename> Same as above.
--output-bootdisk <filename> Optionally change the bootdisk filename --output-bootdisk <filename> Optionally change the bootdisk filename
--output-plist <filename> Optionally change the output plist filename --output-plist <filename> Optionally change the output plist filename
--thinkpad Sets ForceOcWriteFlash to true
--help, -h, help Display this help and exit --help, -h, help Display this help and exit
Placeholders: {{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}}, {{UUID}}, Placeholders: {{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}}, {{UUID}},
{{ROM}}, {{WIDTH}}, {{HEIGHT}} {{ROM}}, {{WIDTH}}, {{HEIGHT}}, {{THINKPAD}}
Example: Example:
./generate-specific-bootdisk.sh \\ ./generate-specific-bootdisk.sh \\
@ -183,6 +184,12 @@ while (( "$#" )); do
shift shift
;; ;;
--thinkpad )
export THINKPAD=true
shift
;;
*) *)
echo "Invalid option ${1}. Running with default values..." echo "Invalid option ${1}. Running with default values..."
shift shift
@ -193,12 +200,12 @@ done
download_qcow_efi_folder () { download_qcow_efi_folder () {
export EFI_FOLDER=./OpenCore-Catalina/EFI export EFI_FOLDER=./OpenCore/EFI
export RESOURCES_FOLDER=./resources/OcBinaryData/Resources export RESOURCES_FOLDER=./resources/OcBinaryData/Resources
# check if we are inside OSX-KVM already # check if we are inside OSX-KVM already
# if not, download OSX-KVM locally # if not, download OSX-KVM locally
[ -d ./OpenCore-Catalina/EFI/ ] || { [ -d ./OpenCore/EFI/ ] || {
[ -d ./OSX-KVM/ ] || git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git [ -d ./OSX-KVM/ ] || git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git
export EFI_FOLDER="./OSX-KVM/${EFI_FOLDER}" export EFI_FOLDER="./OSX-KVM/${EFI_FOLDER}"
} }
@ -233,6 +240,13 @@ generate_bootdisk () {
wget -O "${MASTER_PLIST:=./config-nopicker-custom.plist}" "${MASTER_PLIST_URL}" wget -O "${MASTER_PLIST:=./config-nopicker-custom.plist}" "${MASTER_PLIST_URL}"
fi fi
if [[ "${THINKPAD}" == true ]]; then
echo "Thinkpads: setting ForceOcWriteFlash to true"
export THINKPAD=true
else
export THINKPAD=false
fi
[ -e ./opencore-image-ng.sh ] \ [ -e ./opencore-image-ng.sh ] \
|| { wget "${OPENCORE_IMAGE_MAKER_URL}" \ || { wget "${OPENCORE_IMAGE_MAKER_URL}" \
&& chmod +x opencore-image-ng.sh ; } && chmod +x opencore-image-ng.sh ; }
@ -252,6 +266,7 @@ generate_bootdisk () {
-e s/\{\{ROM\}\}/"${ROM}"/g \ -e s/\{\{ROM\}\}/"${ROM}"/g \
-e s/\{\{WIDTH\}\}/"${WIDTH:-1920}"/g \ -e s/\{\{WIDTH\}\}/"${WIDTH:-1920}"/g \
-e s/\{\{HEIGHT\}\}/"${HEIGHT:-1080}"/g \ -e s/\{\{HEIGHT\}\}/"${HEIGHT:-1080}"/g \
-e s/\{\{THINKPAD\}\}/"${THINKPAD:-false}"/g \
"${MASTER_PLIST}" > ./tmp.config.plist || exit 1 "${MASTER_PLIST}" > ./tmp.config.plist || exit 1
else else
cat <<EOF && exit 1 cat <<EOF && exit 1

View File

@ -30,6 +30,7 @@ General options:
--create-envs, --envs Create all corresponding sourcable envs --create-envs, --envs Create all corresponding sourcable envs
--create-plists, --plists Create all corresponding config.plists --create-plists, --plists Create all corresponding config.plists
--create-bootdisks, --bootdisks Create all corresponding bootdisks [SLOW] --create-bootdisks, --bootdisks Create all corresponding bootdisks [SLOW]
--thinkpad Toggles ForceOcWriteFlash to true
--help, -h, help Display this help and exit --help, -h, help Display this help and exit
Additional options only if you are creating ONE serial set: Additional options only if you are creating ONE serial set:
@ -38,7 +39,7 @@ Additional options only if you are creating ONE serial set:
Custom plist placeholders: Custom plist placeholders:
{{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}}, {{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}},
{{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}} {{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}}, {{THINKPAD}}
Example: Example:
./generate-unique-machine-values.sh --count 1 --plists --bootdisks --envs ./generate-unique-machine-values.sh --count 1 --plists --bootdisks --envs
@ -202,9 +203,14 @@ while (( "$#" )); do
export CREATE_ENVS=1 export CREATE_ENVS=1
shift shift
;; ;;
--thinkpad )
export THINKPAD=true
shift
;;
*) *)
echo "Invalid option. Running with default values..." echo "Invalid option ${1}. Running with default values..."
shift shift
;; ;;
esac esac
@ -226,12 +232,12 @@ download_vendor_mac_addresses () {
download_qcow_efi_folder () { download_qcow_efi_folder () {
export EFI_FOLDER=./OpenCore-Catalina/EFI export EFI_FOLDER=./OpenCore/EFI
export RESOURCES_FOLDER=./resources/OcBinaryData/Resources export RESOURCES_FOLDER=./resources/OcBinaryData/Resources
# check if we are inside OSX-KVM already # check if we are inside OSX-KVM already
# if not, download OSX-KVM locally # if not, download OSX-KVM locally
[ -d ./OpenCore-Catalina/EFI/ ] || { [ -d ./OpenCore/EFI/ ] || {
[ -d ./OSX-KVM/ ] || git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git [ -d ./OSX-KVM/ ] || git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git
export EFI_FOLDER="./OSX-KVM/${EFI_FOLDER}" export EFI_FOLDER="./OSX-KVM/${EFI_FOLDER}"
} }
@ -313,6 +319,7 @@ export UUID="${UUID}"
export MAC_ADDRESS="${MAC_ADDRESS}" export MAC_ADDRESS="${MAC_ADDRESS}"
export WIDTH="${WIDTH}" export WIDTH="${WIDTH}"
export HEIGHT="${HEIGHT}" export HEIGHT="${HEIGHT}"
export THINKPAD="${THINKPAD}"
EOF EOF
fi fi
@ -333,10 +340,17 @@ EOF
wget -O "${MASTER_PLIST:=./config-nopicker-custom.plist}" "${MASTER_PLIST_URL}" wget -O "${MASTER_PLIST:=./config-nopicker-custom.plist}" "${MASTER_PLIST_URL}"
fi fi
if [[ "${THINKPAD}" == true ]]; then
echo "Thinkpads: setting ForceOcWriteFlash to true"
export THINKPAD=true
else
export THINKPAD=false
fi
mkdir -p "${OUTPUT_DIRECTORY}/plists" mkdir -p "${OUTPUT_DIRECTORY}/plists"
source "${OUTPUT_ENV_FILE}" source "${OUTPUT_ENV_FILE}"
ROM_VALUE="${MAC_ADDRESS//\:/}" ROM="${MAC_ADDRESS//\:/}"
ROM_VALUE="${ROM_VALUE,,}" ROM="${ROM,,}"
sed -e s/\{\{DEVICE_MODEL\}\}/"${DEVICE_MODEL}"/g \ sed -e s/\{\{DEVICE_MODEL\}\}/"${DEVICE_MODEL}"/g \
-e s/\{\{SERIAL\}\}/"${SERIAL}"/g \ -e s/\{\{SERIAL\}\}/"${SERIAL}"/g \
-e s/\{\{BOARD_SERIAL\}\}/"${BOARD_SERIAL}"/g \ -e s/\{\{BOARD_SERIAL\}\}/"${BOARD_SERIAL}"/g \
@ -344,6 +358,7 @@ EOF
-e s/\{\{ROM\}\}/"${ROM}"/g \ -e s/\{\{ROM\}\}/"${ROM}"/g \
-e s/\{\{WIDTH\}\}/"${WIDTH}"/g \ -e s/\{\{WIDTH\}\}/"${WIDTH}"/g \
-e s/\{\{HEIGHT\}\}/"${HEIGHT}"/g \ -e s/\{\{HEIGHT\}\}/"${HEIGHT}"/g \
-e s/\{\{THINKPAD\}\}/"${THINKPAD}"/g \
"${MASTER_PLIST}" > "${OUTPUT_DIRECTORY}/plists/${SERIAL}.config.plist" || exit 1 "${MASTER_PLIST}" > "${OUTPUT_DIRECTORY}/plists/${SERIAL}.config.plist" || exit 1
fi fi

View File

@ -133,26 +133,26 @@ fish part-add /dev/sda p 302048 -2048
fish part-set-gpt-type /dev/sda 1 C12A7328-F81F-11D2-BA4B-00A0C93EC93B fish part-set-gpt-type /dev/sda 1 C12A7328-F81F-11D2-BA4B-00A0C93EC93B
fish part-set-bootable /dev/sda 1 true fish part-set-bootable /dev/sda 1 true
fish mkfs vfat /dev/sda1 label:EFI fish mkfs vfat /dev/sda1 label:EFI
fish mkfs vfat /dev/sda2 label:OpenCoreBoo fish mkfs vfat /dev/sda2 label:OpenCore
fish mount /dev/sda2 / fish mount /dev/sda2 /
fish mkdir /ESP fish mkdir /ESP
fish mount /dev/sda1 /ESP fish mount /dev/sda1 /ESP
msg "copy files to disk image" msg "copy files to disk image"
cp -v "$cfg" $WORK/config.plist cp -v "$cfg" $WORK/config.plist
fish mkdir /ESP/EFI fish mkdir /ESP/EFI
fish mkdir /ESP/EFI/OC fish mkdir /ESP/EFI/OC
fish mkdir /ESP/EFI/OC/Kexts fish mkdir /ESP/EFI/OC/Kexts
fish mkdir /ESP/EFI/OC/ACPI fish mkdir /ESP/EFI/OC/ACPI
fish mkdir /ESP/EFI/OC/Resources fish mkdir /ESP/EFI/OC/Resources
fish mkdir /ESP/EFI/OC/Tools fish mkdir /ESP/EFI/OC/Tools
fish copy-in $WORK/EFI/BOOT /ESP/EFI fish copy-in $WORK/EFI/BOOT /ESP/EFI
fish copy-in $WORK/EFI/OC/OpenCore.efi /ESP/EFI/OC fish copy-in $WORK/EFI/OC/OpenCore.efi /ESP/EFI/OC
fish copy-in $WORK/EFI/OC/Drivers /ESP/EFI/OC/ fish copy-in $WORK/EFI/OC/Drivers /ESP/EFI/OC/
fish copy-in $WORK/EFI/OC/Kexts /ESP/EFI/OC/ fish copy-in $WORK/EFI/OC/Kexts /ESP/EFI/OC/
fish copy-in $WORK/EFI/OC/ACPI /ESP/EFI/OC/ fish copy-in $WORK/EFI/OC/ACPI /ESP/EFI/OC/
fish copy-in $WORK/EFI/OC/Resources /ESP/EFI/OC/ fish copy-in $BASE/resources/OcBinaryData/Resources /ESP/EFI/OC/
fish copy-in $WORK/EFI/OC/Tools /ESP/EFI/OC/ fish copy-in $WORK/EFI/OC/Tools /ESP/EFI/OC/
# Note # Note
fish copy-in startup.nsh / fish copy-in startup.nsh /