Installing Debian on the Kurobox Pro
by Per Andersson and Martin Michlmayr
In a nutshell, the installation of Debian works like this: you partition
the disk that you will use in the device with ext2
and put the installer
images on that disk and run a script which effectively will change the
environment for the u-boot boot loader so that it boots from disk rather
than flash. When you restart your device, the Debian installer starts and
allows you to login via SSH to perform the installation. Debian will then
be installed to disk.
Following this procedure, Debian will be installed to your SATA disk. The Buffalo firmware will remain untouched in flash memory. If you want to use the Buffalo firmware again, all you have to do is to change the u-boot environment and tell it to boot from flash.
Requirements and Preparation
In order to install Debian on a Kurobox Pro, you need the following:
- A Kurobox Pro, obviously.
- An internal SATA disk in the device.
- A network connection.
- Another machine on which you have an SSH and a telnet client.
Making a Backup
You have to make a backup of all the data stored on your disk before starting with the installation of Debian since the whole disk will be formatted during the installation.
Starting the Installer
Start your Kurobox Pro and let it boot into the Buffalo firmware. You'll hear a short melody when you turn on the device and after about a minute you'll here another short beep. You can now connect to your device with telnet:
telnet 192.168.11.150
You have to replace 192.168.11.150
with the actual IP address of your
device. Use root
as login name and kuroadmin
as password.
First of all, you have to change the way the Buffalo firmware does name
resolution. By default the original firmware only resolves names based on
files (in this case /etc/hosts). To be able to utilize name servers (DNS)
you will have to change this behaviour. This is done by altering the file
/etc/nsswitch.conf
and changing the default line
hosts: files
to
hosts: files dns
This change can be done with the following command:
echo "hosts: files dns" > /etc/nsswitch.conf
Now that you have DNS working, you can set the system clock based on a time server on the Internet. On new Kurobox Pro devices, the system clock is not set properly, which can cause problems later. Issue the following two commands in order to obtain the current time from a time server:
rdate -s pool.ntp.org hwclock -w
Now we can actually start to prepare the disk for the installer. First you have to partition the hard disk so the installer image can be stored on the disk. For now, we just need a small partition to store the installer. The disk will be partitioned again during the actual installation, so don't worry about partitioning for now. Let's make a 256 MB partition:
fdisk /dev/sda Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-19457, default 1):press return Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457): +256M w
Now format the hard disk with the ext2
filesystem:
mkfs.ext2 /dev/sda1
Next mount the newly created file system and change the directory to where you mounted it.
mount -t ext2 /dev/sda1 /mnt/disk1 cd /mnt/disk1
Now you can download the Debian installer images from the web using the
wget
command:
wget http://ftp.nl.debian.org/debian/dists/stable/main/installer-armel/current/images/orion5x/network-console/buffalo/kuroboxpro/config-debian wget http://ftp.nl.debian.org/debian/dists/stable/main/installer-armel/current/images/orion5x/network-console/buffalo/kuroboxpro/initrd.buffalo wget http://ftp.nl.debian.org/debian/dists/stable/main/installer-armel/current/images/orion5x/network-console/buffalo/kuroboxpro/uImage.buffalo
This will download the Debian kernel, the installer ramdisk and a script to configure the u-boot environment. Finally, you can run the script by executing the following command:
sh config-debian
When the command has completed, you should make a copy of ubootenv.bak
to
a USB stick (rather than to the hard drive since the installation of Debian
will format the disk again). Apparently the Buffalo firmware doesn't
include the VFAT module, so you have to create the ext2
filesystem on
your USB stick. In addition to making a copy of ubootenv.bak
(a copy of
the u-boot configuration environment before we modified it), you should
make a copy of /dev/mtdblock1
. This is the flash partition where the
kernel is stored. While the installation of Debian won't modify the flash
content, a copy of the kernel may come in handy if you have to use the recovery mode. Follow these steps to make the
backup:
mount -t ext2 /dev/sdb1 /mnt/usbdisk1 cp ubootenv.bak /mnt/usbdisk1 cat /dev/mtdblock1 > /mnt/usbdisk1/mtd1 umount /mnt/usbdisk1
When the command has completed, you can shut down or reboot your device. The next time you power it on again, the Debian installer will start.
The Installation
After you have put the installer images on hard disk, configured u-boot to boot from the hard disk and restarted your device, the Debian installer will start. Since the Kurobox Pro doesn't have any IO device, SSH will be used for the installation. The installer will bring up the network, start the OpenSSH server and you can then connect to the device using SSH. You have to wait a few minutes after starting the system before you can connect. While the installer is setting up the network and starting SSH, the power LED will blink. When the installer is ready and you can login via SSH, the power LED will become solid and you'll hear a short beep.
Since the Kurobox doesn't have a LCD display, the installer cannot tell you which IP address to connect to or which password to use. With regards to the IP address, the following strategy is used:
- If your original Buffalo firmware is configured to use DHCP (the default from Buffalo firmware), Debian installer will try to acquire an IP address with DHCP. You can use the MAC address of your device to tell your DHCP server to give out a specific IP address to your machine.
- If you configured a static address in your Buffalo firmware, this configuration will be used. However, if your network configuration was incomplete (e.g. IP address or DNS were missing), the installer will use DHCP instead.
- If DHCP is used but your DHCP server does not respond, the device will
use the fallback address
192.168.11.150
. If you are unsure what the address of your device is, unplug the Ethernet cable, start the machine again, wait until Debian installer is ready for SSH and then plug the cable back in and connect to this fallback address.
Please make sure that the device is on a local network to which only you
have access since the installer uses a very generic password, namely
install
. The user is installer
. Connect to the installer (again,
replace the address in the example with the actual IP address of your
device):
ssh installer@192.168.11.150
The installation should be pretty standard and you can follow the installation guide. The
installer knows about the Kurobox Pro and at the end of the installation it
install a kernel and ramdisk that will automatically boot Debian. It will
also install the micro-evtd
package that can be used to control the fan,
LEDs, buzzer and buttons on your device.
The only thing to consider is the partition layout of your disk. Since we
configured the Kurobox Pro to boot from disk, you have to make sure that
the first primary partition of your disk is the /boot
partition, that the
bootable flag is set for this partition and that is uses the ext2
filesystem. Again, the installer knows about these requirements and if you
use guided partitioning it will automatically create an appropriate
partition layout. Please note that the partitioner will default to Guided
- use the largest continuous free space
, but in most cases you want to
choose Guided - use entire disk
.
When you get confirmation that the installation has finished, confirm and wait for the installer to finish. Once your SSH session terminates, wait a few minutes before you can connect to your newly installed system via SSH. You will be able to log in as your newly created user.
Success
You should now have a complete Debian system running on your device. You
can use apt
and other tools to install additional software. The
Kurobox Pro is an ARM based device and the armel
architecture is fully
supported by Debian.