Firmware Modification

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search


Abstract

This section describes how to modify the initrd part of the firmware, to change the content of the system partition look here: Firmware update

Prerequisites:

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
firmname : HD-HTGL(YOSHIMUNE)
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]