How to Write uboot Environment Variables on system runtime?



  • Hi,teams

    My purpose is to write the device identity authentication information into my customized Omega2+ device. I hope this part can be firmly stored in the device (retained even after system restore).

    I confirm writing uboot variable is available on uboot environment, refer by https://community.onion.io/topic/2272/what-does-this-message-mean_=1767832343343.

    But modify uboot variable only on boot environment is not good idea for me, fw_setenv is available on system environment? Permission Denied for /dev/mtd1 When Executing fw_setenv.



  • hi @mulu553,

    are you building your own firmware for your device? If so, you can just edit the device tree target/linux/ramips/dts/mt7628an_onion_omega2.dtsi around line 120 and remove or comment out the read-only:

    partition@30000 {
    	label = "u-boot-env";
    	reg = <0x30000 0x10000>;
    	read-only;
    };
    

    And then rebuild the firmware.

    That's what I have in my firmware for many years now for similar purposes.



  • @luz Yes, I used the openwrt-imagebuilder-wrapper from onion's GitHub repo to generate my own customized firmware. Thank you very much for your suggestion.😊


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.