Override u-boot argument

Hello there,

I am building a custom kernel with ext4 rootfs type. However, the u-boot sdargs sets the rootfstype to ext3. How can I override it without touching the u-boot? Is there any way like the uEnv.txt file to change it?

Thanks,
Jason

You can easily modify u-boot environmental variables with setenv and save it with saveenv, no need to modify u-boot.
BTW with out 2.7b4 release we’ve also moved to ext4 and u-boot has required arguments.
If you’re flashing 2.7b4 on a module that already had u-boot remember to execute:
env default -a;saveenv;reset;
after flashing

Suppose we have a kernel image with rootfs in ext3, and my new image is in ext4. If I need to switch within them frequently, it is a bit annoying to change the rootfs each times. Is there like an uEnv.txt with the sd card such that the u-boot can read and set the parameter automatically? For what I see so far the only way is what you mentioned.

Excuse me, for “u-boot has required arguments”, do you mean in the 2.7b4 u-boot, it reads arguments (from a file like uEnv.txt)?

Assuming you are using an SD card to boot you could have two commands, one for each kind of image you want to boot. If you frequently switch between booting different image types you could consider using distro boot.

But if the only difference is ext3 vs. ext4 then you don’t need to do anything. The ext4 setting is able to mount an ext3 file system and you are fine without changing anything.

With 2.7b4 we changed the U-Boot environment to use ext4. Starting with that version U-Boot already has the required default arguments. To reset your environment to this default use the commands Dominic references.

You can set U-Boot environment variables from a plain text file loaded into memory with env import. The file used is often named uEnv.txt.

You could load and apply such a file in your bootcmd should you wish to do so, e.g. start your bootcmd with:

load mmc 0:1 $loadaddr uEnv.txt && env import -t $loadaddr $filesi
ze

With uEnv.txt containing something like:

a_variable=a_value

That is very helpful for me, thank you. However we sold those board already and assuming customers don’t want to change the u-boot (or don’t have the access to the console). At the end we plan to switch rootfs to ext3. Is the boot.scr works the same way as uEnv.txt that I need to execute command to activate the feature as the uEnv.txt do? → I found the answer from the link you provided, I appreciate your help, thank you very much!