树莓派修改 boot loader config 配置(搬运,未测试)

第一步:提取配置文件

cp /lib/firmware/raspberrypi/bootloader/stable/pieeprom-2020-01-17.bin pieeprom.binrpi-eeprom-config pieeprom.bin > bootconf.txt

将配置文件进行拷贝,并且放到指定的目录。pieeprom.bin就是配置文件,然后导出成txt文件。该文件的作用与之前树莓派SD卡中的config.txt类似。

第二步:设置bootconf.txt中的内容

我配置的内容如下:

[all]
BOOT_UART=1
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0
DHCP_TIMEOUT=45000
DHCP_REQ_TIMEOUT=4000
TFTP_FILE_TIMEOUT=30000
TFTP_IP=192.168.12.194
TFTP_PREFIX=1
BOOT_ORDER=0x21
SD_BOOT_MAX_RETRIES=3
NET_BOOT_MAX_RETRIES=5
TFTP_PREFIX_STR=raspi4/
[none]
FREEZE_VERSION=0

后面会解释一下其中的内容。


第三步:将配置写回pieeprom.bin文件中

rpi-eeprom-config --out pieeprom-new.bin --config bootconf.txt pieeprom.bin

这一步用于将配置文件写回。


第四步:将pieeprom.bin烧录到eeprom中

sudo rpi-eeprom-update -d -f ./pieeprom-new.bin