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
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"
@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!
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/mtdwould 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! :grinning: