This method doesn't work without modifications on firmware 3.24 and newer, because usb_key_func.sh is only called from FAT formatted sticks.
What it is
This is a Debian distro (Lenny) which will run completely from usbstick, putting aside the firmware. The firmware is untouched, when you remove the stick and reboot, the box will happily run the firmware again.
It is possible to install Lenny on harddisk, but you'll need the usbstick as bootloader.
How to install
- Download the package here.
- Format an usbstick (at least 256MB) ext2 or ext3 (no reiserfs). You can do this using the webinterface, using the Create External Volume button.
- Extract the package, and put the contents on the stick. Users of firmware 2.20 or older will have to rename nsa220_check_file.fw220_and_older to nsa220_check_file.
- The stick should (at least) contain
- nsa220_check_file
- usb_key_func.sh
- usb_key_func.salted_md5sum
- extract_me.tgz
- Plug the stick in the NAS, and reboot the box.
The box will use DHCP to get an IP address. Maybe the webinterface of your router can tell you which ip address is assigned. If you want a static address you'll have to edit /etc/network/interfaces (I have put an example of a static address inside.)
The default MAC address is 12:34:56:78:9a:bc. When you want another one, again, edit /etc/network/interfaces
The box is running a telnet server. There is one user configured, root with password root.
I suggest you to install sshd, and remove telnetd, when ssh has proven to work:
Code: Select all
apt-get update
apt-get install openssh-server
apt-get remove telnetd
Code: Select all
apt-get update
apt-get install mdadm
Code: Select all
modprobe reiserfs
# let it load at boot:
echo reiserfs >>/etc/modules
Code: Select all
apt-get update
apt-get install samba
apt-get install nfs-kernel-server
How to install on harddisk
The file /boot/reload.sh creates the commandline, which is read by initramfs to mount the rootfilesystem. To boot from the raidarray, extract extract_me.tgz in /mnt/md0, and edit /boot/reload.sh (on the stick)
Code: Select all
<snip>
echo Generate commandline...
# in case you want to boot from the usbstick
# CMDLINE="root=${USBDEVICE} rw"
# in case you want to boot from an raidarray
CMDLINE="root=/dev/md0 rw md=0,/dev/sda2,/dev/sdb2"
The kernel doesn't support reiserfs, so if your harddisk is formatted reiserfs, initramfs will have to load a kernelmodule before it can mount the disk. This is currently not supported.
How it works
usb_key_func.sh is used to let the firmware start Lenny.
A modified version of fonz' reloaded.ko is used to reboot the box, with a new kernel, an initramfs and a modified commandline. This kernel boots Lenny. The firmware kernel cannot run Lenny due to wrong kernel configuration.
Known issues
You can't use the powerbutton to shutdown. Instead open a shell and use the 'halt' command.
The kernel only works after a reboot. Because of that /boot/reload.sh will first reboot the box before it reloads the kernel. /boot/reload.status is used to keep track of this.
Disclaimer
As far as I know this hack is harmless for your hardware and data. But I do not take any responsibility for damage caused by this software.
Use at own risk