Done: How to save the original zImage and ramdisk.gz of an Intel NAS SS4000-E.
Here's for the archives in case someone else wants to do this too :
H wrote on 20101213:
> I'll try to clean this up and feed it so a hex->binary converter (hints
> anyone ?) and see if gunzip likes the result, if so it should be OK
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
zImage 0xF00C0000 0x01008000 0x00200000 0x01008000
ramdisk.gz 0xF02C0000 0x01800000 0x00400000 0x01800000
RedBoot> x -b 0xF02C0000 -l 0x00400000
F02C0000: 1F 8B 08 08 F3 D9 E7 45 02 03 72 61 6D 64 69 73 |.......E..ramdis|
F02C0010: 6B 00 EC 7C 0D 60 54 D5 B5 F5 99 64 12 02 06 0C |k..|.`T....d....|
...
vim typescript # remove head and tail and ctrl-M of typescript log, save as a
head -2 a
F02C0000: 1F 8B 08 08 F3 D9 E7 45 02 03 72 61 6D 64 69 73 |.......E..ramdis|
F02C0010: 6B 00 EC 7C 0D 60 54 D5 B5 F5 99 64 12 02 06 0C |k..|.`T....d....|
cat go.pl
#!/usr/bin/perl
while (<>) {
m/^..(.{6}):\s+(..)\s+(..)\s+(..)\s+(..)\s+(..)\s+(..)\s+(..)\s+(..)\s+(..)\s+(..)\s+(..)\s+(..)\s+(..)\s+(..)\s+(..)\s+(..).*$/ && do {
$dr=hex($1)-2883584;
printf("%.8X", $dr);
print " $2$3 $4$5 $6$7 $8$9 ${10}${11} ${12}${13} ${14}${15} ${16}${17}\n";
};
}
./go.pl < a > ab # subtract offset (note overflow hack) and reformat for xxd
head -2 ab
00000000 1F8B 0808 F3D9 E745 0203 7261 6D64 6973
00000010 6B00 EC7C 0D60 54D5 B5F5 9964 1202 060C
xxd -r < ab > ramdisk.gz
gunzip -tv ramdisk.gz
gzip: ramdisk.gz: decompression OK, trailing zero bytes ignored
OK
And similar for zImage.
-- Hans Lambermont
Reply to: