Re: [meta-arago] [PATCH] tisdk-uenv: Add instructions to load initramfs while booting linux

Andrew Davis <[email protected]>
Newsgroups org.yoctoproject.lists.meta-arago
Message-ID <[email protected]>
On 3/4/26 8:38 AM, Ryan Eatmon wrote:
> 
> 
> On 3/4/2026 12:32 AM, Moteen Shah wrote:
>>
>> On 03/03/26 22:49, Andrew Davis wrote:
>>> On 3/3/26 4:49 AM, Moteen Shah via lists.yoctoproject.org wrote:
>>>> Add instructions to load initramfs image and update the boot command
>>>> to use the image to boot the linux kernel.
>>>>
>>>> Signed-off-by: Moteen Shah <[email protected]>
>>>> ---
>>>>   .../recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt  | 15 +++++++++++++++
>>>>   1 file changed, 15 insertions(+)
>>>>
>>>> diff --git a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>>> index 0af0eef3..5ac61b34 100644
>>>> --- a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>>> +++ b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>>> @@ -7,3 +7,18 @@
>>>>   #       default on all newer U-Boot images.  This also means that some
>>>>   #       variables such as bootdelay cannot be changed by this file since
>>>>   #       it is not evaluated until the bootcmd is run.
>>>> +
>>>> +# Initramfs configuration
>>>> +# Name of the initramfs file in the boot partition
>>>> +name_initramfs=ti-core-initramfs.cpio.xz
>>>> +
>>>> +# Command to load initramfs from boot partition (mmc device:partition)
>>>> +# Adjust the device number (0 or 1) based on your setup
>>>> +# mmcdev is set to 1 by default, partition 1 is the boot partition
>>>> +get_initramfs_mmc=fatload mmc ${mmcdev}:1 ${rdaddr} ${name_initramfs}
>>>> +
>>>
>>> This belongs in u-boot default env, it is basically the same as `get_fdt_mmc`
>>> and other helpers already there.
>>>
>>>> +# Load initramfs and set up variables
>>>> +load_initramfs=if run get_initramfs_mmc; then setenv _initramfs ${rdaddr}:${filesize}; setenv rd_spec ${_initramfs}; echo Initramfs loaded at ${rdaddr}, size ${filesize}; else echo WARNING: Initramfs not found, continuing without initramfs; setenv rd_spec -; fi
>>>> +
>>>
>>> This should be part of `mmcloados` in u-boot also.
>>
>>
>> mmcloados is only used by 'mmcboot' which is a differnt boot command other than bootcmd_ti_mmc?
>> We can consider adding the load_initramfs to 'get_kern_mmc' and we wont need to override the init_mmc with the change.
>>

Adding to `get_kern_mmc` wouldn't make sense, that is for loading the kernel as the
name suggests. If we don't go down the `mmcboot` path anymore then add it to whatever
path we do go down these days.

>>>
>>>> +# Custom boot command that loads initramfs before kernel
>>>> +init_mmc=run args_all args_mmc load_initramfs
>>>
>>> With the above added, you don't need to override `init_mmc` so
>>> this line goes away too.
>>>
>>> That leaves one line left, `name_initramfs`. How about just
>>> setting a sane default name in u-boot. We got away with something
>>> like this for K2 plats:
>>
>> We don't expect the name of the cpio to be variable, as the name of the cpio stays the same for all K3 platforms which is "ti-core-initramfs.cpio.xz", I can remove the variable altogether maybe and directly use the image name to load. Thoughts?
> 
> That is a very Yocto centric take.  But we also support armbian and other distros.  They may not want to name the file the same way we chose in meta-ti.  The question is, should we paint ourselves into a corner from the beginning or allow for some flexibility?
> 
> Plus, even in Yocto, a user could choose to not use ti-core-initramfs and instead make their own with their own name.  Making this more flexible feels more friendly in the long run.
> 

And you don't have to look too far, that encrypted boot series posted the other
day would have made use of a new named ti-encrypted-boot-initramfs.cpio.gz
(although the booting method would have been different)

> Just my two cents.
> 

Worth every penny :)

Andrew

> 
>> Regards,
>> Moteen
>>
>>>
>>> https://github.com/u-boot/u-boot/blob/master/board/ti/ks2_evm/k2e_evm.env#L12
>>>
>>> although I'd recommend a more generic filename.
>>>
>>> Andrew
>>>
>>>> \ No newline at end of file
>>>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.