XMLTagsEditHistoryDiscussion

  1. Creating the sid file-system
    1. Debootstrap
    2. Creating important files
    3. Doing the chroot
    4. Copying the image to its final destination
  2. Beyond this document
  3. References

IMPORTANT:

Please read re-install debian in the ecb_at91 if you just need to run Debian GNU/Linux in the board. This is the easiest way to do it.

Read on if you want to debootstrap your own image.

Creating the sid file-system

Debootstrap

We use debootstrap 0.3.3.3, available in Debian sid. Thanks to Maarten Reekmans for this tip.

In the build host, we do:

  debootstrap --verbose --foreign --arch arm sid ./sid   http://ftp.at.debian.org/debian

Note that not all mirrors host the ARM port of Debian. The foreign option halts the debootstrap process before the chroot (foreign means it's building for another host system).

The next step is getting the result of debootstrap onto the ARM board. We copy the generated directory so that we can see it when we boot the ARM board (via NFS, USB, SD). Then you boot the board, and start the second stage.

 chroot sid
 /debootstrap/debootstrap --second-stage

Wait about 30min and your debian system will be installed. If debootstrap succeeds, the last line it prints will be:

 I: Base system installed successfully

Creating important files

 echo "127.0.0.1 localhost.localdomain localhost" > sid/etc/hosts
 cp /etc/resolv.conf sid/etc/resolv.conf
 cp /etc/network/interfaces sid/etc/network/interfaces
 echo ecb_at91 > sid/etc/hostname
 # We will use the same kernel, thus we copy the modules
 cp  -a /lib/modules/* sid/lib/modules

We create a valid sid/etc/fstab file:

/dev/mmcblk0p1       /          reiserfs   defaults              0 1
proc                 /proc      proc       defaults              0 0
devpts               /dev/pts   devpts     mode=0620,gid=5       0 0

We edit the sid/etc/inittab file and disable the tty[1-6] entries by prefixing the entries with "#". Then we add the following serial console entry:

 T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100

We modify sid/etc/apt/sources.list to read:

 deb http://ftp.at.debian.org/debian unstable main non-free contrib

Also do:

 echo LANG=\"C\" >> sid/etc/environment

Doing the chroot

Don't forget to update the local time before doing the chroot, since GPG checks will fail if you are way in the past.

 rdate time.nist.gov
 mount -t proc proc sid/proc/
 chroot sid /bin/bash --login
 # Be sure that you are in the chroot now
 # You don't want to be confused here...
 export PS1="\h(CHROOT):\w\$"

Now let's prepare apt.

  apt-get update

Then finish the installation. We think it's OK to add the popularity-contest package since it helps us know how the ARM port is becoming popular.

 apt-get -y install anacron popularity-contest

Now configure passwd and do enable the shadow passwords when asked:

  dpkg-reconfigure passwd

Now install the SSH server.

apt-get -y install openssh-server 

Then install the locales.

When we select the correct timezone:

  tzconfig

Now you can exit the chroot.

  exit
  umount  sid/proc/

Copying the image to its final destination

Now, we need to configure the newly created Debian system, that lives inside of the directory sid. We copy the new image in a SD card. Then we boot it.

Beyond this document

email us if you need to install Debian GNU/Linux and you need an image.

References

Last update: 2007-06-10 (Rev 337)

svnwiki $Rev: 12966 $