Add --kernel-args option

This commit is contained in:
sickcodes 2021-12-19 18:50:54 +00:00
parent 07d95a9d55
commit a9e2b126db
6 changed files with 28 additions and 14 deletions

View file

@ -159,13 +159,17 @@ Or you can manually enter the values generated above:
...
...
...
<key>Resolution</key>
<string>{{WIDTH}}x{{HEIGHT}}@32</string>
<key>SanitiseClearScreen</key>
...
...
...
<key>boot-args</key>
<string>-v keepsyms=1 tlbto_us=0 vti=9 {{KERNEL_ARGS}}</string>
```
```
{{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}},
{{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}}
{{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}}, {{KERNEL_ARGS}}
```
```bash
@ -177,6 +181,7 @@ General options:
--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
--kernel-args <string> Additional boot-args
--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
@ -192,7 +197,7 @@ Additional options only if you are creating ONE serial set:
Custom plist placeholders:
{{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}},
{{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}}
{{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}}, {{KERNEL_ARGS}}
Example:
./generate-unique-machine-values.sh --count 1 --plists --bootdisks --envs
@ -223,6 +228,7 @@ Required options:
Optional options:
--width <integer> Resolution x axis length in px, default 1920
--height <integer> Resolution y axis length in px, default 1080
--kernel-args <string> Additional boot-args
--master-plist-url <url> Specify an alternative master plist, via URL
--custom-plist <filename>
|| --master-plist <filename> Optionally change the input plist.
@ -231,7 +237,7 @@ Optional options:
--help, -h, help Display this help and exit
Placeholders: {{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}}, {{UUID}},
{{ROM}}, {{WIDTH}}, {{HEIGHT}}
{{ROM}}, {{WIDTH}}, {{HEIGHT}}, {{KERNEL_ARGS}}
```
Example using your serials generated earlier:
@ -248,7 +254,8 @@ CUSTOM_PLIST=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/ma
--mac-address A8:5C:2C:9A:46:2F \
--output-bootdisk ./OpenCore-nopicker.qcow2 \
--width 1920 \
--height 1080
--height 1080 \
--kernel-args "-pmap_trace"
```

View file

@ -957,7 +957,7 @@
<key>SystemAudioVolume</key>
<data>Rg==</data>
<key>boot-args</key>
<string>-v keepsyms=1 tlbto_us=0 vti=9</string>
<string>-v keepsyms=1 tlbto_us=0 vti=9 {{KERNEL_ARGS}}</string>
<key>run-efi-updater</key>
<string>No</string>
<key>csr-active-config</key>

View file

@ -957,7 +957,7 @@
<key>SystemAudioVolume</key>
<data>Rg==</data>
<key>boot-args</key>
<string>-v keepsyms=1 tlbto_us=0 vti=9</string>
<string>-v keepsyms=1 tlbto_us=0 vti=9 {{KERNEL_ARGS}}</string>
<key>run-efi-updater</key>
<string>No</string>
<key>csr-active-config</key>

View file

@ -633,7 +633,7 @@
<key>SystemAudioVolume</key>
<data>Rg==</data>
<key>boot-args</key>
<string>-v keepsyms=1 tlbto_us=0 vti=9</string>
<string>-v keepsyms=1 tlbto_us=0 vti=9 {{KERNEL_ARGS}}</string>
<key>run-efi-updater</key>
<string>No</string>
<key>csr-active-config</key>

View file

@ -24,6 +24,7 @@ Required options:
Optional options:
--width <integer> Resolution x axis length in px, default 1920
--height <integer> Resolution y axis length in px, default 1080
--kernel-args <string> Additional boot-args
--input-plist-url <url> Specify an alternative master plist, via URL
--master-plist-url <url> Same as above.
--custom-plist <filename> Optionally change the input plist.
@ -252,6 +253,7 @@ generate_bootdisk () {
-e s/\{\{ROM\}\}/"${ROM}"/g \
-e s/\{\{WIDTH\}\}/"${WIDTH:-1920}"/g \
-e s/\{\{HEIGHT\}\}/"${HEIGHT:-1080}"/g \
-e s/\{\{KERNEL_ARGS\}\}/"${KERNEL_ARGS:-}"/g \
"${MASTER_PLIST}" > ./tmp.config.plist || exit 1
else
cat <<EOF && exit 1
@ -263,8 +265,11 @@ Error: one of the following values is missing:
--uuid "${UUID:-MISSING}"
--mac-address "${MAC_ADDRESS:-MISSING}"
Optional:
--width "${WIDTH:-1920}"
--height "${HEIGHT:-1080}"
--kernel-args "${KERNEL_ARGS:-}"
EOF
fi

View file

@ -22,6 +22,7 @@ General options:
--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
--kernel-args <string> Additional boot-args
--input-plist-url <url> Specify an alternative master plist, via URL
--master-plist-url <url> Same as above.
--custom-plist <filename> Optionally change the input plist.
@ -38,7 +39,7 @@ Additional options only if you are creating ONE serial set:
Custom plist placeholders:
{{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}},
{{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}}
{{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}}, {{KERNEL_ARGS}}
Example:
./generate-unique-machine-values.sh --count 1 --plists --bootdisks --envs
@ -289,14 +290,14 @@ generate_serial_sets () {
# append to csv file
tee -a "${CSV_SERIAL_SETS_FILE}" <<EOF
"${DEVICE_MODEL}","${SERIAL}","${BOARD_SERIAL}","${UUID}","${MAC_ADDRESS}","${WIDTH}","${HEIGHT}"
"${DEVICE_MODEL}","${SERIAL}","${BOARD_SERIAL}","${UUID}","${MAC_ADDRESS}","${WIDTH}","${HEIGHT}","${KERNEL_ARGS}"
EOF
echo "Wrote CSV to: ${CSV_SERIAL_SETS_FILE}"
# append to tsv file
T=$'\t'
tee -a "${TSV_SERIAL_SETS_FILE}" <<EOF
${DEVICE_MODEL}${T}${SERIAL}${T}${BOARD_SERIAL}${T}${UUID}${T}${MAC_ADDRESS}${T}${WIDTH}${T}${HEIGHT}
${DEVICE_MODEL}${T}${SERIAL}${T}${BOARD_SERIAL}${T}${UUID}${T}${MAC_ADDRESS}${T}${WIDTH}${T}${HEIGHT}${T}${KERNEL_ARGS}
EOF
echo "Wrote TSV to: ${TSV_SERIAL_SETS_FILE}"
@ -344,6 +345,7 @@ EOF
-e s/\{\{ROM\}\}/"${ROM}"/g \
-e s/\{\{WIDTH\}\}/"${WIDTH}"/g \
-e s/\{\{HEIGHT\}\}/"${HEIGHT}"/g \
-e s/\{\{KERNEL_ARGS\}\}/"${KERNEL_ARGS:-}"/g \
"${MASTER_PLIST}" > "${OUTPUT_DIRECTORY}/plists/${SERIAL}.config.plist" || exit 1
fi
@ -361,11 +363,11 @@ EOF
done
[ -e "${CSV_SERIAL_SETS_FILE}" ] && \
cat <(echo "DEVICE_MODEL,SERIAL,BOARD_SERIAL,UUID,MAC_ADDRESS,WIDTH,HEIGHT") "${CSV_SERIAL_SETS_FILE}"
cat <(echo "DEVICE_MODEL,SERIAL,BOARD_SERIAL,UUID,MAC_ADDRESS,WIDTH,HEIGHT,KERNEL_ARGS") "${CSV_SERIAL_SETS_FILE}"
[ -e "${TSV_SERIAL_SETS_FILE}" ] && \
cat <(printf "DEVICE_MODEL\tSERIAL\tBOARD_SERIAL\tUUID\tMAC_ADDRESS\tWIDTH\tHEIGHT\n") "${TSV_SERIAL_SETS_FILE}"
cat <(printf "DEVICE_MODEL\tSERIAL\tBOARD_SERIAL\tUUID\tMAC_ADDRESS\tWIDTH\tHEIGHT\tKERNEL_ARGS\n") "${TSV_SERIAL_SETS_FILE}"
}