Debian Linux on AirLive WMU-6000FS

Polska wersja

This page describes briefly how to setup Debian on Airlive (OvisLink) WMU-6000FS NAS.

Note that the sources and binaries on this page are distributed in hope that they will be useful, but WITHOUT ANY WARRANTY.

Contents

Alternative firmware

The first thing to perform is flashing of alternative firmware on the device. The alternative firmware is based on manufacturer's firmware version c3. It has a few changes to the original, namely: Actually there are two firmware versions, having differing effects in the last point. Firmware version A works as described. Firmware version B works reverse, i.e. it boots from hard drive by default. Starting from firmware occurs only when the "Backup" button is hold during boot.

Firmware version A
Firmware version B

Creating disk partitions

Log on to AirLive using telnet. Unmount all mounted hard drive partitions:
    for i in /tmp/mnt/? /tmp/share/?; do umount $i; done
Go to directory /tmp, download file tools.tar.gz and unpack it:
    cd /tmp
    wget http://rafald.neostrada.pl/hacking-airlive/tools.tar.gz
    tar xzf tools.tar.gz
The package contains four files: fdisk, mke2fs, embed, and minigrub.img. Use fdisk to prepare the Debian root partition. The partition should have at least 1 GB. It would be good to prepare also a swap partition.

Next, create ext3 filesystem on the prepared partition. If the partition is on /dev/hda1, invoke:

    /tmp/mke2fs -j /dev/hda1

Mini-grub

The next step is to install the boot loader on the hard drive. We will use a mini-grub as the boot loader. It is a boot loader based on GNU GRUB, adopted to the device. It should be embedded using embed program included in tools.tar.gz archive. The program should be invoked with three parameters:
  1. The minigrub.img file pathname
  2. Hard drive device on which to install the mini-grub
  3. Partition number with /boot/grub/menu.lst file. Like in grub, partition numbers are counted from 0. For example, partition /dev/hda1 has numer 0 and partition e.g. /dev/hda7 has number 6.
If the prepared Debian root partition is on /dev/hda1, invoke the tool as follows:
        /tmp/embed /tmp/minigrub.img /dev/hda 0
    
Note: mini-grub may work incorrectly with hard drivers greater than 137 GB.

Moving system to hard drive

Assume we want to move the system from firmware to /dev/hda1 and prepare /dev/hda2 for Debian. First, copy whole filesystem from firmware drive to /dev/hda1:
mkdir /tmp/deb
mount -t ext2 /dev/hda1 /tmp/deb
cd /tmp/deb
cp -a /bin /dev /etc /home /lib /libexec /linuxrc /mnt /root /sbin /share /usr /var .
mkdir proc tmp
cd /
umount /tmp/deb
Now, we have to install Linux kernel, which will be loaded by mini-grub. The best would be to keep the kernel image in /boot directory of Debian system, together with all remaining kernel images and other mini-grub files.
mount -t ext3 /dev/hda2 /tmp/deb
cd /tmp/deb
wget http://rafald.neostrada.pl/hacking-airlive/boot-2.4.28.tar.gz
tar xzf boot-2.4.28.tar.gz
rm boot-2.4.28.tar.gz

Archive contains /boot subdirectory. If the partition, which the system is moved to, is not /dev/hda1, then in file boot/grub/menu.lst replace second 0 occurrence in (hd0,0) with appropriate partition number. Also /dev/hda1 change to apropriate partition number. Haven't you editor? Try vi from busybox.

Unmount partition and reboot.
cd /
umount /tmp/deb
reboot
Hold "backup" button (unless we have firmware in version B). The system from hard drive should be loaded.

Linux kernel 2.6 installation

If we want to have kernel 2.6, take linux-2.6.29.tar.gz and unpack it on partition containing boot directory. Next, add the following entry in file boot/grub/menu.lst:
title		kernel 2.6.29, root /dev/hda1, no initrd
root		(hd0,1)
kernel		/boot/vmlinuz-2.6.29 root=/dev/hda1 it821x.noraid=1 rw
Of course, /dev/hda1 and (hd0,1) should be set appropriately.

After reboot, choose this entry in mini-grub "menu"

Own kernel compilation

Linux kernel 2.6.29 needs the patch. Example of linux kernel config for OvisLink is here.

Debian installation

Up to prepare Debian installation, you need a PC with Debian or other Debian-based distribution, like Ubuntu. On the PC create an empty directory and run debootstrap tool. Let's name the empty directory debian-root. Invoke:

    sudo debootstrap --arch=i386 squeeze debian-root http://ftp.pl.debian.org/debian
The above command creates in the directory system squeeze. This means, Linux started with root partition containing the directory contents is Debian squeeze. But, before copy of the directory contents to Airlive, we have to perform a few modifications.

Edit debian-root/etc/fstab file. This file should contain information about partitions: root, swap and proc. Something like:

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc 		/proc		proc	defaults	0	0
/dev/hda2	/		ext3	defaults	0	1
/dev/hda3	none		swap	sw		0	0
When finish, go to sub-directory debian-root/etc/network. In file interfaces add:
auto lo
iface lo inet loopback

allow-hotplug eth1
iface eth1 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        hwaddress ether 00:11:22:33:44:55
Instead of 192.168.0.1 enter some address from our network. Also, instead of 00:11:22:33:44:55 enter appropriate MAC adress of eth1 interface. We can get the MAC address after logon to OvisLink by run ifconfig command.

We should also install a telnet, ssh, rsh or similar server. Otherwise we will be unable to logon to AirLive. Let's be a telnet server. We can install it by:

    sudo chroot debian-root apt-get install telnetd
For all possible apt-get questions we answer positive.

We have also to create an user accout. Let's be "airlive":

    sudo chroot debian-root adduser airlive
Also, it would be useful to set root password:
    sudo chroot debian-root passwd
We have also to generate initrd file. Unpack in debian-root directory the Linux kernel - file linux-2.6.29.tar.gz, and run:
    sudo chroot debian-root apt-get install initramfs-tools
    sudo chroot debian-root update-initramfs -c -k 2.6.29
When finish with all changes, pack the debian-root directory contents:
    cd debian-root
    sudo tar cf ../root.tar *
On OvisLink machine, mount our Debian partition in a temporary directory:
    mkdir /tmp/deb
    mount -t ext2 /dev/hda1 /tmp/deb
Next, load root.tar file to /tmp/deb directory on OvisLink. Unpack it and then delete:
    cd /tmp/deb
    tar xf root.tar
    rm root.tar
In boot/grub/menu.lst file add:
title       Debian 2.6.29, initrd 2.6.29
root        (hd0,1)
kernel      /boot/vmlinuz-2.6.29 root=/dev/hda2 it821x.noraid=1 ro
initrd      /boot/initrd.img-2.6.29
If our partition is other than /dev/hda2, change it, and (hd0,1), appropriately.

We have finished. Now, we can unmount partition and restart system:

    cd /
    umount /tmp/deb
    reboot

Logging on to the new system

If you have firmware A, hold "Backup" button at reboot. You may release it when some of the four left LEDs dim. Wait until the system finishes to boot (it may take a minute or two). Log in using telnet, as airlive, password airlive. Root shell you may obtain using su command, password is airlive. You may change password using passwd command. A new user may be added using adduser command. New packages may be installed using apt-get command. Hacking MGB100
Linux Devices
GPL firmware
GPL toolchain
Sources