LinAdmin wrote: ↑
Tue Mar 30, 2021 9:20 pm
As far as I understand, config.txt is read before the Grub menu is used?
Yes, it is actually read long before any actual ARM boot code executes (since it is processed by VideoCore rather than the ARM CPU), including before the UEFI firmware is loaded and executed. This should actually make sense, since it's config.txt
that tells the Raspberry Pi to launch the UEFI firmware, with its armstub=RPI_EFI.fd
All this to say that, as far as the Raspberry Pi is concerned, there can only ever be one config.txt
that applies once ARM code starts to execute, and if you want a different config.txt
, you have no choice but to overwrite the existing one and reboot the platform. Especially, neither GRUB nor the UEFI firmware can alter any of the config.txt
that were used for booting, because by the time they run, VideoCore has already processed them.
You can however edit the Linux commandline options in GRUB, or select a different kernel, if that's what you are after. There's plenty of GRUB documentation around that should help you achieve just that. As a matter of fact, the same GRUB configuration that applies to an x86 PC, in terms of adding kernels or kernel options does apply to a Debian installation that was carried out using this guide, as the whole idea is to have the Pi behave in the same was as a UEFI based PC would. In other words, whereas non-UEFI boot of Linux kernel on the Raspberry Pi usually requires editing config.txt to tell which kernel and what kernel options to use, UEFI boot makes all that obsolete, as GRUB (or whatever other UEFI compatible bootloader) will be in charge of defining the kernel and kernel options.
So you should probably forget about Raspberry Pi specific guides, and instead follow PC specific guides if you want to alter your Linux boot configuration...