From 020688d55a65868959a94eb5f118299043732fec Mon Sep 17 00:00:00 2001 From: uvok cheetah Date: Wed, 11 Sep 2024 20:05:08 +0200 Subject: Improve/speedup (?) raspi boot --- custom-scripts/modify-raspi.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'custom-scripts') 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 -- cgit v1.2.3