diff --git a/README.md b/README.md index 35e76b3..d402029 100644 --- a/README.md +++ b/README.md @@ -251,6 +251,51 @@ CUSTOM_PLIST=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/ma --height 1080 ``` +## Thinkpad Errors in OpenCore + +If you have errors related to a think pad, try toggling `--thinkpad`. + +This will set `ForceOcWriteFlash` to `true`, as per https://dortania.github.io/docs/latest/Configuration.html + +## Rough example used in Docker-OSX in a Dockerfile + +```dockerfile + +ARG STOCK_DEVICE_MODEL=iMacPro1,1 +ARG STOCK_SERIAL=C02TM2ZBHX87 +ARG STOCK_BOARD_SERIAL=C02717306J9JG361M +ARG STOCK_UUID=007076A6-F2A2-4461-BBE5-BAD019F8025A +ARG STOCK_MAC_ADDRESS=00:0A:27:00:00:00 +ARG STOCK_WIDTH=1920 +ARG STOCK_HEIGHT=1080 +ARG STOCK_MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist +ARG STOCK_MASTER_PLIST_URL_NOPICKER=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-nopicker-custom.plist +ARG STOCK_BOOTDISK=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2 +ARG STOCK_BOOTDISK_NOPICKER=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2 + +RUN ./generate-specific-bootdisk.sh \ + --master-plist-url="${STOCK_MASTER_PLIST_URL}" \ + --model "${STOCK_DEVICE_MODEL}" \ + --serial "${STOCK_SERIAL}" \ + --board-serial "${STOCK_BOARD_SERIAL}" \ + --uuid "${STOCK_UUID}" \ + --mac-address "${STOCK_MAC_ADDRESS}" \ + --width "${STOCK_WIDTH}" \ + --height "${STOCK_HEIGHT}" \ + --output-bootdisk "${STOCK_BOOTDISK}" || exit 1 + +RUN ./generate-specific-bootdisk.sh \ + --master-plist-url="${STOCK_MASTER_PLIST_URL_NOPICKER}" \ + --model "${STOCK_DEVICE_MODEL}" \ + --serial "${STOCK_SERIAL}" \ + --board-serial "${STOCK_BOARD_SERIAL}" \ + --uuid "${STOCK_UUID}" \ + --mac-address "${STOCK_MAC_ADDRESS}" \ + --width "${STOCK_WIDTH}" \ + --height "${STOCK_HEIGHT}" \ + --output-bootdisk "${STOCK_BOOTDISK_NOPICKER}" || exit 1 +``` + # Examples from Docker-OSX diff --git a/config-custom.plist b/config-custom.plist index e1f669a..7c15f75 100644 --- a/config-custom.plist +++ b/config-custom.plist @@ -1378,7 +1378,7 @@ ExitBootServicesDelay 0 ForceOcWriteFlash - + <{{THINKPAD}}/> ForgeUefiSupport IgnoreInvalidFlexRatio diff --git a/config-nopicker-custom.plist b/config-nopicker-custom.plist index 98c592e..7310c06 100644 --- a/config-nopicker-custom.plist +++ b/config-nopicker-custom.plist @@ -1378,7 +1378,7 @@ ExitBootServicesDelay 0 ForceOcWriteFlash - + <{{THINKPAD}}/> ForgeUefiSupport IgnoreInvalidFlexRatio diff --git a/generate-specific-bootdisk.sh b/generate-specific-bootdisk.sh index d84cee5..5095399 100755 --- a/generate-specific-bootdisk.sh +++ b/generate-specific-bootdisk.sh @@ -30,10 +30,11 @@ Optional options: --master-plist Same as above. --output-bootdisk Optionally change the bootdisk filename --output-plist Optionally change the output plist filename + --thinkpad Sets ForceOcWriteFlash to true --help, -h, help Display this help and exit Placeholders: {{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}}, {{UUID}}, - {{ROM}}, {{WIDTH}}, {{HEIGHT}} + {{ROM}}, {{WIDTH}}, {{HEIGHT}}, {{THINKPAD}} Example: ./generate-specific-bootdisk.sh \\ @@ -183,6 +184,12 @@ while (( "$#" )); do shift ;; + + --thinkpad ) + export THINKPAD=true + shift + ;; + *) echo "Invalid option ${1}. Running with default values..." shift @@ -233,6 +240,13 @@ generate_bootdisk () { wget -O "${MASTER_PLIST:=./config-nopicker-custom.plist}" "${MASTER_PLIST_URL}" fi + if [[ "${THINKPAD}" == true ]]; then + echo "Thinkpads: setting ForceOcWriteFlash to true" + export THINKPAD=true + else + export THINKPAD=false + fi + [ -e ./opencore-image-ng.sh ] \ || { wget "${OPENCORE_IMAGE_MAKER_URL}" \ && chmod +x opencore-image-ng.sh ; } @@ -252,6 +266,7 @@ generate_bootdisk () { -e s/\{\{ROM\}\}/"${ROM}"/g \ -e s/\{\{WIDTH\}\}/"${WIDTH:-1920}"/g \ -e s/\{\{HEIGHT\}\}/"${HEIGHT:-1080}"/g \ + -e s/\{\{THINKPAD\}\}/"${THINKPAD:-false}"/g \ "${MASTER_PLIST}" > ./tmp.config.plist || exit 1 else cat < "${OUTPUT_DIRECTORY}/plists/${SERIAL}.config.plist" || exit 1 fi