Difference between revisions of "Firmware Modification"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m (typo)
Line 52: Line 52:
How-to courtsey of André. Original at [http://terastation.wiki.homelinux.net/wikish/FirmwareModification.html?FailSafeFirmware]
How-to courtesy of André. Original at [http://terastation.wiki.homelinux.net/wikish/FirmwareModification.html?FailSafeFirmware]

Revision as of 13:51, 2 September 2007


This section describes how to modify the initrd part of the firmware, to change the content of the system partition look here: http://www.terastation.org/wiki/Firmware_update


You also need firmingtool (also see above link).

Here we go:

1. We start with tera_213a.zip (e.g. from http://homepage.ntlworld.com/itimpi/buffalo.htm#TERA_TELNET ) and extract it, then move the file firmimg.bin to a linux box.

2. We extract the initrd and mount it

> ./firmimgtool -ic -k kernel.gz -r initrd.gz firmimg.bin

---- firmimg_file information ----
filename : firmimg.bin
checksum : 00000000
---- firmware information ----
info_ver : 00000001
firmid   : 00002001
subver   : FLASH 1.0
version  : 3.02, build 0000
date     : 2006/12/01 11:16:34
firmsize : 002F5E26
checksum : C2DFAF63
kernel   : offset 0000006C, size 0010716C
initrd   : offset 001071D8, size 001EEC4E

> gunzip initrd.gz
> mkdir ramfs
> mount -o loop initrd ramfs
> cd ramfs

3. Now we can

1. change etc/passwd and e.g. remove the password for root - this is the emergency password
2. modify linuxrc, the init script (changed version: http://terastation.hw.dnsalias.net/download/linuxrc) 

4. After all modifications (which should be extremely careful, otherwise you might need a JTAG cable !!!) we rebuild the firmware:

> cd ..
> umount ramfs
> gzip -9 initrd
> ./firmimgtool -im -f firmimg.bin -k kernel.gz -r \
initrd.gz firmimg.bin.new

5. You then can move firmimg.bin.new to firmimg.bin and use it to flash.

How-to courtesy of André. Original at [1]