Background: ARM based system with u-boot.
I need to use all UARTs on the SOC connected to different types of external controller cards (cant just change the system console to another UART).
To mute the system console I have found that following in /boot/loader.conf
boot_mute="YES" # mute the kernel
hw.fdt.console="null" # mute the rest of the system, actually it fails to find null in the devicetree (sys/dev/uart/uart_bus_fdt.c).
But efi/loader are not muted.
In the efi/loader the /boot/loader.conf content are not available at the top of main(), but u-boot environment variable bootargs will be available in argv. Parse the arguments a little bit earlier and if it contains -m (RB_MUTE) use nullconsole.
On my system efi_main.c:efi_main() will not add the program name (loader.efi) in the first argv vector position, instead it is -m. Later on in main.c:parse_args() the for loop expects the first position to be the program name and starts at the first position and will miss the argument (-m).
As a sideeffect a kernel environment variable "loader.efi=1" will be created on those system that need the program name in the argv vector.
Other solutions can be:
- I can send additional information from efi_main.c -> main.c if the first position are the program name or not.
- I can define bootargs as -m -m :)
Other suggestions?