uEnv.txt parameters explained?
October 29, 2023 10:14AM
Hi,

Id kindly ask for explaining in detail role of above.
Suppose default uEnv.txt of 'install' USB would vary from those on targettransfered/ HDD rootfs?

Below default uEnv.txt:
bootdev=usb
device=0:1
devices=usb
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
Re: uEnv.txt parameters explained?
October 29, 2023 02:06PM
zebe,

> Suppose default uEnv.txt of 'install' USB would
> vary from those on targettransfered/ HDD rootfs?

The uEnv.txt is a way to set the envs on the fly (i.e. during booting). This can be used to customize the current envs on flash, without making them permanent.

Quote
https://forum.doozan.com/read.php?3,12381
- Ability to customize u-boot envs in a script (uEnv.txt) during boot, without committing changes to NAND (see section C for instruction). This feature also can be used for rescue purpose where the u-boot envs were messed up, or when the NAND envs block is bad.

Its usage is optional

Quote
https://forum.doozan.com/read.php?3,12381
C. Add uEnv.txt to /boot directory (Optional)

To adjust the default envs to your specific configuration, and not having to permanently alter u-boot envs NAND. Create a text file in /boot directory with the content in the format that u-boot envs are listed.

Examples:

The example below only to demonstrate the syntax in uEnv.txt (they might or might not apply to your current settings):

- Load appropriate DTB file for the kernel to run GoFlex Net box.
- Use SD card, USB and SATA for booting. The kernel and rootfs search order is as they are appeared on the list: mmc, usb, ide.
- Define that there are 8 storage devices (i.e. disk partitions).
- Load the DTB at address 0x2c00000 (u-boot default is 0x1c00000) to allow larger uInitrd.

cat /boot/uEnv.txt
dtb_file=/boot/dts/kirkwood-goflexnet.dtb
devices=mmc usb ide
disks=0 1 2 3 4 5 6 7
load_dtb_addr=0x2c00000

So you don't need to use it at all, unless you need to tweak the envs so the box can be booted differently.

Or when you need to set some envs for whatever purpose and you don't want to save it to flash. An example is what I've just show in the USB rescue rootfs.

During booting phase, u-boot (2017.07-kirkwood-tld-1) find the first /boot/uEnv.txt from each devices in your system. So that's why in the NSA325 (which has both USB and SATA), the default env for devices is
devices=usb sata
Each of devices on this list of devices is scanned, if there is no /boot/uEnv.txt in any partition of the USB drives, it will scan SATA partitions.

So for example, if your rootfs is on the HDD, to make it boot faster, you would create a Env.txt in the /boot directory of the HDD rootfs, and change the devices list to
devices=sata usb
In the example above, u-boot will find the kernel files on SATA drive first, and then if not found find it on USB drives.

So for another example, if your rootfs is on the HDD, and you don't want u-boot to find the kernel onthe USB partions at all, you would would create a Env.txt in the /boot directory of the HDD rootfs, and change the devices list to
devices=sata

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: