r/embeddedlinux • u/EmbeddedBro • Jan 30 '26
How can I find command in U-boot which loads linux kernel ?
Edit: found solution: printenv bootcmd
I am running linux kernel on stm32 board. I have connected through ssh.
What I want to do is: I want to stop at u-boot.. do some experiments.. and after that I want to run linux kernel.
I can stop at u-boot
If I do not stop at u-boot, linux kernel loads, but from terminal messages I couldn't find any command.
Is there any way to retrieve the command which loads the linux kernel from u-boot?
11
Upvotes
10
u/namotous Jan 30 '26
In uboot, do printenv bootcmd, that’s what called when you boot
4
u/DerpyCoin Jan 30 '26
Do a 'printenv bootcmd' that's what's executed in autoboot.
2
u/kiladre Jan 31 '26
Help and ? Are good commands to start with too
2
u/mad_alim Jan 31 '26
Others answered, but just wanted to say to not forget bootargs for full context
5
u/Ok-Adhesiveness5106 Jan 30 '26
SSH access is only available after systemd starts the SSH service, which is already too late to interrupt U-Boot.
To stop U-Boot, you must connect to the target using a serial console. When the autoboot delay prompt appears, press any key (or Ctrl+C) to enter the U-Boot hush shell.
To check the configured bootcmd, run printenv from the U-Boot shell. Alternatively, once SSH access is available in Linux, you can use fw_printenv to read the U-Boot environment variables.
cat /boot/boot.scr may give your boot script.