Build your own NAS recovery

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 14:17, 2 May 2011 by Lsuser1985 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Overview

If there is no NAS-recovery package available for your Linkstation, you may build your own.

This has been tested with

  • LS-WVL/R1 with Firmware 1.40 and 1.41

Basic steps are:

  1. Download and unpack the current firmware including LSupdater.
    This step should be easy and does not require explanation.
  2. Unpack the kernel and initrd from the firmware package
    See below for how to to this.
  3. Start an TFTP-server
    Below find some hints about where to get a TFTP server and how to start it.


Unpack the kernel and initrd from the firmware package

LSUpdater send archive to the Linkstation, but NAS-recovery requires unpacked files to be served via TFTP.

The firmware-package contains (among others):

  • initrd.img - a ZIP-file containing initrds (initial ramdisks)
  • uImage.img - a ZIP-file containing the kernels


Getting th Product-ID

short: look into linkstation_version.ini

Helper script for Linux/Unix

You may copy & paste the following lines into a shell:

PRODID=0x00003008 # see text for how to the this value

# from 
# http://buffalo.nas-central.org/wiki/Examine_ARM9_Firmware_without_Updating
# for 1.40:
passwd1="aAhvlM1Yp7_2VSm6BhgkmTOrCN1JyE0C5Q6cB3oBB"
passwd2="aAhvlM1Yp7_2VSm6BhgkmTOrCN1JyE0C5Q6cB3oBB"

# for 1.41:
passwd1="IeY8omJwGlGkIbJm2FH_MV4fLsXE8ieu0gNYwE6Ty"
passwd2="YvSInIQopeipx66t_DCdfEvfP47qeVPhNhAuSYmA4"

# unzip the required files
unzip -P "$passwd1" initrd.img
unzip -P "$passwd2" uImage.img uImage.map
# which file will become uImage.buffalo
FILE_BOOT_APPLY=$(grep $PRODID uImage.map | cut -f 2)
unzip -P "$passwd2" uImage.img "$FILE_BOOT_APPLY"
ln -s "$FILE_BOOT_APPLY" uImage.buffalo


Getting a TFTP-Server

Windows

Fetch one from you favorite software side.

Linux

Several tftp servers should be available with your Linux distribution. The package names may vary. Simply choose one :-)

Please have in mind, that TFTP uses Port 69, thus the server has to be started as root.

  • tftp-server
    • is not working, since it requires file-requests to contain absolute pathes, but the Linkstation requests without path.
    • meant to be started via inetd, but can be run stand-alone
    • To start in stand-alone use in.tftpd --foreground --verbose /path/to/firmware
  • python-tftpy -- pure Python implemention
    Can be run without installation:
 wget http://pypi.python.org/packages/source/t/tftpy/tftpy-0.5.1.tar.gz
 tar xzf tftpy-0.5.1.tar.gz
 cd tftpy-0.5.1
 export PYTHONPATH=$PWD:$PYTHONPATH
 python bin/tftpy_server.py --root /path/to/firmware
If you are an experience Python user, you may use easy_install or pip as usual.