View source for Manual Debian

From Openmoko

Jump to: navigation, search

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Administrators.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page:

Template used on this page:

Return to Manual Debian.

Personal tools
Debian on neo1973

This page is to explain how to run Debian armel port on Openmoko devices. You can do this from scratch, or download a prebuilt file system. The former will take some time, perhaps 2 hours, depending on your internet connection

Prebuilt Filesystem

Download and extract to an ext2/ext3 formatted filesystem on your SD card:


Note that the above is just a bit too big to fit on a 512MB SD card. A smaller image will soon be provided.

Access via SSH is much the same as under other images using USB Networking, with the user accounts below:

  • root password: openmoko
  • First user and password: openmoko

Note: If you upgrade your your debian and your touchscreen doesn't work any more, you most likely have to adjust /etc/udev/rules.d/50-udev.rules by applying the settings described later in this document for /etc/udev/udev.rules

(Optional) Install Known Good Kernel

This kernel was build by Marcel_M and has some important patches in it such as removed sd debug symbols and build-in ext3 support.

./dfu-util -d 0x1457:0x5119 -a kernel -R -D ./uImage-2.6.24+svnr4194-r4165-r3-neo1973.bin

(Optional) Recompiling Kernel to Add Drivers

(Based on

Steps to build the kernel standalone with the "moredrivers" config (to get additional drivers, such as the usb tether drivers that were moved out as kernel modules, compiled directly into the kernel).

 ~ - git clone git:// linux-2.6
 ~ - cd linux-2.6
 ~ - git checkout origin/stable
 ~ - edit ./build to point to your compiler path
 ~ - cp defconfig-2.6.24 .config
 ~ - ./build

That gets you a uImage.bin you can DFU or copy into your SD Card filesystem.

Configure booting from SD/SDHC

Do as proposed here: Booting_from_SD

Note that these instructions are in need a rewrite.

Build your own armel filesystem

(Option 1) debootstrap your rootfs on Debian or Ubuntu host

debootstrap --verbose --arch armel --foreign sid ./armel-chroot

(option 2) download ready to use armel rootfs

If you don't have debootstrap on your system you can download the results here:


Prepare SD card

ssh to your neo and format your sd card appropriately. I'm using an 8GB SDHC card here.

NOTE: it might be a good idea not to use ext3. This is because ext3 is a heavily journalising file system and on the                                     
freerunner (sd card) might cause premature death of the card. It is recommened you use ext2 or another similar file       
system. One also will need a vfat or ext2 (only vfat worked for me with the stock u-boot for the freerunner. On  
which to place the kernel to boot off. See the Booting_from_SD If you have not done so already.

fdisk /dev/mmcblk0
We will now create a 8 mb partition for our kernel and another one for the rootfs which will take up all the   
remaining space.
 Command (m for help): d
 Selected partition 1
 Command (m for help): n
 Command action
    e   extended
    p   primary partition (1-4)
 Partition number (1-4): 1
 First cylinder (1-983, default 1):
 Using default value 1
 Last cylinder or +size or +sizeM or +sizeK (1-983, default 983): +8M
 Command (m for help): n
 Command action
    e   extended
    p   primary partition (1-4)
 Partition number (1-4): 2
 First cylinder (18-983, default 18):
 Using default value 18
 Last cylinder or +size or +sizeM or +sizeK (18-983, default 983):
 Using default value 983
 Command (m for help): w
 The partition table has been altered!
 Calling ioctl() to re-read partition table.
 Syncing disks.
mkfs.vfat /dev/mmcblk0p1

mkfs.ext3 /dev/mmcblk0p2
mount /dev/mmcblk0p2 /media/card

copy the armel chroot to your device by tar'ing it to circumvent symbolic link cycles ( <= WONTFIX)

tar -C ./armel-chroot/ -c . | ssh root@ tar -C /media/card -xv

or if you downloaded the archive

cat armel-chroot-first-stage.tar.gz | ssh root@ tar -C /media/card -xzvf -

Complete debootstrap Process

ssh to your device and execute the following commands (just copypaste everything below)

echo "nameserver" > /media/card/etc/resolv.conf
echo "fic-gta01" > /media/card/etc/hostname
echo " localhost.localdomain localhost fic-gta01" > /media/card/etc/hosts
echo -e "auto lo\n\
iface lo inet loopback\n\
auto usb0\n\
iface usb0 inet static\n\
    up echo nameserver >/etc/resolv.conf" > /media/card/etc/network/interfaces
echo -e "rootfs  /                ext3    defaults,errors=remount-ro,noatime 0 1\n\
proc    /proc            proc    defaults                           0 0\n\
tmpfs   /etc/network/run tmpfs   defaults,noatime                   0 0\n\
tmpfs   /tmp             tmpfs   defaults,noatime                   0 0\n\
tmpfs   /var/lock        tmpfs   defaults,noatime                   0 0\n\
tmpfs   /var/run         tmpfs   defaults,noatime                   0 0\n\
tmpfs   /var/tmp         tmpfs   defaults,noatime                   0 0" > /media/card/etc/fstab

now chroot into your armel rootfs and finish the install

chroot /media/card
/debootstrap/debootstrap --second-stage

make sure your internal clock is set to the correct date because aptitude will complain if otherwise (does not work on the gta02 at the moment: "Cannot access the Hardware Clock via any known method.")

hwclock --set --date="MM/DD/YY hh:mm:ss"

install openssh so you can login remotely

echo "deb sid main" > /etc/apt/sources.list
aptitude update
aptitude upgrade
aptitude install openssh-server

install and configure locales

aptitude install locales
dpkg-reconfigure locales

install udev to dynamically create /dev

aptitude install udev

set a root password


create a normal user

adduser <yournamehere>

Get X Running

Now reboot and start Debian. Login with ssh and start configuring xorg:

aptitude install xorg

configure /etc/X11/xorg.conf so that it looks like this:

Section "InputDevice"
       Identifier      "Configured Mouse"
       Driver          "mouse"
       Option          "Device" "/dev/input/mice"
Section "Device"
       Identifier      "Configured Video Device"
       Driver          "fbdev"
Section "Monitor"
       Identifier      "Configured Monitor"
Section "Screen"
       Identifier      "Default Screen"
       Monitor         "Configured Monitor"
Section "ServerLayout"
       Identifier      "Default Layout"
       Screen          "Default Screen"
       InputDevice     "Configured Mouse"

Start X in the first vt:

startx -- vt1

Get touchscreen working

Install the tslib driver:

aptitude install xserver-xorg-input-tslib

and edit the InputDevice section in your xorg.conf

Section "InputDevice"
       Identifier "Configured Mouse"
       Driver "tslib"
       Option "CorePointer"
       Option "TslibDevice" "/dev/input/event1"
       Option "Protocol" "Auto"

calibrate your touchscreen for gta01:

echo -67 36365 -2733100 -48253 -310 45219816 65536 > /etc/pointercal

calibration for the gta02

echo  -67 38667 -4954632 -51172 121 46965312 65536 > /etc/pointercal

Start X and enjoy!

startx -- vt1

Install GDM and xfce4

aptitude install gdm xfce4 xvkbd

Configure gdm so xkvbd will allow you to put in your username and password. simply add this to the end of /etc/gdm/Init/Default before exit 0 so that the three last lines look like this:

sleep 20 && /usr/bin/xvkbd -xdm -compact -geometry 480x210+0+0 &
exit 0

Simply click on the focus button of xvkbd and then on the input box of GDM to input your user name and password there. On each boot gdm should start automatically now.

If you like you can also download a correctly sized Debian wallpaper I generated from the SVG source for 480x640:

wget -O /usr/share/images/desktop-base/desktop-background

Clean Up

aptitude clean

Load Additional Kernel Modules

These are for sound, bluetooth and USB. Use the modules archive that fits to your kernel.

tar -xf modules-2.6.24+svnr4194-r4165-r3-neo1973.tgz -C /
depmod -a
echo -e "hci_usb\n\
snd-soc-neo1973-wm8753" > /etc/modules

Sonata on neo1973

Enable Sound

Now we turn our Debian into a jukebox!

aptitude install alsa-base
tar -xf alsa_state_files-working.tar.gz -C /etc
alsactl -f /etc/alsa_state_files-working/stereoout.state restore
addgroup openmoko audio

I currently use mpd+sonata - let me know if you know another nice lightweight gtk player. Unfortunately RhythmBox is way too much for the Neo to handle - the MP3 playing stops after 20secs.

Using a keyboard

Using irssi on Debian together with the frogpad to IRC on #neo1973-germany nezza prepared a nice guide for this here: Frogpad

Chroot installation

If you just want to run random debian programs without completely booting to debian you can use the following minimal steps:

on desktop:

sudo debootstrap --arch armel --foreign sid sid
sudo tar cjf sid.tar.bz2 sid
nc -w3 -lp1234 < sid-arm.tar.bz2

on neo:

cd /media/card
nc 1234 | tar -x -j -f -
mount -t none -o bind /dev /media/card/sid/dev
mount -t none -o bind /proc /media/card/sid/proc
mount -t none -o bind /sys /media/card/sid/sys
mount -t none -o bind /tmp /media/card/sid/tmp
chroot /media/card/sid /deboostrap/deboostrap --second-stage
cp /etc/resolv.conf /media/card/sid
chroot /media/card/sid apt-get update
chroot /media/card/sid apt-get install mplayer
chroot /media/card/sid mplayer

For X applications / xserver.

Just copy /usr/bin/Xglamo (./Xfbdev) to /usr/bin in debian. Then. add this to your .bashrc export TSLIB_TSDEVICE=/dev/input/event1

Then as root go ln -s /usr/lib/ /usr/lib/ Also, do the following: cd /usr/bin && mv X X.orig && ln -s Xfbdev X This should make X a symlink to Xfbdev.

Official Debian Port

An official Debian port based on the FSO image is being created. First information can be found at Early adaptors are welcome.