Skip to content

config.txt section paragraph in "Raspberry Pi 4 bootloader configuration" #1938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
seamusdemora opened this issue Jul 6, 2021 · 7 comments
Closed
Labels

Comments

@seamusdemora
Copy link

As I read the paragraph under the config.txt section of the Raspberry Pi 4 bootloader configuration, I struggle for clarity. Here's what it says to me:

If one adds a a section called [config.txt] to the bootloader configuration (e.g. using sudo -E rpi-eeprom-config --edit), then that section is appended to /boot/config.txt

It goes on to say:

This can be used to automatically apply settings to every operating system, for example, dtoverlays.

Does this also mean that I could add (for example) the parameters WAKE_ON_GPIO=0 and POWER_OFF_ON_HALT=1 directly to my /boot/config.txt file, and avoid the editing step sudo -E rpi-eeprom-config --edit??

In other words - rather than adding a section called [config.txt] to the bootloader configuration, could I simply add these parameters to /boot/config.txt, and achieve the same effect?

@lurch
Copy link
Contributor

lurch commented Jul 6, 2021

Short answer: No 😉

Long answer: the eeprom config (stored inside the eeprom, and edited with sudo -E rpi-eeprom-config --edit) and /boot/config.txt (stored on the first FAT partition of the SD card, and edited with sudo nano /boot/config.txt) are very different things. Have a read of https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/bootflow_2711.md for the full details of the Pi4 bootup process.
The WAKE_ON_GPIO and POWER_OFF_ON_HALT are settings used by the bootloader eeprom code, and this code is running before the SD card has even been mounted yet (which is why those settings can't be stored in /boot/config.txt).
This is only an educated guess, but I'm guessing that the /boot/start.elf firmware (that runs from the SD card at a later stage in the boot process) reads /boot/config.txt from the SD card and also reads the eeprom-config and appends the [config.txt] section of the eeprom-config to the values read from /boot/config.txt.

@seamusdemora

This comment was marked as abuse.

@lurch
Copy link
Contributor

lurch commented Jul 7, 2021

Don't forget that the eeprom-config also contains things like BOOT_ORDER, which tells the code-running-from-eeprom where it should even try looking for start.elf & config.txt 😉 (which is why this kind of thing has to be done way before start.elf is even loaded)

Now, with the benefit of your explanation, I'll guess that config.txt section is saying the converse of my question - in other words, this feature allows one to put configuration instructions in the eeprom config instead of /boot/config.txt. Is that the correct interpretation?

I believe so, but @timg236 is the person who knows how all this works... 🙂

@seamusdemora

This comment was marked as abuse.

@aallan aallan added the question label Jul 7, 2021
@lurch
Copy link
Contributor

lurch commented Jul 10, 2021

Is anything else needed here @seamusdemora , or can this be closed?

@seamusdemora

This comment was marked as abuse.

@lurch
Copy link
Contributor

lurch commented Jul 10, 2021

We're going to be locking this repo soon (see #1911 ), but feel free to open a PR when we open it back up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants