Make a new filesystem on /dev/sda2 and mount it. Download the tarball from your FTP server, and unpack the minimal Debian image. Then <tt>chroot</tt> into it and complete the bootstrap process:

Make a new filesystem on /dev/sda2 and mount it. Download the tarball from your FTP server, and unpack the minimal Debian image. Then <tt>chroot</tt> into it and complete the bootstrap process:

mke2fs -j /dev/sda2

mke2fs -j /dev/sda2

−

mount /dev/sda2 /mnt/disk1

+

mount -t ext3 /dev/sda2 /mnt/disk1

cd /mnt/disk1

cd /mnt/disk1

wget ftp://ip.of.ftp.server/debian.tar.gz

wget ftp://ip.of.ftp.server/debian.tar.gz

Line 30:

Line 30:

chroot /mnt/disk1 /debootstrap/debootstrap --second-stage

chroot /mnt/disk1 /debootstrap/debootstrap --second-stage

−

You now have a full Debian system installed on your Linkstation. Don't reboot yet, though... we don't have a working system!

+

The last step may take a while, but you now have a full Debian system installed on your Linkstation. Don't reboot yet, though... we don't have a working system!

==Configure the system and install additional software==

==Configure the system and install additional software==

Revision as of 17:56, 31 May 2008

This article describes the procedure to install Debian on a Linkstation Pro or Kurobox Pro by creating a minimal installation on a Linux workstation and transferring it to a Linkstation. Access via serial cable is not required.

Contents

Prerequisites

To run this procedure you will need a computer with some form of Linux installed on it, preferably Debian or a variant of it such as Ubuntu. The CPU architecture isn't relevant, so if you have another Linkstation with Debian on it that will work fine. Before you start, you need to install two packages: debootstrap and some form of HTTP or FTP server. If you don't have a server installed, I recommend vsftpd.

For these instructions to work your Pro you must be running at least a 2.6.16 kernel, or else the chroot command will not work. I recommend using the latest upstream Linux kernel instead of a Buffalo or Marvell modified one; you can follow these instructions to install a recent one. It is a good idea to adjust the size of your partitions before following this procedure, as the /dev/sda2 partition is very small by default. I suggest making it at least 5 GB. You also need to be using a modified initrd in order to boot the custom distribution.

Create the Stage 1 image

On your Linux workstation, pick a directory that you will stage the Debian install in. For my example I will use /tmp/debian. Become root and use debootstrap to create a minimal Debian installation in this directory:

Unpack the image and complete the debootstrap process

Now boot your Pro in EM mode and telnet to it. I'm assuming that you want to overwrite the installed system on /dev/sda2. If that's not what you want, don't run the mkfs command. Instead, choose another directory to install to.

I use the ext3 filesystem for this example because it's very likely that your kernel has support for it. If you'd like to use a different filesystem, it's up to you to determine whether the kernel you're using supports it.

Make a new filesystem on /dev/sda2 and mount it. Download the tarball from your FTP server, and unpack the minimal Debian image. Then chroot into it and complete the bootstrap process:

The last step may take a while, but you now have a full Debian system installed on your Linkstation. Don't reboot yet, though... we don't have a working system!

Configure the system and install additional software

There are two files that need to be configured before the system will run correctly, /etc/fstab and /etc/network/interfaces. The first describes the layout of filesystems on your disk; the second, as the name implies, configures network interfaces.

You can use chroot to enter the system and modify the configuration files:

/srv is the location recommended by the FHS for data stored on the system by and for services such as FTP and Samba. Your partition may be formatted as XFS; if this is the case I recommend changing it to ext3, as XFS has known bugs on the ARM9 platform.

This /etc/network/interfaces will bring up the network device using DHCP.

auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp

You also need to install micro_evtd, which keeps the watchdog timer in the LS Pro happy, adjusts the fan speed for you, and such. The binaries and configuration files for micro_evtd are provided by lb_worm and stored in the downloads area.