Multiple kernels and boot partitions selection

gianluca gianlucarenzi at eurek.it
Mon Oct 10 10:38:15 CEST 2022


On 10/10/22 10:06, Quentin Schulz wrote:
> Hi Gianluca,
> 
> On 10/10/22 09:06, gianluca wrote:
>> Hello,
>> I was wondering if there is/are some standard way(s) to achieve a 
>> multiple boot selection on u-boot startup.
>>
>> Let's say I have a bunch of partitions:
>>
>> 1- /dev/mmcblk0p7 with Debian 11 Bullseye
>>
>> 2- /dev/mmcblk0p5 with Debian 10 Buster
>>
>> All of these partitions have the /boot/uImage kernel images, the 
>> /lib/modules/$(uname -r) drivers folders and /boot/dtb device-trees 
>> into their partition section.
>>
>> u-boot has NOT the specific environment partition, i.e. it is located 
>> in the end of bootloader itself up to the maximum size of the 
>> bootloader partition. So, to be clear the /dev/mmcblk0p1 contains 
>> u-boot code & envar space.
>>
>> If needed I can have a MB85RC64 a 24LC64 FRAM/EEPROM compatible memory 
>> chip to store information on boot.
>>
> 
> You can modify the U-Boot environment from userspace with fw_setenv from 
> libubootenv (formerly u-boot(-fw)-tools). You can store from there which 
> partition to use for the next boot in an environment variable.
> 

As far as I know, I suppose I need an extra (let's say FAT) partition 
with the uboot.env transcoded file.
Then, with the u-boot(-fw)-tools I can access them from userspace to 
change some envar like:

from:

loadimage=mmc 0:5 ${loadaddr} ${bootfile}

to:

loadimage=mmc 0:7 ${loadaddr} ${bootfile}


> fw_setenv loadimage 'mmc 0:7 ${loadaddr} ${bootfile}'


Is it right?

Regards
-- 
Eurek s.r.l.                          |
Electronic Engineering                | http://www.eurek.it
via Celletta 8/B, 40026 Imola, Italy  | Phone: +39-(0)542-609120
p.iva 00690621206 - c.f. 04020030377  | Fax:   +39-(0)542-609212



More information about the U-Boot mailing list