User Tools

Site Tools


debian_install

This is an old revision of the document!


Install Debian on a LaCie NAS (Kirkwood based) using the Debian installer

Introduction

This page details step by step how to install a Debian system on a LaCie NAS (Kirkwood based), using the Debian installer. The network-console images allows to perform a completely remote full installation. This means that there is no needs to open the case nor to plug a serial wire.

Note that this howto is only relevant for the LaCie boards supported by the Debian kernel. To check if your board is well supported, please refer this device array. All the Linux mainlined boards are also supported by the Debian kernel.

Configure U-Boot

For more informations about U-Boot on LaCie NASes, please see this page.

Update U-Boot to mainline

As a requirement, you must be able to modify the U-Boot environment. With some of the LaCie stock versions (the oldest), some supposed critical variables (as 'bootcmd') are protected. At boot time, the LaCie U-Boot overrides the environment values with some hard-coded ones. To check that, simply try to set and save the 'bootcmd' variable. After a reset, you must be able to retrieve your changes.

If you are not allowed to configure the environment, you must update U-Boot to the mainline version. Please, refer to this howto.

Setup the U-Boot environment

To run a Debian system, U-Boot must be able to load the files uImage and uInitrd from the /boot partition. Some U-Boot environment variables must be modified. For example, if you intend to store the /boot files into the first partition (default behaviour for the Debian installer), you could run the following commands:

ns2> set diskload "ide reset && ext2load ide 0:1 0x800000 uImage && ext2load ide 0:1 0x1200000 uInitrd"
ns2> print diskload bootcmd
diskload=ide reset && ext2load ide 0:1 0x800000 uImage && ext2load ide 0:1 0x1200000 uInitrd
bootcmd=dhcp && run netconsole; if run usbload || run diskload; then bootm 0x800000 0x1200000; fi
ns2> saveenv
Saving Environment to SPI Flash...
Erasing SPI flash...Writing to SPI flash...done

Run the Debian installer

Download installer images

Download the network-console Debian installer files from our FTP server. Note that you could get this files from Debian. As a difference, the lacie-nas.org version provides preseed answers for the Debian installer. This allows to configure network and SSH server without any human action. For more informations about preseeding, please refer to this wiki page.

Load installer images

At your convenience, you could load the network-console image over network or from an USB disk. Both methods are described here.

From an USB disk

ns2> usb reset
ns2> fatload usb 0:1 0x800000 uImage
ns2> fatload usb 0:1 0x1200000 uInitrd

From network via a TFTP server

  • On a you development machine, setup a TFTP server and put the network-console files into the exported directory.
  • Connect to the U-Boot netconsole and load network-console files with the following commands (replace $TFTP_SERVER_IP with your TFTP server IP address):
ns2> set serverip $TFTP_SERVER_IP
ns2> tftp 0x800000 debian-installer/kirkwood/network-console/lacie/uImage
Using egiga0 device
TFTP from server 192.168.0.16; our IP address is 192.168.0.15
Filename 'debian-installer/kirkwood/network-console/lacie/uImage'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         ################################################
done
Bytes transferred = 1574768 (180770 hex)
ns2> tftp 0x1200000 debian-installer/kirkwood/network-console/lacie/uInitrd
Using egiga0 device
TFTP from server 192.168.0.16; our IP address is 192.168.0.15
Filename 'debian-installer/kirkwood/network-console/lacie/uInitrd'.
Load address: 0x1200000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###############################################################
done
Bytes transferred = 4976913 (4bf111 hex)

Boot the Debian network installer

When both images are loaded, the network installer can be booted with 'bootm 0x800000 0x1200000'.

ns2> bootm 0x800000 0x1200000
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Debian kernel
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1574704 Bytes = 1.5 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01200000 ...
   Image Name:   debian-installer ramdisk
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    4976849 Bytes = 4.7 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Log into the Debian installer

To log into the Debian installer, you need to guess the NAS IP. This IP should be the same as the one given by the DHCP server to the U-Boot system. To confirm, you can use an utility like dhcpdump:

$ sudo dhcpdump -i eth0
...
OPTION:  50 (  4) Request IP address        192.168.0.15
...

Once the NAS front LED turns red, you should be able to log into the Debian installer. The password is lacie.

$ ssh installer@192.168.0.15
The authenticity of host '192.168.0.15 (192.168.0.15)' can't be established.
RSA key fingerprint is 96:4c:b3:d7:b9:26:5d:da:fa:52:d3:74:69:50:e1:2b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.15' (RSA) to the list of known hosts.
installer@192.168.0.15's password:

At this point, you should see this screen:

network-console first screen

Complete the installation

Simply, follow the Debian installer path… IThe installer could fail to make the system bootable, how to solve this is described at the section troubleshooting.

Run the Debian system

  • Log into the Debian system via SSH:
~$ ssh root@$NAS_IP
root@192.168.0.15's password: 
Linux unassigned-hostname 3.2.0-2-kirkwood #1 Mon Apr 16 12:58:57 UTC 2012 armv5tel

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon May  7 01:32:59 2012
  • For the preseeding purpose, the hostname has been set to 'unassigned-domain'. You may want to change this default hostname. As root, run the following command:
root@unassigned-hostname:~# echo $MY_NAS_NAME > /etc/hostname

Troubleshooting

The system is not bootable

The Debian installer may fail to make the system bootable:

system not bootable screen

It is because the flash-kernel package is not up to date. You must update this package with the lacie-nas.org version. First, you must exit out of the Debian installer. In the 'Debian installer main menu', select 'Execute a shell'.

  • From the installer shell, chroot into the target system:
~ # mount -t proc proc /target/proc/
~ # mount -t sysfs sysfs /target/sys/
~ # chroot /target /bin/bash
  • Add the lacie-nas.org Debian repository to the apt source list:
root@unassigned-hostname:/# cat >> /etc/apt/sources.list <<EOF
> 
> deb ftp://lacie-nas.org/debian/ sid main
> deb-src ftp://lacie-nas.org/debian/ sid main
> EOF
  • Import lacie-nas.org GPK key:
gpg --keyserver pgpkeys.mit.edu --recv-key 0E3D4C9F7C71B58C
gpg -a --export 0E3D4C9F7C71B58C | apt-key add -
  • Reinstall the flash-kernel package:
root@unassigned-hostname:/# apt-get update
root@unassigned-hostname:/# apt-get install flash-kernel
Reading package lists... Done
  • Install the u-boot-tools package:
root@unassigned-hostname:/# apt-get install u-boot-tools

<note important>The u-boot-tools package installation should have been triggered by the flash-kernel package postinstall scripts. For an unknown reason, it is not the case. To be investigate…</note>

  • And finally, reinstall the linux-image package:
root@unassigned-hostname:/# apt-get install --reinstall linux-image-3.2.0-2-kirkwood
...
flash-kernel: installing version 3.2.0-2-kirkwood
Generating kernel u-boot image... done.
Installing new uImage.
Generating initramfs u-boot image... done.
Installing new uInitrd.
  • Exit the shell and restart the Debian installer:
root@unassigned-hostname:/# exit
~ # umount /target/sys/
~ # umount /target/proc/
~ # exit
  • From the 'Debian installer main menu', select 'Make the system bootable'. Now, this step should succeed.
debian_install.1337246327.txt.gz · Last modified: 2012/05/17 11:18 by 83.163.254.51