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

Re: U-Boot on QNAP TS-421



On 2014-02-12 14:07, Björn Wetterbom wrote:
On Wed, Feb 12, 2014 at 12:14 PM, Gordan Bobic <gordan@bobich.net>
wrote:

TS-421 doesn't save it's u-boot variables on NAND. As
far as I can tell, they are always saved on a virtual
MTD partition (mtdblock4) in RAM, and overwritten on
every boot with the presets hard-coded in the u-boot
binary (mtdblock0).

 
Can't you just do 'saveenv' in u-boot after setting your variables? I
haven't tried it on the TS-421, but on several other u-boots.

No, that's the obvious thing I tried first. Set a variable,
do saveenv, it will say it saved the variables, reset, and
all the variables are back to defaults.

If you look at the dump of mtdblock0 with a hex editor (or
even just do a strings dump of it) you can see all the
variables being set in there. On the TS-421 u-boot seems
to explicitly clobber the variables every time. I _presume_
this only ever gets stored in RAM; the alternative would
mean the NAND gets wasted in a few thousand reboots which
would be _poor_.

I even tried manually editing the contents of mtdblock4
where the variables appear to be stored. The changes to
this equally do not survive a reboot.

I'll get Debian installed on it and grab the bits I
need from that (such as qcontrol - I couldn't disable
the watchdog by echoing 0x67 to /dev/ttyS1, the only
way I could disable it is by doing it in u-boot with
"uart1 0x67" instead of the default "uart1 0x68" it
does as the first thing in the hard-coded bootcmd).

Gordan


Reply to: