Apr 24, 2013

Build your Emdebian Grip for ARM (WM8850 support)

Here is the instruction that how to install an embedded debian OS for your ARM system. Linux Kernel Image for your ARM system is a prerequisite. [1]

Please follow the instruction step by step to build emdebian rootfs on Debian/Ubuntu. :)

1. Using Bootstrap

(Use apt-get install debootstrap to install it if you don't have yet.)

Use the command to retrieve the packages for ARM:
sudo debootstrap \
--arch=armel \
--include=vim,openssh-server \
--foreign \
squeeze grip/ http://www.emdebian.org/grip/

After this step, the installation rootfs is ready at "./grip", but it is like an installation disc rather than a working rootfs.
"--inculde" is to install any additional packages. In this example, vim and ssh server are added manually.

2. Write Rootfs to disk/SD card.

Copy the installation rootfs (at ./grip) to ext3 partition of a SD card or other media.

Save the following content to target's rootfs "/first.sh" :
#!/bin/sh
mkdir -p ./usr/share/man/man1
echo "proc /proc proc rw 0 0" >> /etc/fstab
echo 'deb http://www.emdebian.org/grip/ squeeze main' >> etc/apt/sources.list
echo 'deb http://ftp.tw.debian.org/debian squeeze main' >> etc/apt/sources.list
mount /proc /proc -t proc
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/debootstrap/debootstrap --second-stage

3. First Boot

Before entering Linux Kernel, add "init=/bin/sh" to bootargs at uboot or other bootloader.[2] 
"#" prompt should be appeared. (If you can't see that, press enter to make sure your system isn't crash.). Just execute "/first.sh" at "/" and wait for couple minutes to install the base system.
if anything works normally, use "passwd" to modify root's password then reboot the system.

4. Second Boot

Modify bootargs from "init=/bin/sh" to "init=/sbin/init" at uboot or other bootloader before entering Linux Kernel. [3]

So far, login with root should be successfully. :)

P.S.

Attach some files for my WM8850 netbook.
[1] Linux Kernel :
[2] boot script for First Boot:
[3] boot script for Second Boot:
[4] Emdebian Linux on WM8850 Netbook
https://www.youtube.com/watch?v=JzPxJVLE2Zc&hd=1