Load kernel from rootfs /boot folder

I am setting up dual copy update with Yocto/SWUpdate. I have modified the “image.json” to create two rootfs partitions and I have configured Yocto to include the kernel and device tree related files in the /boot folder of each rootfs. But, I do not see how to configure the “u-boot-initial-env-sd” file to load the kernel from the rootfs partitions rather than the bootfs partition. Any help will be appreciated.

tdx-info

Software summary

Bootloader: U-Boot
Kernel version: 6.6.23-7.0.0-devel-gba8e061aede6 #1 SMP PREEMPT Wed Sep 25 11:25:16 UTC 2024
Kernel command line: root=PARTUUID=e1cbc444-02 ro rootwait console=tty1 console=ttymxc2
Distro name: NAME=“TDX Wayland with XWayland”
Distro version: VERSION_ID=7.0.0-devel-20241219010323-build.0
Hostname: verdin-imx8mp-15335644

Hardware info

HW model: Toradex Verdin iMX8M Plus on Verdin Development Board
Toradex version: 0063 V1.1B
Serial number: 15335644
Processor arch: aarch64

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello!

To configure U-Boot to load the kernel from the /boot directory within your rootfs partitions, you’ll need to modify the U-Boot environment variables. This involves adjusting the boot command sequence to point to the kernel and device tree files located in the /boot directory of your rootfs partitions.

Here’s how you can do it:

  1. Access the U-Boot Console: During the boot process, interrupt the autoboot by pressing any key to access the U-Boot console.

  2. Modify the Boot Command: You need to change the bootcmd environment variable to load the kernel from the desired rootfs partition. Typically, this involves setting the bootargs and load commands to point to the correct partition and file paths.

    For example, if your rootfs partitions are on mmcblk0p2 and mmcblk0p3, you might set:

    setenv bootargs 'root=/dev/mmcblk0p2 ro rootwait console=tty1 console=ttymxc2'
    setenv loadkernel 'ext4load mmc 0:2 ${loadaddr} /boot/zImage'
    setenv loadfdt 'ext4load mmc 0:2 ${fdt_addr} /boot/imx8mp-verdin.dtb'
    setenv bootcmd 'run loadkernel; run loadfdt; bootz ${loadaddr} - ${fdt_addr}'
    saveenv
    

    Make sure to adjust the partition numbers and file paths according to your setup.

  3. Save the Changes: Use the saveenv command to save your changes to the U-Boot environment.

  4. Reboot: Restart the system to apply the changes.

By following these steps, U-Boot should load the kernel from the /boot directory within the specified rootfs partition. Ensure that the paths and partition numbers match your specific configuration. If you encounter any issues, double-check the file paths and partition identifiers used in the commands.

I hope this helps! If you have any more questions, feel free to ask.

Best regards,
Toradex AI Assistant.

Please, also check if these links can help you solve your problem:

Custom rootfs, uboot and dts using uuu.

The ToradexAI has given me some clues. I may be able to track down the answer on my own now.

I don’t know that the ToradexAI response is helpful in this situation. It appears that the bootz command it suggested is not available. Any suggestions on how to load the kernel and device tree files from the /boot folder of the rootfs would be appreciated.

Hey @Sutter99,

Here is a list of environmental variables that are applicable for our images.

-Eric

Hey @Sutter99,

Was the link helpful for solving this issue?

I’d also like to mention that Torizon OS has a build in solution for OTA updates . We make use of OSTree + Aktualizr (which is an implementation of automotive Uptane). There are a host of benefits to preforming updates this way, it might be better to set up a call. Let me know if this is of intrested and I’ll get the ball rolling.

-Eric

Hi @eric.tx,

I had looked at the Toradex documentation but I was not familiar with uboot syntax. The following was helpful and I am making progress.

Thank you