summaryrefslogtreecommitdiff
path: root/custom-scripts
diff options
context:
space:
mode:
authoruvok cheetah2024-09-11 20:05:08 +0200
committeruvok cheetah2024-09-11 20:05:08 +0200
commit020688d55a65868959a94eb5f118299043732fec (patch)
tree85235d892a542324a80adb32ec51eb1fd0da74ba /custom-scripts
parentd59d3c010f40d6ec93d828aa1d23435f060e1da7 (diff)
Improve/speedup (?) raspi boot
Diffstat (limited to 'custom-scripts')
-rwxr-xr-xcustom-scripts/modify-raspi.sh24
1 files changed, 23 insertions, 1 deletions
diff --git a/custom-scripts/modify-raspi.sh b/custom-scripts/modify-raspi.sh
index 69870bf..9340f04 100755
--- a/custom-scripts/modify-raspi.sh
+++ b/custom-scripts/modify-raspi.sh
@@ -20,6 +20,28 @@ sed -i -e "s/BOOT_UART=0/BOOT_UART=1/" "${BINARIES_DIR}/rpi-firmware/bootcode.bi
# Use "faster" start
#$ grep start rpi-firmware/config.txt
#start_file=start.elf
-sed -i -e "/start_file/ s/^.*$/start_file=start_cd.elf/" "${BINARIES_DIR}/rpi-firmware/config.txt"
+
+# https://kittenlabs.de/blog/2024/09/01/extreme-pi-boot-optimization/
+
+cfgfile="${BINARIES_DIR}/rpi-firmware/cmdline.txt"
+grep -q earlycon "$cfgfile" || sed -i -e '1 s/$/ earlycon=pl011,mmio32,0x3f201000/' "$cfgfile"
+
+cfgfile="${BINARIES_DIR}/rpi-firmware/config.txt"
+sed -i -e "/start_file/ s/^.*$/start_file=start_cd.elf/" "$cfgfile"
+grep -q nohdmi "$cfgfile" || sed -i -e '/dtoverlay/ s/$/,nohdmi/' "$cfgfile"
+grep -q disable_fw_kms_setup "$cfgfile" || echo "disable_fw_kms_setup=1" >> "$cfgfile"
+grep -q enable_tvout "$cfgfile" || echo "enable_tvout=0" >> "$cfgfile"
+grep -q force_turbo "$cfgfile" || echo "force_turbo=0" >> "$cfgfile"
+grep -q initial_turbo "$cfgfile" || echo "initial_turbo=10" >> "$cfgfile"
+grep -q hdmi_blanking "$cfgfile" || echo "hdmi_blanking=1" >> "$cfgfile"
+grep -q hdmi_ignore_edid "$cfgfile" || echo "hdmi_ignore_edid=0xa5000080" >> "$cfgfile"
+grep -q hdmi_ignore_cec_init "$cfgfile" || echo "hdmi_ignore_cec_init=1" >> "$cfgfile"
+grep -q hdmi_ignore_cec "$cfgfile" || echo "hdmi_ignore_cec=1" >> "$cfgfile"
+grep -q force_eeprom_read "$cfgfile" || echo "force_eeprom_read=0" >> "$cfgfile"
+grep -q disable_poe_fan "$cfgfile" || echo "disable_poe_fan=1" >> "$cfgfile"
+grep -q ignore_lcd "$cfgfile" || echo "ignore_lcd=1" >> "$cfgfile"
+grep -q disable_touchscreen "$cfgfile" || echo "disable_touchscreen=1" >> "$cfgfile"
+grep -q camera_auto_detect "$cfgfile" || echo "camera_auto_detect=0" >> "$cfgfile"
+grep -q display_auto_detect "$cfgfile" || echo "display_auto_detect=0" >> "$cfgfile"
exit 0