Blog

debian-logo

If you have an awesome Acme Systems Aria G25 board you can boot it with the provided Debian Squeeze distribution. If you want to upgrade to the new Wheezy you can follow my previous tutorial, but if you want to make your custom Debian Wheezy rootfs from scratch continue to reading and you can!

1. Prepare your development machine

To prepare your Aria G25 board you can use a Unix PC with the ARM cross compiler and the Qemu for ARM emulator. If you want use an Ubuntu PC you can follow this tutorial. In my case I want to use my Debian Wheezy PC virtualized using Parallels Desktop (or Vagrant) on my Mac. In this case use your terminal as root (on wheezy pc) to execute the follow steps:

root@acmedev64:~# echo deb http://www.emdebian.org/debian/ wheezy main >> /etc/apt/sources.list
  • Update the index of packages available on this new repository:
root@acmedev64:~# aptitude install emdebian-archive-keyring
root@acmedev64:~# aptitude update
  • Install the toolkit and other prerequisites
root@acmedev64:~# aptitude install libc6-armel-cross libc6-dev-armel-cross
root@acmedev64:~# aptitude install binutils-arm-linux-gnueabi
root@acmedev64:~# aptitude install gcc-4.7-arm-linux-gnueabi
root@acmedev64:~# aptitude install g++-4.7-arm-linux-gnueabi
root@acmedev64:~# aptitude install uboot-mkimage
root@acmedev64:~# aptitude install libncurses5-dev
root@acmedev64:~# aptitude install git bc curl
root@acmedev64:~# aptitude install debootstrap dpkg-dev

Note that I want use the debootstrap command instead the new multistrap due a bug into the installer of the wheezy armel packages related to the dash shell.

  • Install Qemu

The Qemu for ARM emulator is used to easy complete the deploying of the new rootfs without using the real hardware:

root@acmedev64:~# aptitude install qemu binfmt-support qemu-user-static dpkg-cross

Well: your developer PC is ready!

2. Prepare your rootfs

From your pc terminal type the follow commands:

root@acmedev64:~# mkdir armel-root
root@acmedev64:~# cd armel-root
root@acmedev64:/armel-root# debootstrap --foreign --arch armel wheezy .

Note the dot at the end of the line!

Now debootstrap download all basic packages. At the end of this step, type:

root@acmedev64:/armel-root# cp /usr/bin/qemu-arm-static usr/bin

This step is very important because when you enter in the new root using chroot, you can emulate the ARM architecture instead the host architecture (x64 in my emulated PC).

Now the first stage of debootstrap is completed and you can continue with the second stage:

root@acmedev64:/armel-root# LC_ALL=C LANGUAGE=C LANG=C chroot . /debootstrap/debootstrap --second-stage
root@acmedev64:/armel-root# LC_ALL=C LANGUAGE=C LANG=C chroot . dpkg --configure -a

The basic rootfs is ready: now it is necessary to complete the configuration and to add your needed packages.

3. Configure your rootfs

  • Add missing folders and file:
root@acmedev64:/armel-root# mkdir media/mmc_p1
root@acmedev64:/armel-root# mkdir media/data
root@acmedev64:/armel-root# mkdir -p lib/modules/3.10.0-rc3
root@acmedev64:/armel-root# touch lib/modules/3.10.0-rc3/modules.dep

Note that the folder 3.10.0-rc3 is the kernel version into the Aria board

  • Configure your new unix password
root@acmedev64:/armel-root# chroot . passwd
  • Configure your network
root@acmedev64:/armel-root# echo ariag25 > etc/hostname
root@acmedev64:/armel-root# echo nameserver 8.8.8.8 >> etc/resolv.conf
root@acmedev64:/armel-root# echo nameserver 8.8.4.4 >> etc/resolv.conf
root@acmedev64:/armel-root# echo deb http://ftp.it.debian.org/debian wheezy main > etc/apt/sources.list
root@acmedev64:/armel-root# echo deb-src http://ftp.it.debian.org/debian wheezy main >> etc/apt/sources.list
root@acmedev64:/armel-root# echo deb http://security.debian.org/ wheezy/updates main  >> etc/apt/sources.list
root@acmedev64:/armel-root# echo deb-src http://security.debian.org/ wheezy/updates main >> etc/apt/sources.list
root@acmedev64:/armel-root# echo auto eth0 >> etc/network/interfaces
root@acmedev64:/armel-root# echo allow-hotplug eth0 >> etc/network/interfaces
root@acmedev64:/armel-root# echo iface eth0 inet dhcp >> etc/network/interfaces
root@acmedev64:/armel-root# echo hwaddress ether 00:04:25:12:34:56 >> etc/network/interfaces

Note that the MAC address specified into the last command MUST be the same specified into the macaddr.txt file placed into the kernel partition of your SD card.

  • Enable the console on boot
root@acmedev64:/armel-root# echo T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt100 >> etc/inittab
  • Install your required packages
root@acmedev64:/armel-root# chroot . apt-get update
root@acmedev64:/armel-root# LC_ALL=C LANGUAGE=C LANG=C chroot . apt-get upgrade
root@acmedev64:/armel-root# LC_ALL=C LANGUAGE=C LANG=C chroot . apt-get install openssh-server
root@acmedev64:/armel-root# LC_ALL=C LANGUAGE=C LANG=C chroot . apt-get install dialog locales dpkg-dev
root@acmedev64:/armel-root# LC_ALL=C LANGUAGE=C LANG=C chroot . dpkg-reconfigure locales

Now you can select your desired locales and wait a while.

  • Edit your fstab

The last thing is the setting of the fstab. Open it:

root@acmedev64:/armel-root# nano etc/fstab

and customize as follow:

#Mount the fat16 partition where is located
#the Kernel image
/dev/mmcblk0p1 /media/mmc_p1 vfat noatime 0 1

#Mount the rootfs partition
/dev/mmcblk0p2 / ext4 noatime 0 1

#Mount the data partition
/dev/mmcblk0p3 /media/data ext4 noatime 0 1

#Enable the swap memory
#/dev/mmcblk0p4 none swap sw 0 0

proc /proc proc defaults 0 0

Save and exit.

  • Cleanup and deploy
root@acmedev64:/armel-root# rm usr/bin/qemu-arm-static

Now your armel-root contains your brand new rootf: copy all files into your rootfs partition of your SD card, put it into your Aria G25 board and boot it. Enjoy!

Obviously this is the right moment to update also your Linux Kernel to the new 3.10-rc3 release: follow at91bootstrap and linux kernel 3.xx tutorials to do it.

UPDATE: On GitHub you can download my script with all commands.




About Marcello Gesmundo

I'm the founder of Yoovant company. I'm an engineer and an artist: what could be better than combine the technologies with the arts?

4 Comment(s)
  1. Antonio February 26, 2014 at 23:18

    Sto riscontrando problemi di dipendenze con le seguenti due versioni:

    # aptitude install gcc-4.7-arm-linux-gnueab
    # aptitude install g++-4.7-arm-linux-gnueabi

    • Marcello Gesmundo February 27, 2014 at 06:59

      Hi Antonio,
      what dependencies are listed as unresolved? Do you have tried to install these dependencies before to try again to install gcc and g++?
      Regards.
      Marcello

      • Dids May 14, 2014 at 19:41

        I fixed the dependency problem by adding this repo instead:
        deb http://www.emdebian.org/debian/ unstable main

        And also by installing the following (hf versions):
        gcc-4.7-arm-linux-gnueabihf
        g++-4.7-arm-linux-gnueabihf

        In my case, I’m trying to create a Debian distro for Compulab’s Utilite Pro, so I’m only following some of the steps.

Leave a Reply to Dids Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>