cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bfung_2
Adventurer
Adventurer
455 Views
Registered: ‎07-02-2020

Modify uboot.env to set ethaddr

Jump to solution

I am using petalinux 2020.1

I'm wondering how I can edit boot.cmd.default to include 'setenv ethaddr <MAC ID OF MY CHOICE>' into the boot.scr that u-boot loads.

I've tried modifying /project-spec/meta-user/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.default, then running 'petalinux-build' but any of my changes don't make it into the resultant boot.scr

I'd like to be able to change the device MAC address by modifying a reference file that u-boot consumes, and which I can change the contents of without having to rebuild the entire petalinux project.

0 Kudos
1 Solution

Accepted Solutions
bfung_2
Adventurer
Adventurer
214 Views
Registered: ‎07-02-2020

I solved this by writing out the u-boot commands in a plain text file, then generating a boot.scr with:

mkimage -c none -A arm -T script -d boot.txt boot.scr

then putting the boot.scr in my boot partition of my SD card.

View solution in original post

0 Kudos
4 Replies
bfung_2
Adventurer
Adventurer
409 Views
Registered: ‎07-02-2020
  • I've tried to configure u-boot to boot from a FAT environment

u-boot.png

  • I have written a uboot.env with the only single line:
ethaddr 00:0A:35:00:CA:FE

I then boot the system with this new uboot.env file within the same boot FAT partition.

  • The MAC address seems to not be updated and is still the default
  • I also notice at the top of the u-boot boot messages
Loading Environment from FAT... ** No device specified **
0 Kudos
sandeepg
Moderator
Moderator
393 Views
Registered: ‎04-24-2017

Hi @bfung_2 ,

Can you add <plnx-proj-root>/project-spec/meta-user/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.default.initrd file.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
bfung_2
Adventurer
Adventurer
304 Views
Registered: ‎07-02-2020

I have forgotten to fill out the following menu parameters:

unnamed.jpg

 

Now when I boot with a uboot.env I created manually by hand, I get the following:

 

Loading Environment from FAT... *** Warning - bad CRC, using default environment

 

I am likely not creating my uboot.env file correctly.

How do I create this file properly?

0 Kudos
bfung_2
Adventurer
Adventurer
215 Views
Registered: ‎07-02-2020

I solved this by writing out the u-boot commands in a plain text file, then generating a boot.scr with:

mkimage -c none -A arm -T script -d boot.txt boot.scr

then putting the boot.scr in my boot partition of my SD card.

View solution in original post

0 Kudos