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

Re: Update APEX for fatted nslu2 (FatSlug)



Martin Michlmayr wrote:
> * Asier <katximan@gmx.net> [2009-01-19 07:31]:
>> Great! How can I backup ths nslu2 flash memory?
>>
>> # cat /dev/mtd0 > RedBoot
> ...
> 
> Yes

Actually, if you want to be able to reflash the image, or unpack it with
slugimage (so that you can repack it with a new Apex), then you need to do:

cat /dev/mtdblock* > backup.bin

and then use slugimage to unpack backup.bin into it's constituent parts.

The reason is that slugimage adds or removes the 16 byte headers on the
various partitions as it packs or unpacks the image.  If you just take a
copy of each of the individual partitions, and then try and use those
files directly with slugimage to pack a new image, you'll end up with
extra headers (and probably a corrupted kernel).

In particular, the Loader partition has a 16 byte header on it, and the
Kernel partition is likely to have a 16 byte dummy header in the
*middle* of it, the location of which is determined by a hard-coded
constant in the particular hacked-up RedBoot that SerComm supplied to
Linksys for the NSLU2.

So you really do need to use slugimage to unpack and repack such an image.

-- Rod


Reply to: