
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://armadeus.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=VincentB</id>
		<title>ArmadeusWiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://armadeus.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=VincentB"/>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=Special:Contributions/VincentB"/>
		<updated>2026-04-05T20:04:19Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=Emdebian_on_APF&amp;diff=11039</id>
		<title>Emdebian on APF</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=Emdebian_on_APF&amp;diff=11039"/>
				<updated>2012-07-05T15:53:05Z</updated>
		
		<summary type="html">&lt;p&gt;VincentB: /* Multistrap */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Requirements==&lt;br /&gt;
* An APF28 with its docking board.&lt;br /&gt;
* A PC running a Debian stable distribution (it can be in a chroot).&lt;br /&gt;
* A microSD card.&lt;br /&gt;
&lt;br /&gt;
==Preamble==&lt;br /&gt;
This page describes how to install an Emdebian stable distribution on APF28. Emdebian is mainly a Debian without documentation (manpages,etc...), so it can fit on smaller storage devices but providing the same functionalities. One of the goals in this procedure is to use the Armadeus tools as less as possible. So you won't need to change anything in u-boot configuration and buildroot will only be used to fetch and patch the kernel. The latter could have been avoided but doing this way facilitates the choice of the kernel (2.6.35.3 or a 3.x one) and ensures all the patches are applied.&lt;br /&gt;
&lt;br /&gt;
Emdebian is a work in progress and the cross-toolchains in unstable are often broken so we'll stay here in the stable branches (both Emdebian and Debian).&lt;br /&gt;
&lt;br /&gt;
This procedure has been written for an APF28 but should be easily adapted for another board.&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
* To avoid possible ownership issues in the generated files without sudoing (I'm a bit lazy, I agree, but I doubt God keeps an eye on me...):&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
$ sudo su&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add  emdebian tools repository to your ''sources.list''. We'll need it to install the cross-toolchain for kernel compilation:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;# echo 'deb http://www.emdebian.org/debian/ stable main' &amp;gt;&amp;gt; /etc/apt/sources.list&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Install needed packages:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
# apt-get install multistrap uboot-mkimage g++-4.4-arm-linux-gnueabi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:multistrap will fetch the packages and build the rootfs.&lt;br /&gt;
:uboot-mkimage will be needed to build the final uImage.&lt;br /&gt;
:g++-4.4-arm-linux-gnueabi dependencies will install the whole cross-toolchain. Thanks apt :)&lt;br /&gt;
* Create an ext2 partition on the SD card:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
# mkfs.ext2 /dev/sdc1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Building the rootfs==&lt;br /&gt;
* Let's create a directory:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
# mkdir apf&lt;br /&gt;
# cd apf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Kernel===&lt;br /&gt;
* Get an Armadeus working tree and apply configuration:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf/# git clone git://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus armadeus&lt;br /&gt;
apf/# cd armadeus&lt;br /&gt;
armadeus/# make apf28_defconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: Customise things you want to.&lt;br /&gt;
* Apply Armadeus patches:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
armadeus/# export KDIR=$PWD/buildroot/output/build/linux-2.6.35.3&lt;br /&gt;
armadeus/# make $KDIR/.stamp_downloaded $KDIR/.stamp_extracted $KDIR/.stamp_patched&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Adjust KDIR depending on the kernel you chose at the preceding step.&lt;br /&gt;
* Copy default configuration:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
armadeus/# cp buildroot/target/device/armadeus/apf28/apf28-linux-2.6.35.3.config $KDIR/.config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Configure and compile the kernel:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
armadeus/# cd $KDIR&lt;br /&gt;
linux-2.6.35.3/# mkdir modout&lt;br /&gt;
linux-2.6.35.3/# make INSTALL_MOD_PATH=$KDIR/modout ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- menuconfig uImage modules modules_install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:menuconfig can be omitted if you're happy with the default kernel configuration.&lt;br /&gt;
&lt;br /&gt;
Now we have a kernel at ''$KDIR/arch/arm/boot/uImage'' and the modules under ''$KDIR/modout''. Let's build the rootfs.&lt;br /&gt;
&lt;br /&gt;
===Multistrap===&lt;br /&gt;
Multistrap does basically quite the same things than 'debootstrap --foreign', fetching packages from an emdebian repository, building a root tree and leaving  packages unconfigured.&lt;br /&gt;
* Get back to the base directory:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
linux-2.6.35.3/# cd ../../../../&lt;br /&gt;
apf28/#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create a config file for multistrap:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# cat &amp;gt; stable.config &amp;lt;&amp;lt; EOF&lt;br /&gt;
[General]&lt;br /&gt;
arch=armel&lt;br /&gt;
directory=rootfs&lt;br /&gt;
cleanup=true&lt;br /&gt;
noauth=false&lt;br /&gt;
unpack=true&lt;br /&gt;
debootstrap=Grip&lt;br /&gt;
aptsources=Grip &lt;br /&gt;
&lt;br /&gt;
[Grip]&lt;br /&gt;
packages=&lt;br /&gt;
keyring=emdebian-archive-keyring&lt;br /&gt;
source=http://www.emdebian.org/grip&lt;br /&gt;
suite=stable&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:'packages=' is a space separated list of additional packages.&lt;br /&gt;
:If you have issues with the archive keyring you can either set 'noauth=true' or download this backport:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# wget http://backports.debian.org/debian-backports/pool/main/m/multistrap/multistrap_2.1.15~bpo60+1_all.deb&lt;br /&gt;
apf28/# dpkg -i multistrap_2.1.15~bpo60+1_all.deb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Build:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# multistrap -f stable.config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Copy the kernel and the modules:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# cp $KDIR/arch/arm/boot/uImage rootfs/boot/apf28-linux.bin&lt;br /&gt;
apf28/# cp -r $KDIR/modout/lib rootfs/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:uImage is renamed to apf28-linux.bin so that u-boot can find it.&lt;br /&gt;
&lt;br /&gt;
===Finalisation===&lt;br /&gt;
We're near the end.&lt;br /&gt;
* Set hostname:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# echo 'apf28' &amp;gt;&amp;gt; rootfs/etc/hostname&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Avoid some warnings:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# touch rootfs/etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Network configuration (address,netmask,etc...) will be inherited from u-boot, but we'll need these:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# echo '127.0.0.1 localhost' &amp;gt;&amp;gt; rootfs/etc/hosts&lt;br /&gt;
apf28/# echo 'nameserver 192.168.0.1' &amp;gt;&amp;gt; rootfs/etc/resolv.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add emdebian repository:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# echo 'deb http://www.emdebian.org/grip/ stable main' &amp;gt;&amp;gt; rootfs/etc/apt/sources.list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* The very last step will occur onboard. Create a shell script to be executed at first boot:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# cat &amp;gt; rootfs/first_boot.sh &amp;lt;&amp;lt; EOF&lt;br /&gt;
#! /bin/sh&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
export PATH=/usr/sbin:/usr/bin:/sbin:/bin&lt;br /&gt;
export DEBIAN_FRONTEND=noninteractive&lt;br /&gt;
export DEBCONF_NONINTERACTIVE_SEEN=true&lt;br /&gt;
export LC_ALL=C&lt;br /&gt;
export LANGUAGE=C&lt;br /&gt;
export LANG=C&lt;br /&gt;
&lt;br /&gt;
mount proc -t proc /proc&lt;br /&gt;
&lt;br /&gt;
# Workaround configuration of dash and bash failures&lt;br /&gt;
# See http://lists.debian.org/debian-embedded/2011/11/msg00037.html&lt;br /&gt;
mkdir -p /usr/share/man/man1&lt;br /&gt;
/var/lib/dpkg/info/dash.preinst&lt;br /&gt;
&lt;br /&gt;
# Configure packages&lt;br /&gt;
dpkg --configure -a&lt;br /&gt;
&lt;br /&gt;
# Reset root password&lt;br /&gt;
sed -i -e 's/root:\*:/root::/' /etc/shadow&lt;br /&gt;
&lt;br /&gt;
# Enable login through debug console&lt;br /&gt;
echo 'T0:23:respawn:/sbin/getty -L ttyAM0 115200 vt100' &amp;gt;&amp;gt; /etc/inittab&lt;br /&gt;
&lt;br /&gt;
# Self delete&lt;br /&gt;
rm $0&lt;br /&gt;
sync&lt;br /&gt;
echo 'Done! You can reset the board.'&lt;br /&gt;
while true;&lt;br /&gt;
do&lt;br /&gt;
echo '.\c'&lt;br /&gt;
sleep 1&lt;br /&gt;
done&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Make it executable:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# chmod +x rootfs/first_boot.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Copy the rootfs on the SD:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# mkdir /mnt/sd&lt;br /&gt;
apf28/# mount /dev/sdc1 /mnt/sd&lt;br /&gt;
apf28/# cp -rp rootfs/* /mnt/sd&lt;br /&gt;
apf28/# umount /mnt/sd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Put the SD card into its placeholder, poweron the base board and interrupt the automatic boot. We need to tell the kernel it must launch first_boot.sh:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv extrabootargs init=/first_boot.sh&lt;br /&gt;
BIOS&amp;gt; run mmcboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:update-alternative will complain about missing manpages. It can be ignored.&lt;br /&gt;
&lt;br /&gt;
This should end-up with something like that:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
Done! You can reset the board.&lt;br /&gt;
......&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So...reset the board. To boot on emdebian, just get u-boot prompt and type:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; run mmcboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To have it permanent:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv bootcmd run mmcboot&lt;br /&gt;
BIOS&amp;gt; saveenv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues, tips, misc...==&lt;br /&gt;
* Sometimes u-boot fails to load the kernel&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; run mmcboot&lt;br /&gt;
mmc0 is current device&lt;br /&gt;
Loading file &amp;quot;/boot/apf28-linux.bin&amp;quot; from mmc device 0:1 (xxa1)&lt;br /&gt;
MMC0: Data timeout with command 18 (status 0xe03c2020)!&lt;br /&gt;
 ** ext2fs_devread read error - block&lt;br /&gt;
** Unable to read &amp;quot;/boot/apf28-linux.bin&amp;quot; from mmc 0:1 **&lt;br /&gt;
## Booting kernel from Legacy Image at 40000000 ...&lt;br /&gt;
   Image Name:   Linux-2.6.35.3&lt;br /&gt;
   Created:      2012-07-02  14:05:13 UTC&lt;br /&gt;
   Image Type:   ARM Linux Kernel Image (uncompressed)&lt;br /&gt;
   Data Size:    2714300 Bytes = 2.6 MiB&lt;br /&gt;
   Load Address: 40008000&lt;br /&gt;
   Entry Point:  40008000&lt;br /&gt;
   Verifying Checksum ... Bad Data CRC&lt;br /&gt;
ERROR: can't get kernel image!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Powering off/on (not just reset) solves the problem. I'm unable to say what is faulty, u-boot, hardware, other...?&lt;br /&gt;
&lt;br /&gt;
* you can also boot embdebian through your network NFS shared connection:&lt;br /&gt;
Copy the rootfs on your share NFS folder:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# mkdir -p /tftpboot/apf28-root&lt;br /&gt;
apf28/# cp -rp rootfs/* /tftpboot/apf28-root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the first boot use &lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv extrabootargs  init=/first_boot.sh&lt;br /&gt;
BIOS&amp;gt; run nfsboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then after having succesfully deployed the embedebian distro:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; run nfsboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* [http://www.emdebian.org Emdebian homepage]&lt;br /&gt;
* http://free-electrons.com/blog/embdebian-with-multistrap/&lt;br /&gt;
&lt;br /&gt;
[[Category:Distribution]]&lt;/div&gt;</summary>
		<author><name>VincentB</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=Emdebian_on_APF&amp;diff=11031</id>
		<title>Emdebian on APF</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=Emdebian_on_APF&amp;diff=11031"/>
				<updated>2012-07-05T09:43:42Z</updated>
		
		<summary type="html">&lt;p&gt;VincentB: New page: ==Requirements== * An APF28 with its docking board. * A PC running a Debian stable distribution (it can be in a chroot). * A microSD card.  ==Preamble== This page describes how to install ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Requirements==&lt;br /&gt;
* An APF28 with its docking board.&lt;br /&gt;
* A PC running a Debian stable distribution (it can be in a chroot).&lt;br /&gt;
* A microSD card.&lt;br /&gt;
&lt;br /&gt;
==Preamble==&lt;br /&gt;
This page describes how to install an Emdebian stable distribution on APF28. Emdebian is mainly a Debian without documentation (manpages,etc...), so it can fit on smaller storage devices but providing the same functionalities. One of the goals in this procedure is to use the Armadeus tools as less as possible. So you won't need to change anything in u-boot configuration and buildroot will only be used to fetch and patch the kernel. The latter could have been avoided but doing this way facilitates the choice of the kernel (2.6.35.3 or a 3.x one) and ensures all the patches are applied.&lt;br /&gt;
&lt;br /&gt;
Emdebian is a work in progress and the cross-toolchains in unstable are often broken so we'll stay here in the stable branches (both Emdebian and Debian).&lt;br /&gt;
&lt;br /&gt;
This procedure has been written for an APF28 but should be easily adapted for another board.&lt;br /&gt;
&lt;br /&gt;
==Preparation==&lt;br /&gt;
* To avoid possible ownership issues in the generated files without sudoing (I'm a bit lazy, I agree, but I doubt God keeps an eye on me...):&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
$ sudo su&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add  emdebian tools repository to your ''sources.list''. We'll need it to install the cross-toolchain for kernel compilation:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;# echo 'deb http://www.emdebian.org/debian/ stable main' &amp;gt;&amp;gt; /etc/apt/sources.list&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Install needed packages:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
# apt-get install multistrap uboot-mkimage g++-4.4-arm-linux-gnueabi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:multistrap will fetch the packages and build the rootfs.&lt;br /&gt;
:uboot-mkimage will be needed to build the final uImage.&lt;br /&gt;
:g++-4.4-arm-linux-gnueabi dependencies will install the whole cross-toolchain. Thanks apt :)&lt;br /&gt;
* Create an ext2 partition on the SD card:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
# mkfs.ext2 /dev/sdc1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Building the rootfs==&lt;br /&gt;
* Let's create a directory:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
# mkdir apf&lt;br /&gt;
# cd apf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Kernel===&lt;br /&gt;
* Get an Armadeus working tree and apply configuration:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf/# git clone git://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus armadeus&lt;br /&gt;
apf/# cd armadeus&lt;br /&gt;
armadeus/# make apf28_defconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: Customise things you want to.&lt;br /&gt;
* Apply Armadeus patches:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
armadeus/# export KDIR=$PWD/buildroot/output/build/linux-2.6.35.3&lt;br /&gt;
armadeus/# make $KDIR/.stamp_downloaded $KDIR/.stamp_extracted $KDIR/.stamp_patched&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Adjust KDIR depending on the kernel you chose at the preceding step.&lt;br /&gt;
* Copy default configuration:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
armadeus/# cp buildroot/target/device/armadeus/apf28/apf28-linux-2.6.35.3.config $KDIR/.config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Configure and compile the kernel:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
armadeus/# cd $KDIR&lt;br /&gt;
linux-2.6.35.3/# mkdir modout&lt;br /&gt;
linux-2.6.35.3/# make INSTALL_MOD_PATH=$KDIR/modout ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- menuconfig uImage modules modules_install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:menuconfig can be omitted if you're happy with the default kernel configuration.&lt;br /&gt;
&lt;br /&gt;
Now we have a kernel at ''$KDIR/arch/arm/boot/uImage'' and the modules under ''$KDIR/modout''. Let's build the rootfs.&lt;br /&gt;
&lt;br /&gt;
===Multistrap===&lt;br /&gt;
Multistrap does basically quite the same things than 'debootstrap --foreign', fetching packages from an emdebian repository, building a root tree and leaving  packages unconfigured.&lt;br /&gt;
* Get back to the base directory:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
linux-2.6.35.3/# cd ../../../../../&lt;br /&gt;
apf28/#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create a config file for multistrap:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# cat &amp;gt; stable.config &amp;lt;&amp;lt; EOF&lt;br /&gt;
[General]&lt;br /&gt;
arch=armel&lt;br /&gt;
directory=rootfs&lt;br /&gt;
cleanup=true&lt;br /&gt;
noauth=false&lt;br /&gt;
unpack=true&lt;br /&gt;
debootstrap=Grip&lt;br /&gt;
aptsources=Grip &lt;br /&gt;
&lt;br /&gt;
[Grip]&lt;br /&gt;
packages=&lt;br /&gt;
keyring=emdebian-archive-keyring&lt;br /&gt;
source=http://www.emdebian.org/grip&lt;br /&gt;
suite=stable&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:'packages=' is a space separated list of additional packages.&lt;br /&gt;
:If you have issues with the archive keyring you can set 'noauth=true'&lt;br /&gt;
* Build:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# multistrap -f stable.config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Copy the kernel and the modules:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# cp $KDIR/arch/arm/boot/uImage rootfs/boot/apf28-linux.bin&lt;br /&gt;
apf28/# cp -r $KDIR/modout/lib rootfs/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:uImage is renamed to apf28-linux.bin so that u-boot can find it.&lt;br /&gt;
&lt;br /&gt;
===Finalisation===&lt;br /&gt;
We're near the end.&lt;br /&gt;
* Set hostname:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# echo 'apf28' &amp;gt;&amp;gt; rootfs/etc/hostname&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Avoid some warnings:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# touch rootfs/etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Network configuration (address,netmask,etc...) will be inherited from u-boot, but we'll need these:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# echo '127.0.0.1 localhost' &amp;gt;&amp;gt; rootfs/etc/hosts&lt;br /&gt;
apf28/# echo 'nameserver 192.168.0.1' &amp;gt;&amp;gt; rootfs/etc/resolv.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add emdebian repository:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# echo 'deb http://www.emdebian.org/grip/ stable main' &amp;gt;&amp;gt; rootfs/etc/apt/sources.list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* The very last step will occur onboard. Create a shell script to be executed at first boot:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# cat &amp;gt; rootfs/first_boot.sh &amp;lt;&amp;lt; EOF&lt;br /&gt;
#! /bin/sh&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
export PATH=/usr/sbin:/usr/bin:/sbin:/bin&lt;br /&gt;
export DEBIAN_FRONTEND=noninteractive&lt;br /&gt;
export DEBCONF_NONINTERACTIVE_SEEN=true&lt;br /&gt;
export LC_ALL=C&lt;br /&gt;
export LANGUAGE=C&lt;br /&gt;
export LANG=C&lt;br /&gt;
&lt;br /&gt;
mount proc -t proc /proc&lt;br /&gt;
&lt;br /&gt;
# Workaround configuration of dash and bash failures&lt;br /&gt;
# See http://lists.debian.org/debian-embedded/2011/11/msg00037.html&lt;br /&gt;
mkdir -p /usr/share/man/man1&lt;br /&gt;
/var/lib/dpkg/info/dash.preinst&lt;br /&gt;
&lt;br /&gt;
# Configure packages&lt;br /&gt;
dpkg --configure -a&lt;br /&gt;
&lt;br /&gt;
# Reset root password&lt;br /&gt;
sed -i -e 's/root:\*:/root::/' /etc/shadow&lt;br /&gt;
&lt;br /&gt;
# Enable login through debug console&lt;br /&gt;
echo 'T0:23:respawn:/sbin/getty -L ttyAM0 115200 vt100' &amp;gt;&amp;gt; /etc/inittab&lt;br /&gt;
&lt;br /&gt;
# Self delete&lt;br /&gt;
rm $0&lt;br /&gt;
sync&lt;br /&gt;
echo 'Done! You can reset the board.'&lt;br /&gt;
while true;&lt;br /&gt;
do&lt;br /&gt;
echo '.\c'&lt;br /&gt;
sleep 1&lt;br /&gt;
done&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Make it executable:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# chmod +x rootfs/first_boot.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Copy the rootfs on the SD:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
apf28/# mkdir /mnt/sd&lt;br /&gt;
apf28/# mount /dev/sdc1 /mnt/sd&lt;br /&gt;
apf28/# cp -rp rootfs/* /mnt/sd&lt;br /&gt;
apf28/# umount /mnt/sd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Put the SD card into its placeholder, poweron the base board and interrupt the automatic boot. We need to tell the kernel it must launch first_boot.sh:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv addmmcargs ${addmmcargs} init=/first_boot.sh&lt;br /&gt;
BIOS&amp;gt; run mmcboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:update-alternative will complain about missing manpages. It can be ignored.&lt;br /&gt;
&lt;br /&gt;
This should end-up with something like that:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
Done! You can reset the board.&lt;br /&gt;
......&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So...reset the board. To boot on emdebian, just get u-boot prompt and type:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; run mmcboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To have it permanent:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv bootcmd run mmcboot&lt;br /&gt;
BIOS&amp;gt; saveenv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues, tips, misc...==&lt;br /&gt;
* Sometimes u-boot fails to load the kernel&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; run mmcboot&lt;br /&gt;
mmc0 is current device&lt;br /&gt;
Loading file &amp;quot;/boot/apf28-linux.bin&amp;quot; from mmc device 0:1 (xxa1)&lt;br /&gt;
MMC0: Data timeout with command 18 (status 0xe03c2020)!&lt;br /&gt;
 ** ext2fs_devread read error - block&lt;br /&gt;
** Unable to read &amp;quot;/boot/apf28-linux.bin&amp;quot; from mmc 0:1 **&lt;br /&gt;
## Booting kernel from Legacy Image at 40000000 ...&lt;br /&gt;
   Image Name:   Linux-2.6.35.3&lt;br /&gt;
   Created:      2012-07-02  14:05:13 UTC&lt;br /&gt;
   Image Type:   ARM Linux Kernel Image (uncompressed)&lt;br /&gt;
   Data Size:    2714300 Bytes = 2.6 MiB&lt;br /&gt;
   Load Address: 40008000&lt;br /&gt;
   Entry Point:  40008000&lt;br /&gt;
   Verifying Checksum ... Bad Data CRC&lt;br /&gt;
ERROR: can't get kernel image!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Powering off/on (not just reset) solves the problem. I'm unable to say what is faulty, u-boot, hardware, other...?&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* [http://www.emdebian.org Emdebian homepage]&lt;br /&gt;
* http://free-electrons.com/blog/embdebian-with-multistrap/&lt;br /&gt;
&lt;br /&gt;
[[Category:Distribution]]&lt;/div&gt;</summary>
		<author><name>VincentB</name></author>	</entry>

	</feed>