Embedded Debian (Emdebian) is essentially a standard Debian distribution optimised for size. This article illustrates how to build an Emdebian Wheezy Grip 3.0 (based on Debian 7.2 "wheezy") root filesystem for the Acme boards.
Embedded Debian is available in different flavours. Embebian/Grip is one of these, read these articles to know more about them:
Install the required packages on your Ubuntu Linux PC (Tested on Ubuntu 13.10):
~$ sudo apt-get install multistrap ~$ sudo apt-get install qemu ~$ sudo apt-get install qemu-user-static ~$ sudo apt-get install binfmt-support ~$ sudo apt-get install dpkg-cross
"Multistrap is a tool that automates the creation of complete, bootable, root filesystems. It can merge packages from different repositories to make the rootfs. Extra packages are added to the rootfs simply by listing them - all dependencies are taken care of. Current development in multistrap is to support user-specified scripts being added as hooks during the unpacking phase to add customised startup scripts and configure things like device nodes".
Create a working directory
~$ mkdir emdebian ~$ cd emdebian ~/emdebian$
Create or download a file called multistrap.conf with the following contents:
[General] arch=armel directory=target-rootfs cleanup=true noauth=true unpack=true debootstrap=Emdebian Net Utils Python aptsources=Emdebian [Emdebian] packages=apt source=http://www.emdebian.org/grip keyring=emdebian-archive-keyring suite=wheezy-grip [Net] #Basic packages to enable the networking packages=netbase net-tools ethtool udev iproute iputils-ping ifupdown isc-dhcp-client ssh source=http://www.emdebian.org/grip [Utils] #General purpose utilities packages=locales adduser nano less wget vim rsyslog dialog source=http://www.emdebian.org/grip #Python language [Python] packages=python python-serial source=http://www.emdebian.org/grip |
Read Multistrap man page to understand each directive meanings.
You can add or remove packages changing the "packages=" or adding new sections on "debootstrap=" line.
For example if you need to install the Apache http server and the PHP language add this section in multistrap.conf:
[Php] packages=php5 apache2 source=http://www.emdebian.org/grip
and add the new section on this line:
debootstrap=Emdebian Net Utils Python Php
In this example we are using the Italian Debian repository http://ftp.it.debian.org/debian so to use your local Debian repository change .it. with your country ISO code (for example .uk., etc).
Note that not all the packages are available in the Emdebian-Grip repository so you need to download them from the standard Wheezy Debian repository in this case the section will become something like this:
[Php] packages=php5 apache2 source=http://ftp.it.debian.org/debian suite=wheezy
Note that you can install more packages directly on the target using apt-get command.
When your multistrap.conf file is ready launch Multistrap:
~/emdebian$ sudo multistrap -f multistrap.conf ... Multistrap system installed successfully in /home/.../emdebian/target_rootfs/.
At the end of this procedure the directory target-rootfs directory will contents the whole rootfs tree to be moved into the second partition of an Acme board bootable microSD.
Configure now the EmDebian packages using the armel CPU emulator QEMU and chroot to create a jail where dpkg will see the target-rootfs as its root (/) directory.
~/emdebian$ sudo cp /usr/bin/qemu-arm-static target-rootfs/usr/bin ~/emdebian$ sudo LC_ALL=C LANGUAGE=C LANG=C chroot target-rootfs dpkg --configure -a
At this prompt:
Reply with < No >.
Some other prompt will appear during the configuration. Reply to them as you like.
When finished the target rootfs will be almost ready to be moved on the target microSD but it still needs some last extra configuration before using it.
Create a command file like this:
#!/bin/sh #Target directory where will be createt the next target #rootfs TARGET_ROOTFS_DIR="target-rootfs" #Directories used to mount some microSD partitions echo "Create mount directories" mkdir $TARGET_ROOTFS_DIR/media/mmc_p1 mkdir $TARGET_ROOTFS_DIR/media/data #Set the target board hostname filename=$TARGET_ROOTFS_DIR/etc/hostname echo Creating $filename echo ariag25 > $filename #Set the defalt name server filename=$TARGET_ROOTFS_DIR/etc/resolv.conf echo Creating $filename echo nameserver 8.8.8.8 > $filename echo nameserver 8.8.4.4 >> $filename #Set the default network interfaces filename=$TARGET_ROOTFS_DIR/etc/network/interfaces echo Updating $filename echo allow-hotplug eth0 >> $filename echo iface eth0 inet dhcp >> $filename #Set the eth0 interface MAC address echo hwaddress ether 00:04:25:12:34:56 >> $filename #Set a terminal to the debug port filename=$TARGET_ROOTFS_DIR/etc/inittab echo Updating $filename echo T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt100 >> $filename #Set how to mount the microSD partitions filename=$TARGET_ROOTFS_DIR/etc/fstab echo Creating $filename echo /dev/mmcblk0p1 /media/mmc_p1 vfat noatime 0 1 > $filename echo /dev/mmcblk0p2 / ext4 noatime 0 1 >> $filename echo /dev/mmcblk0p3 /media/data ext4 noatime 0 1 >> $filename echo proc /proc proc defaults 0 0 >> $filename #Add the standard Debian repositories. In this way it is possible #to install packages not included in the Emdebian/Grip repositories filename=$TARGET_ROOTFS_DIR/etc/apt/sources.list echo Creating $filename echo deb http://ftp.it.debian.org/debian wheezy main > $filename echo deb http://security.debian.org/ wheezy/updates main >> $filename #Add the standard Debian non-free repositories useful to load #closed source firmware (i.e. WiFi dongle firmware) echo deb http://http.debian.net/debian/ wheezy main contrib non-free >> $filename |
or download it from here: acmeconfig.sh. This file contains some initial setup for you new environment.
~/emdebian$ sudo chmod +x acmeconfig.sh ~/emdebian$ sudo ./acmeconfig.sh
then create the target root login password:
~/emdebian$ sudo chroot target-rootfs passwd Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
At this point you can upgrade Debian to the latest version (7.2) by typing:
~/emdebian$ sudo LC_ALL=C LANGUAGE=C LANG=C chroot target-rootfs apt-get update ~/emdebian$ sudo LC_ALL=C LANGUAGE=C LANG=C chroot target-rootfs apt-get upgrade ~/emdebian$ sudo LC_ALL=C LANGUAGE=C LANG=C chroot target-rootfs apt-get clean
In the same way you add packages:
~/emdebian$ sudo LC_ALL=C LANGUAGE=C LANG=C chroot target-rootfs apt-get packagename
Please nore that will be possible to add packages also directly on the target board. In than case the command will be simply:
# apt-get packagename
then remove the qemu-arm-static executable:
Remove this file from the rootfs contents:
~/emdebian$ sudo rm target-rootfs/usr/bin/qemu-arm-static
then format a new microSD.
Mount the microSD on your Ubuntu Linux PC and copy all the target-rootfs contents in the second microSD partition mounted on /media/$USER/rootfs.
If you are using an Ubuntu release older than 13.10 remove $USER in the path
~/emdebian$ sudo rsync -axHAX --progress target-rootfs/ /media/$USER/rootfs/
Unmount the microSD, insert it in your board, insert the DPI cable to see the Kernel bootstrap messages and boot.
|
Atmel© Certified Partner |
Documentation Terms of Use
Acme Systems provides this documentation "as is" without warranty or guarantees of any kind.
The mantainer of this site (Sergio Tanzilli), has gone to a great deal
of effort into making this documentation as correct as possible.
Acme Systems doesn't provide any direct support for the Open Source preinstalled software but provides, through
these pages and forum posts, all the information required to obtain the sources, install, use and update the
Open Source softwares runnable on the FOX Board, NetusG20, AriaG25 and Terra platforms.
Please note that all the preinstalled softwares, used on the Acme Systems products, are Open Source and you will
have to check the license terms provided (usually the GPL) by each author before using it in any commercial or non-commercial
product, by yourself.
Before sending emails or calling the Acme staff here are our contacts
please note that WE ARE MAINLY HARDWARE DESIGNERS and NOT LINUX GURUS so could be better to post
your questions directly to the forum listed below to be sure that all the contributors of this site and
the large software developers community will read and reply to your questions.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.