[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to set u-boot environment variable



Thanks for the good description.It looks like I should try to build
u-boot from scratch and install it on my board. This is an odroid-u2
which was never widely popular, and it's pretty old, and I'm really
having a hard time understanding the instructions in
doc/README-odroid. There's also the additional issue of some mystic
cryptographic binaries directly from hardkernel that somehow
circumvent the TrustZone mechanism.

I had hoped that it was somehow possible to figure out where the
u-boot environment needs to be on the SD card, and then to just create
a new one using mkimage and dd.

Regards,
robert

On Thu, Dec 22, 2016 at 6:51 PM, Vagrant Cascadian <vagrant@debian.org> wrote:
> On 2016-12-22, Robert Latest wrote:
>> Given a bootable SD card, how can I change u-boot's behavior to, for
>> example, load a different kernel image or use different environment
>> variables (I'm most desperate to set the device to have a fixed MAC
>> address)?
>
> It's entirely platform-dependent. Some platforms have it located at a
> raw offset on the boot media, some load a uenv.txt file, some load a
> uboot.env file, etc...
>
> You can configure flash-kernel to generate a boot script which can set
> variables in u-boot, if you platform supports loading a boot.scr.
>
>
>> I think the environment variables need to be written to a specific
>> location on the SD card, but u-boot-tools provides no such tool. man
>> fw_setenv needs a file /etc/env.config, but my system (which is a
>> finished image I copied from somewhere) doesn't have that.
>
> The locations are board-specific. There are some examples for
> /etc/fw_env.config in /usr/share/doc/u-boot-tools/examples/.
>
> I'd still suggest using a flash-kernel boot script instead, if you can,
> as saving the environment variables means when you upgrade u-boot, you
> don't benefit from new defaults if there are bugs fixed or improved
> features in the default environment.
>
>
>> - What's the difference between uImage and zImage, and why does one
>> kernel version have a uImage and the other a zImage?
>
> uImage is a wrapper that includes some checksums to verify image
> integrity. Many modern u-boot versions support loading the zImage file
> directly with "bootz".
>
>
>> - Is the "dts" file the source that the "dtb" file was created from,
>> or does it have some other purpose?
>
> Hopefully the dts is the source... although you can generate the .dts
> From the .dtb and compare to make sure...
>
>
> Sounds like the image you're using is using vendor-built kernels and
> presumably kernel trees, so the behavior of those may not be consistant
> with a debian-provided kernel image.
>
>
> live well,
>   vagrant


Reply to: