We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

U-Boot environment offsets for Omega - what to write into /etc/fw_env.config?



  • I would like to access the U-Boot environment variables from Linux and therefore I installed the uboot-envtools, which provides the two utilities fw_printenv and fw_setenv.

    However, to make these work, one needs to figure out the offset/size parameters which locate the U-Boot environment in the flash memory. The OpenWRT Wiki has some information on this, but essentially one needs to know (or guess) the right numbers to put into /etc/fw_env.config. I tried many variants, but with no success so far.

    Has anybody been successful with the uboot-envtools already? If so, it would be great if he or she could share the /etc/fw_env.config that works with the Omega!



  • Did you have any luck with this?
    I was just thinking about the same.
    I don't think it should be too difficult to locate the ENV offset, but it would be nice to know the full flash partitioning layout.
    E.g. at which offsets do you find the kernel, etc.

    It is not too difficult to figure all this out, but I would prefer if the information were available on the wiki page.



  • @Flemming-Richter no, I did not have any luck with this (and did not get any information). But I haven't really tried yet to figure it out myself, because it wasn't a pressing issue so far.

    Still, it's something I'll need eventually to finish a project.

    But as this project will now become Omega2 based, the flash layout will most likely be different, and at this time I just hope the Omega2 layout will be easier to work with (maybe it will have a separate partition for the uboot env, like some other OpenWrt targets do)

    BTW: the flash partition layout (and kernel offset) is easy to get, just type "cat /proc/mtd"
    However, with no separate uboot env partition, only understanding the relevant uboot sources can reveal at which offset within one of the partitions the uboot env resides.



  • omega2 preliminary, most likely final
    root@Omega-2742:/# cat /proc/mtd
    <code>
    dev: size erasesize name
    mtd0: 00030000 00010000 "u-boot"
    mtd1: 00010000 00010000 "u-boot-env"
    mtd2: 00010000 00010000 "factory"
    mtd3: 01fb0000 00010000 "firmware"
    mtd4: 0014a5c4 00010000 "kernel"
    mtd5: 01e65a3c 00010000 "rootfs"
    mtd6: 017c0000 00010000 "rootfs_data"
    </code>



  • @youlian-troyanov, I see you tried to format your code?!

    It took me a while till i figured out how to do it with my Brazilian Keyboard ...
    I made some Notes where could be helpful for you to get into markdown?



  • @Luciano-S you say this board works with markdown? didn't know. as i am an old man, i am into the old ways of doing things. these newfangled stuff is way above my head šŸ™‚



  • @youlian-troyanov cool! separate partition for u-boot-env! Should make things easier. Can't wait to try this on a real Omega2!



  • @youlian-troyanov said in U-Boot environment offsets for Omega - what to write into /etc/fw_env.config?:

    i am into the old ways of doing things. these newfangled stuff is way above my head šŸ™‚

    I just mentioned it because of your <code></code> :

    root@Omega-2742:/# cat /proc/mtd
    <code>
    dev: size erasesize name
    mtd0: 00030000 00010000 "u-boot"
    mtd1: 00010000 00010000 "u-boot-env"
    mtd2: 00010000 00010000 "factory"
    mtd3: 01fb0000 00010000 "firmware"
    mtd4: 0014a5c4 00010000 "kernel"
    mtd5: 01e65a3c 00010000 "rootfs"
    mtd6: 017c0000 00010000 "rootfs_data"
    </code>
    

    root@Omega-2742:/# cat /proc/mtd would be a single command ...

    Just for your information, Im also not the newest model anymore (69) šŸ˜‰



  • thanx man, never too late to learn something new šŸ˜‰



  • At least, you guys are using smilies. :tools: It's an excellent start! šŸ˜€



  • Reviving an old thread to post what I found:

    On my Omega 2+, the uboot environment seems to start at 0x2000 in /dev/mtd1, and runs to 0x5fff, thus my /etc/fw_env.config files looks like:

    # Configuration file for fw_(printenv/saveenv) utility.
    # MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
    /dev/mtd1               0x2000          0x4000          0x1000
    

Log in to reply
 

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