diff options
| author | sickcodes <[email protected]> | 2021-03-04 13:46:58 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-04 13:46:58 +0000 |
| commit | 3add4f7a98627a998ec0eb7c5fafaad7adbd2ae3 (patch) | |
| tree | 514d20ef243ac55228cd4dac3e7fd0daa02f8fa3 /custom | |
| parent | Merge pull request #162 from sickcodes/additional-ports (diff) | |
| parent | Typo (diff) | |
| download | docker-osx-3add4f7a98627a998ec0eb7c5fafaad7adbd2ae3.tar.xz docker-osx-3add4f7a98627a998ec0eb7c5fafaad7adbd2ae3.zip | |
Merge pull request #163 from sickcodes/resolution-changes-runtime
Add WIDTH and HEIGHT environment variables
Diffstat (limited to 'custom')
| -rw-r--r-- | custom/config-nopicker-custom.plist | 2 | ||||
| -rwxr-xr-x | custom/generate-specific-bootdisk.sh | 94 | ||||
| -rwxr-xr-x | custom/generate-unique-machine-values.sh | 85 |
3 files changed, 165 insertions, 16 deletions
diff --git a/custom/config-nopicker-custom.plist b/custom/config-nopicker-custom.plist index 6166234..aa60a39 100644 --- a/custom/config-nopicker-custom.plist +++ b/custom/config-nopicker-custom.plist @@ -816,7 +816,7 @@ <key>ReplaceTabWithSpace</key> <false/> <key>Resolution</key> - <string>1920x1080@32</string> + <string>{{WIDTH}}x{{HEIGHT}}@32</string> <key>SanitiseClearScreen</key> <false/> <key>TextRenderer</key> diff --git a/custom/generate-specific-bootdisk.sh b/custom/generate-specific-bootdisk.sh index 76aff0c..b847a50 100755 --- a/custom/generate-specific-bootdisk.sh +++ b/custom/generate-specific-bootdisk.sh @@ -15,12 +15,19 @@ help_text="Usage: generate-specific-bootdisk.sh General options: --model <string> Device model, e.g. 'iMacPro1,1' - --serial <filename> Device Serial number. - --board-serial <filename> Board Serial number. - --uuid <filename> SmUUID. - --mac-address <string> Used to set the ROM value; lowercased and without a colon. - --output-bootdisk <filename> Optionally change the bootdisk output filename. - --custom-plist <filename> Optionally change the input plist. + --serial <filename> Device Serial number + --board-serial <filename> Board Serial number + --uuid <filename> SmUUID + --mac-address <string> Used to set the ROM value; lowercased and without a colon + --width <string> Resolution x axis length in pixels (default 1920) + --height <string> Resolution y axis length in pixels (default 1080 + --output-bootdisk <filename> Optionally change the bootdisk output filename + + --master-plist-url <url> Specify an alternative master plist, via URL. + --custom-plist | --master-plist <filename> + Optionally change the input plist. Placeholders: + {{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}}, + {{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}} --help, -h, help Display this help and exit @@ -31,7 +38,9 @@ Example: --board-serial C027251024NJG36UE \ --uuid 5CCB366D-9118-4C61-A00A-E5BAF3BED451 \ --mac-address A8:5C:2C:9A:46:2F \ - --output-bootdisk OpenCore-nopicker.qcow2 + --output-bootdisk OpenCore-nopicker.qcow2 \ + --widht 1920 \ + --height 1080 Author: Sick.Codes https://sick.codes/ Project: https://github.com/sickcodes/Docker-OSX/ @@ -97,6 +106,26 @@ while (( "$#" )); do shift ;; + --width=* ) + export WIDTH="${1#*=}" + shift + ;; + --width* ) + export WIDTH="${2}" + shift + shift + ;; + + --height=* ) + export HEIGHT="${1#*=}" + shift + ;; + --height* ) + export HEIGHT="${2}" + shift + shift + ;; + --output-bootdisk=* ) export OUTPUT_QCOW="${1#*=}" shift @@ -107,12 +136,33 @@ while (( "$#" )); do shift ;; + --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 INPUT_PLIST="${1#*=}" + export MASTER_PLIST="${1#*=}" shift ;; --custom-plist* ) - export INPUT_PLIST="${2}" + export MASTER_PLIST="${2}" shift shift ;; @@ -138,8 +188,23 @@ download_qcow_efi_folder () { } generate_bootdisk () { - [[ -e ./config-nopicker-custom.plist ]] || wget https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.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. Use one or the other.' + 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 + + [[ -e ./opencore-image-ng.sh ]] || wget https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/opencore-image-ng.sh && chmod +x opencore-image-ng.sh + # plist required for bootdisks, so create anyway. if [[ "${DEVICE_MODEL}" ]] \ && [[ "${SERIAL}" ]] \ @@ -153,7 +218,9 @@ generate_bootdisk () { -e s/{{BOARD_SERIAL}}/"${BOARD_SERIAL}"/g \ -e s/{{UUID}}/"${UUID}"/g \ -e s/{{ROM}}/"${ROM}"/g \ - "${PLIST_MASTER}" > ./tmp.config.plist || exit 1 + -e s/{{WIDTH}}/"${WIDTH:-1920}"/g \ + -e s/{{HEIGHT}}/"${HEIGHT:-1080}"/g \ + "${MASTER_PLIST}" > ./tmp.config.plist || exit 1 else cat <<EOF Error: one of the following values is missing: @@ -164,12 +231,15 @@ Error: one of the following values is missing: --uuid "${UUID:-MISSING}" --mac-address "${MAC_ADDRESS:-MISSING}" +--width "${WIDTH:-1920}" +--height "${HEIGHT:-1080}" + EOF exit 1 fi ./opencore-image-ng.sh \ - --cfg "${INPUT_PLIST:-./tmp.config.plist}" \ + --cfg "./tmp.config.plist" \ --img "${OUTPUT_QCOW:-./${SERIAL}.OpenCore-nopicker.qcow2}" || exit 1 rm ./tmp.config.plist diff --git a/custom/generate-unique-machine-values.sh b/custom/generate-unique-machine-values.sh index 2248005..6ab15b8 100755 --- a/custom/generate-unique-machine-values.sh +++ b/custom/generate-unique-machine-values.sh @@ -21,6 +21,14 @@ General options: --output-bootdisk <filename> Optionally change the bootdisk qcow output filename. Useless when count > 1. --output-env <filename> Optionally change the bootdisk env filename. Useless when count > 1. --output-dir <directory> Optionally change the script output location. + --width <string> Resolution x axis length in pixels (default 1920) + --height <string> Resolution y axis length in pixels (default 1080 + + --master-plist-url <url> Specify an alternative master plist, via URL. + --master-plist | --custom-plist <filename> + Optionally change the input plist. Placeholders: + {{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}}, + {{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}} --help, -h, help Display this help and exit --plists Create corresponding config.plists for each serial set. @@ -52,7 +60,6 @@ Project: https://github.com/sickcodes/Docker-OSX/ " MACINFOPKG_VERSION=2.1.2 -PLIST_MASTER=config-nopicker-custom.plist # gather arguments while (( "$#" )); do @@ -132,6 +139,60 @@ while (( "$#" )); do shift ;; + --width=* ) + export WIDTH="${1#*=}" + shift + ;; + + --width* ) + export WIDTH="${2}" + shift + shift + ;; + + --height=* ) + export HEIGHT="${1#*=}" + shift + ;; + --height* ) + export HEIGHT="${2}" + shift + shift + ;; + + --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 + ;; + --plists ) export CREATE_PLISTS=1 shift @@ -183,8 +244,22 @@ download_qcow_efi_folder () { generate_serial_sets () { - [[ -e ./config-nopicker-custom.plist ]] || wget https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.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. Use one or the other.' + 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 + [[ -e ./opencore-image-ng.sh ]] || wget https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/opencore-image-ng.sh && chmod +x opencore-image-ng.sh + mkdir -p "${OUTPUT_DIRECTORY}/envs" export DATE_NOW="$(date +%F-%T)" export DEVICE_MODEL="${DEVICE_MODEL:=iMacPro1,1}" @@ -231,6 +306,8 @@ export SERIAL="${SERIAL}" export BOARD_SERIAL="${BOARD_SERIAL}" export UUID="${UUID}" export MAC_ADDRESS="${MAC_ADDRESS}" +export WIDTH="${WIDTH:=1920}" +export HEIGHT="${HEIGHT:=1080}" EOF # plist required for bootdisks, so create anyway. @@ -244,7 +321,9 @@ EOF -e s/{{BOARD_SERIAL}}/"${BOARD_SERIAL}"/g \ -e s/{{UUID}}/"${UUID}"/g \ -e s/{{ROM}}/"${ROM}"/g \ - "${PLIST_MASTER}" > "${OUTPUT_DIRECTORY}/plists/${SERIAL}.config.plist" || exit 1 + -e s/{{WIDTH}}/"${WIDTH}"/g \ + -e s/{{HEIGHT}}/"${HEIGHT}"/g \ + "${MASTER_PLIST}" > "${OUTPUT_DIRECTORY}/plists/${SERIAL}.config.plist" || exit 1 fi if [[ "${CREATE_QCOWS}" ]]; then |