Debian

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(WLAN: wifi-radar for wireless configuration)
(Using matchbox-window-manager with XFCE)
Line 347: Line 347:
 
XFCE's window manager is poorly configured for use with the FreeRunner.  Fortunately, matchbox's window manager is compatible with xfce.  To use the matchbox window manager, arrange to run the following commands at X startup.  If you followed the instructions above to run X as a normal user, put this in ~/.xinitrc:
 
XFCE's window manager is poorly configured for use with the FreeRunner.  Fortunately, matchbox's window manager is compatible with xfce.  To use the matchbox window manager, arrange to run the following commands at X startup.  If you followed the instructions above to run X as a normal user, put this in ~/.xinitrc:
  
#!/bin/sh
+
#!/bin/sh
+
 
zhone &
+
zhone &
matchbox-keyboard-toggle &
+
matchbox-keyboard-toggle &
exec matchbox-window-manager -use_titlebar no -use_cursor no &
+
exec matchbox-window-manager -use_titlebar no -use_cursor no &
xfce4-session
+
xfce4-session
 +
 
 +
 
 +
{{Todo|And if I didn't run X as a normal user?}}
  
 
= Miscellaneous =
 
= Miscellaneous =

Revision as of 10:53, 16 October 2008

Contents

Installation

There are "official" instructions on how to install Debian on FreeRunner or Debian on Neo1973 (see the original announcement).

Previous information (partly outdated, now) on how to install Debian manually has been moved to Manual Debian.

See also : http://www.debian.org/ to know more about Debian.

From time to time the Debian packages may be broken, which will cause the install.sh script to fail. Since waiting for the packages to be fixed can take quite a lot of patience, here is an alternative method of getting Debian installed on the FreeRunner.

System

Password

The default root password is blank. You should change that as soon as you can:

# passwd

If entering a blank password does not work at first, try rebooting. If still no success, boot to 2008.08/2007.02, chroot to the micro SD card and set a new password.

Speeding up booting

Note: By default, Debian is already configured to write limited messages to the console during boot. Does this actually speed things up anymore?

What's good for every linux booting is also good for our debian on the freerunner: booting in quiet mode. To do so by default just boot your Neo FreeRunner in NOR-Flash and execute this configure-script: configure-uboot.sh.

It changes default booting to quiet-mode and adds another boot-option to boot without quiet-mode for debugging purpose.

Suspend

Note: As of Sep. 15 2008, suspend works 'out-of-the-box'; installing apm and the idle clock configuration changes do not seem to be necessary any more. Press the power button for two seconds (in zhone) or run 'apm -s' to suspend.

To make suspend available you have to install apmd:

apt-get install apmd

After that you can suspend your phone with:

apm -s

and make it wake up again with pressing the power button.


Issues:

  • Wuth 06:28, 17 August 2008 (UTC): I found that apmd was already installed by using the official debian installation procedure, but that the kernel didn't support apm. I haven't yet resolved this issue. Wuth 05:31, 7 September 2008 (UTC): Worked fine on second install. Perhaps this is no longer a problem.
  • Phyce 21:33, 20 August 2008 (UTC) installed apm without problems; apm -s shutdowns the freerunner but I couldn't wake it up with power button... I had to remove the battery to boot again. suspend/resume was working quite reliably with latest kernels on ASU.

To wake up successfully, the idle-clock of the SD card needs to be enabled right before suspend. It can be disabled again right after resume (this reduces GPS interference). Write into /etc/apm/suspend.d/00sd_idleclk

#!/bin/sh 
echo 1 > /sys/module/glamo_mci/parameters/sd_idleclk 
touch /home/root/.profile

and into /etc/apm/resume.d/00sd_idleclk

#!/bin/sh
echo 0 > /sys/module/glamo_mci/parameters/sd_idleclk 

These are from -stacy on the community list.

And anotherone from Morlac: (more debianish i think ;)
etc/apm/scripts.d/sd_idleclk and corresponding link in /etc/apm/event.d
(don't forget to chmod +x /etc/apm/scripts.d/sd_idleclk)

#!/bin/sh
SD_IDLECLK="/sys/module/glamo_mci/parameters/sd_idleclk"
[ -e "${SD_IDLECLK}" ] || exit 0

case "${1},${2}" in
(suspend,*)
    echo 1 > ${SD_IDLECLK}
    touch /etc
    ;;
(resume,suspend)
    echo 0 > ${SD_IDLECLK}
    ;;
esac

exit 0

Time

The default time zone is UTC. Reconfigure it by running

# dpkg-reconfigure tzdata

To set the clock manually do something like

# date -s 00:33

If you have a network connection, do something like

# apt-get install ntpdate
# ntpdate-debian


Issues:

WLAN

wifi-radar

If you don't want to mess up with configuration files and is looking for an easy gui for wireless configuration, then wifi-radar is what you are looking for.

apt-get install wifi-radar
wifi-radar

If you are looking for more, read on...

Installing prerequisites

Make sure the following packages are installed apt-get install wireless-tools wpasupplicant dhcp3-client

Example configurations

Single network configuration

Assuming your wireless router uses WPA security and DHCP, edit /etc/network/interfaces to include a section like this:

auto eth0
iface eth0 inet dhcp
wpa-driver wext
wpa-ssid "MyWirelessName"
wpa-psk "MyWirelessPassword"

Where, of course, you're using the name of your wireless network and it's password instead of MyWirelessName and MyWirelessPassword.

You can test by running

  1. ifup eth0

You can determine your IP address by running

  1. ifconfig eth0

Issues:

  • only works if in presence of wireless network on boot, or when manually running ifup eth0
  • booting away from wireless network is slower because waits for DHCP to time out
  • does not reestablish connection when leaving wireless area and then returning
  • does not support multiple wireless networks or open hotspots that you may travel between

Once wpa_supplicant has begun managing your wifi interface, you should type "wpa_action eth0 stop" instead of "ifdown eth0".

Roaming configuration

Todo: Which of the issues that single network configurations suffer from are addressed by WPA roaming mode? Would ifplugd / guessnet help, or just make things more complicated?

  • Roaming from network to network is not automatic. Instead, you need to manually run "wpa_action eth0 stop; ifup eth0" to switch networks
wpa_supplicant.conf

To configure WPA to roam between wireless networks, you will need to create a new configuration file:

/etc/wpa_supplicant/wpa_supplicant.conf

a template for this file (and more documentation) is available in:

/usr/share/doc/wpasupplicant/examples/wpa-roam.conf

You'll need to add networks to this file. Examples:

WEP:

network={ ssid="MySSID" key_mgmt=NONE wep_key0="abcdefghijklm"

  1. wep_key0=6162636465 # <- no quotes, so hex number

wep_tx_keyidx=0 id_str="MySSID" }

No key:

network={ ssid="SomeNetwork" key_mgmt=NONE }

WPA:

network={ ssid="Example WPA Network" psk="mysecretpassphrase" id_str="home" }

/etc/network/interfaces

Next, you'll need to edit /etc/network/interfaces. This lets you configure your wireless networks to use dhcp, or other appropriate TCP/IP settings:

auto eth0 iface eth0 inet manual wpa-driver wext wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

  1. MySSID comes from an id_str above.

iface MySSID inet dhcp

  1. default is what's used if there is no id_str setting.
  2. so the 'SomeNetwork' network will use DHCP.

iface default inet dhcp

iface home inet static

  1. static interface settings, or whatever...

Finally, if you want attempts to access the internet to default to eth0 (and not usb0), then comment out this line under usb0 adapter configuration:

gateway 192.168.0.200

For some reason, I had to reboot for the id_str settings to take effect. However, you should now be able to use "ifup eth0" to associate with the access point and "wpa_action eth0 stop" to down the wifi adapter.

Further reading

To use all the possibilities of wpasupplicant like roaming and automatic connection to different networks, you should read /usr/share/doc/wpasupplicant/README.Debian.gz

Bluetooth

The FreeRunner uses the standard Linux bluez stack, installed with

# apt-get install bluez-utils

There is also a module missing from /etc/modules, which is critical to getting your device recognized. (kudos to johnsu01 on irc.freenode.net:#openmoko-debian for the find)

# echo ohci-hcd >> /etc/modules

The first time you try this, you can also

# modprobe ohci-hcd

The only atypical part of using bluetooth on the FreeRunner is turning it on, which can be done with

# echo 1 > /sys/bus/platform/devices/neo1973-pm-bt.0/power_on
# echo 0 > /sys/bus/platform/devices/neo1973-pm-bt.0/reset

Then the device should be visible using

# hcitool dev

Better Xorg

By default debian uses fbdev... But we can use Xglamo:

apt-get install xserver-xglamo

after that edit /etc/X11/xorg.conf and change the line

Driver          "fbdev"

to:

Driver          "Xglamo"

and if you want to run xserver as normal user:

chmod u+s /usr/bin/Xglamo

with that you:

  • can use xrandr
  • don't have the pointer callibration bug with the rotated mode
  • have better performances

Running X as normal user

1. Create a new user

# useradd -m -G audio,dialout,floppy,video,staff username
# passwd username

2. Edit /etc/init.d/zhone-session and change USER=root to USER=username in it. Then to make sure changes are not lost on upgrade, run

dpkg-divert --add /etc/init.d/zhone-session

This will make new versions of /etc/init.d/zhone-session be written to /etc/init.d/zhone-session.distrib

3. Edit /etc/X11/Xwrapper.config and change allowed_users=console to allowed_users=anybody

4. Make apm setuid root so that zhone can do suspend and make it only executable for users in the staff group

dpkg-statoverride --update --add root staff 4750 /usr/bin/apm 

It would also be possible to use sudo, but then you would have to edit /usr/bin/zhone.

Sound

Make sure to put your user in the audio group ("adduser <username> audio").

If there is no error but no sound, try these state files: Talk:Manual_Debian#Sound

How to replace the default kernel with a recent openmoko kernel

If you would like to update to a new kernel, here is a short summary of what to do to update the kernel to an actual OM kernel. But only do this if you know what you are doing. At the moment there is a little problem in the question which kernel to use. Hopefully it will be solved in the near future.

The original openmoko kernel works fine except for the fact that suspending with zhone doesn't work. But this kernel supports different really nice usb gadgets. :)
download stable: http://downloads.openmoko.org/releases/Om2008.8-update/
download testing: http://downloads.openmoko.org/daily/

The new FSO3 kernel works fine and suspend/resume with zhone is also possible. But this kernel still has no loadable usb gadget modules (17-Sep-2008 01:39). :/
download testing: http://downloads.freesmartphone.org/fso-testing/images/
download unstable: http://downloads.freesmartphone.org/fso-unstable/images/

  1. Download a recent kernel and rootfs (tar.gz) from one of the above mentioned sources. It's your decision if you want suspend or usb gadget modules at the moment.
  2. Backup your running kernel like mv /boot/uImage.bin /boot/uImage.bin.old, then
    copy the downloaded uImage file to the freerunner as /boot/uImage.bin.
  3. Backup your actual modules like mv /lib/modules/2.6.24 /lib/modules/2.6.24.old, then
    extract the downloaded rootfs tar.gz to a temporary directory and copy lib/modules/2.6.24 from the temp directory to /lib/modules/2.6.24 on the FreeRunner.
  4. Run a depmod -a.
  5. Do a chown -R root.root /lib/modules/2.6.24 because the owner from the tar.gz is something else.
  6. This step is only needed for the OM kernel but it doesn't harm the FSO kernel setup. Add "g_ether" Module to /etc/modules like echo g_ether >> /etc/modules. I read in an email, that the module "ohci-hcd" is also needed for some bluetooth functions, but i don't know this for real. I inserted it to my modules file to be on the safe side.
  7. Reboot and hope everything works as expected. :)

--User:Pini Sun Sep 28 15:01:46 UTC 2008

  • Actually suspend/resume doesn't work anymore on the Neo Freerunner with the FSO3 kernel starting from september 16th. It does work with the Om2008.8 kernel from september 3rd.

Software

You can install dselect(~2.2MB) or aptitude(~12MB) to visually inspect the available debian packages using the desktop's console.
Also the gtk-based package-manager synaptic(~15.7MB) is probably working.
Finally, on constrained systems, just issue the command:

grep -e Package: -e Description /var/lib/dpkg/available|more

Web Browser

Arne Anka suggested trying the light-weight webkit-based midori browser:

 apt-get install midori

TangoGPS

Main article: TangoGPS


e-book reader

Main article: FBReader


Evince is also available in debian, and handles pdf, djvu, cbz, and other formats.

There is also a hack to convert drm protected adobe ebooks to .cbz files readable with evince, which is mentioned on the mailing list.

XFCE

xfce is small and lightweight and so is quite fast for the FreeRunner.

apt-get install xfce4
cp /etc/init.d/zhone-session /etc/init.d/xfce

Then you may hack /etc/init.d/xfce making

PROG_FSO=/usr/bin/startxfce4

Customize the boot process (this may have to be redone when zhone-session is updated):

update-rc.d -f zhone-session remove
update-rc.d -f xfce defaults

edit your /etc/hosts to have :

127.0.0.1 localhost debian-gta02

Start XFCE !

/etc/init.d/zhone-session stop
/etc/init.d/xfce start

The desktop takes a while to start but once up was snappy as can be expected. I've not yet looked at the reason for the seemingly too slow start for the desktop.

zhone is available from the "Office" menu in xfce. The matchbox keyboard is available in "Accessories".

If you want to display the screen on the long side (ie rotated, 4:3 aspect), add the following to the /etc/X11/xorg.conf in both the Device and InputDevice sections :

 Option          "Rotate"                "CCW"

and then (re)start xfce.

Using matchbox-window-manager with XFCE

XFCE's window manager is poorly configured for use with the FreeRunner. Fortunately, matchbox's window manager is compatible with xfce. To use the matchbox window manager, arrange to run the following commands at X startup. If you followed the instructions above to run X as a normal user, put this in ~/.xinitrc:

  1. !/bin/sh

zhone & matchbox-keyboard-toggle & exec matchbox-window-manager -use_titlebar no -use_cursor no & xfce4-session


TODO: And if I didn't run X as a normal user? (See: To-Do List)

Miscellaneous

Making the cursor invisible

Using matchbox

Matchbox has an option, use_cursor, that can be used to control whether to show the cursor. For the default setup, edit /usr/bin/zhone-session and change the matchbox command to

matchbox-window-manager -use_titlebar no -use_cursor no

Using unclutter

Unclutter is a program that hides the cursor after a period of inactivity. To use unclutter, install it

#apt-get install unclutter

and choose Yes to the question Start unclutter automatically?. To change settings edit /etc/default/unclutter.

Changing the cursor

To make the cursor invisible create a file called empty.cursor with this content:

#define empty.cursor_width 16
#define empty.cursor_height 16
static unsigned char empty.cursor_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

Now you can execute:

xsetroot -cursor empty.cursor empty.cursor

and the cursor will be invisible. To make this permanent you have to invent something ;) It must be executed after zhone has finished starting up.

Running X applications on your desktop in nested X server

Sometimes it is helpful to have a big screen, keyboard and mouse. You can run X applications in a nested X server window. On your desktop install the nested X server application Xephyr (better that Xnest)

apt-get install xserver-xephyr

Run a nested X server as display :1

Xephyr :1 -ac -br -screen 480x640 -reset -terminate &

Now you are able to run apps on your Neo which will display on your desktop PC. Make sure to set the display, for example if "mydesktop" is your desktop hostname

DISPLAY=mydesktop:1 xfce4-session &

Using the mouse and keyboard from your desktop on the OM device

If you are running Linux (or a similar xorg capable operating system) on your Desktop, you can export your xsession to the openmoko device and use your mouse and keyboard on the Neo screen. A little program called x2x makes it even possible to do this simultaneously on the fly. When activated you just move your mouse to the edge of your monitor and then the mouse cursor continues on the screen of your openmoko device. If you select a window on the OM, the input of your keyboard is automatically entered in that window. You can even use the clipboard to copy data from tour desktop to OM and in the reverse direction.

Configure your desktop computer to export your xsession:

On your desktop (with root permissions):
Make sure that sshd is installed and in /etc/ssh/sshd_config you have set
X11Forwarding yes

In K/Ubuntu sshd is in the package openssh-server.

On your OM device install x2x (with root permissions)

apt-get install xauth x2x

Now open a new X terminal on your desktop computer. You MUST be the same user that is running the xsession on your desktop (i.e. do not su to root or another user in your x terminal!). Use the same username that is running an xsession on your OM device. Assuming that you have a usb networking connection to OM (with standard configuration) on the user prompt of your desktop type:

user@desktop:~$ ssh -X openmoko@192.168.0.202 "/usr/bin/x2x -east -to :0.0"

Hit return and enter your password. The xterm window will be unresponsive after that, but keep it open until you disconnect your OM device.

Now move your mouse cursor across the right edge of your monitor. It should enter the screen of your OM device from the left. Of course you can also use -west, -north or -south, depending on your preference where you place your OM.

If computer says:

sh: /usr/X11R6/bin/xauth: No such file or directory
X11 connection rejected because of wrong authentication.
x2x - error: can not open display localhost:11.0

It means you haven't installed xauth on your OM. So on your OM (with root permissions)

apt-get install xauth

Support

Debian is supported on the linux to go smartphone mailing list

Known Issues

apt-get segmentation fault

Whenever you get a segmentation fault while using apt-get or aptitude, clean the database so it will rebuild it

rm /var/cache/apt/*.bin

Why use debian

The point of debian on the freerunner is that you get a huge army of software in a repository, all compiled for the arm processor.

Debian is used on many other embedded devices too and so there's a much larger repository of software already available than in the 2008.8 opkg archives.

You can build your own things without need to play with openembedded.

For example compiling natively is a snap w/ debian, just apt-get gcc&libc-dev (on gentoo too) and not so easy w/ om images :) (borked compiler, borked headers).

Personal tools

Installation

There are "official" instructions on how to install Debian on FreeRunner or Debian on Neo1973 (see the original announcement).

Previous information (partly outdated, now) on how to install Debian manually has been moved to Manual Debian.

See also : http://www.debian.org/ to know more about Debian.

From time to time the Debian packages may be broken, which will cause the install.sh script to fail. Since waiting for the packages to be fixed can take quite a lot of patience, here is an alternative method of getting Debian installed on the FreeRunner.

System

Password

The default root password is blank. You should change that as soon as you can:

# passwd

If entering a blank password does not work at first, try rebooting. If still no success, boot to 2008.08/2007.02, chroot to the micro SD card and set a new password.

Speeding up booting

Note: By default, Debian is already configured to write limited messages to the console during boot. Does this actually speed things up anymore?

What's good for every linux booting is also good for our debian on the freerunner: booting in quiet mode. To do so by default just boot your Neo FreeRunner in NOR-Flash and execute this configure-script: configure-uboot.sh.

It changes default booting to quiet-mode and adds another boot-option to boot without quiet-mode for debugging purpose.

Suspend

Note: As of Sep. 15 2008, suspend works 'out-of-the-box'; installing apm and the idle clock configuration changes do not seem to be necessary any more. Press the power button for two seconds (in zhone) or run 'apm -s' to suspend.

To make suspend available you have to install apmd:

apt-get install apmd

After that you can suspend your phone with:

apm -s

and make it wake up again with pressing the power button.


Issues:

  • Wuth 06:28, 17 August 2008 (UTC): I found that apmd was already installed by using the official debian installation procedure, but that the kernel didn't support apm. I haven't yet resolved this issue. Wuth 05:31, 7 September 2008 (UTC): Worked fine on second install. Perhaps this is no longer a problem.
  • Phyce 21:33, 20 August 2008 (UTC) installed apm without problems; apm -s shutdowns the freerunner but I couldn't wake it up with power button... I had to remove the battery to boot again. suspend/resume was working quite reliably with latest kernels on ASU.

To wake up successfully, the idle-clock of the SD card needs to be enabled right before suspend. It can be disabled again right after resume (this reduces GPS interference). Write into /etc/apm/suspend.d/00sd_idleclk

#!/bin/sh 
echo 1 > /sys/module/glamo_mci/parameters/sd_idleclk 
touch /home/root/.profile

and into /etc/apm/resume.d/00sd_idleclk

#!/bin/sh
echo 0 > /sys/module/glamo_mci/parameters/sd_idleclk 

These are from -stacy on the community list.

And anotherone from Morlac: (more debianish i think ;)
etc/apm/scripts.d/sd_idleclk and corresponding link in /etc/apm/event.d
(don't forget to chmod +x /etc/apm/scripts.d/sd_idleclk)

#!/bin/sh
SD_IDLECLK="/sys/module/glamo_mci/parameters/sd_idleclk"
[ -e "${SD_IDLECLK}" ] || exit 0

case "${1},${2}" in
(suspend,*)
    echo 1 > ${SD_IDLECLK}
    touch /etc
    ;;
(resume,suspend)
    echo 0 > ${SD_IDLECLK}
    ;;
esac

exit 0

Time

The default time zone is UTC. Reconfigure it by running

# dpkg-reconfigure tzdata

To set the clock manually do something like

# date -s 00:33

If you have a network connection, do something like

# apt-get install ntpdate
# ntpdate-debian


Issues:

WLAN

wifi-radar

If you don't want to mess up with configuration files and is looking for an easy gui for wireless configuration, then wifi-radar is what you are looking for.

apt-get install wifi-radar
wifi-radar

If you are looking for more, read on...

Installing prerequisites

Make sure the following packages are installed apt-get install wireless-tools wpasupplicant dhcp3-client

Example configurations

Single network configuration

Assuming your wireless router uses WPA security and DHCP, edit /etc/network/interfaces to include a section like this:

auto eth0
iface eth0 inet dhcp
wpa-driver wext
wpa-ssid "MyWirelessName"
wpa-psk "MyWirelessPassword"

Where, of course, you're using the name of your wireless network and it's password instead of MyWirelessName and MyWirelessPassword.

You can test by running

  1. ifup eth0

You can determine your IP address by running

  1. ifconfig eth0

Issues:

  • only works if in presence of wireless network on boot, or when manually running ifup eth0
  • booting away from wireless network is slower because waits for DHCP to time out
  • does not reestablish connection when leaving wireless area and then returning
  • does not support multiple wireless networks or open hotspots that you may travel between

Once wpa_supplicant has begun managing your wifi interface, you should type "wpa_action eth0 stop" instead of "ifdown eth0".

Roaming configuration

Todo: Which of the issues that single network configurations suffer from are addressed by WPA roaming mode? Would ifplugd / guessnet help, or just make things more complicated?

  • Roaming from network to network is not automatic. Instead, you need to manually run "wpa_action eth0 stop; ifup eth0" to switch networks
wpa_supplicant.conf

To configure WPA to roam between wireless networks, you will need to create a new configuration file:

/etc/wpa_supplicant/wpa_supplicant.conf

a template for this file (and more documentation) is available in:

/usr/share/doc/wpasupplicant/examples/wpa-roam.conf

You'll need to add networks to this file. Examples:

WEP:

network={ ssid="MySSID" key_mgmt=NONE wep_key0="abcdefghijklm"

  1. wep_key0=6162636465 # <- no quotes, so hex number

wep_tx_keyidx=0 id_str="MySSID" }

No key:

network={ ssid="SomeNetwork" key_mgmt=NONE }

WPA:

network={ ssid="Example WPA Network" psk="mysecretpassphrase" id_str="home" }

/etc/network/interfaces

Next, you'll need to edit /etc/network/interfaces. This lets you configure your wireless networks to use dhcp, or other appropriate TCP/IP settings:

auto eth0 iface eth0 inet manual wpa-driver wext wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

  1. MySSID comes from an id_str above.

iface MySSID inet dhcp

  1. default is what's used if there is no id_str setting.
  2. so the 'SomeNetwork' network will use DHCP.

iface default inet dhcp

iface home inet static

  1. static interface settings, or whatever...

Finally, if you want attempts to access the internet to default to eth0 (and not usb0), then comment out this line under usb0 adapter configuration:

gateway 192.168.0.200

For some reason, I had to reboot for the id_str settings to take effect. However, you should now be able to use "ifup eth0" to associate with the access point and "wpa_action eth0 stop" to down the wifi adapter.

Further reading

To use all the possibilities of wpasupplicant like roaming and automatic connection to different networks, you should read /usr/share/doc/wpasupplicant/README.Debian.gz

Bluetooth

The FreeRunner uses the standard Linux bluez stack, installed with

# apt-get install bluez-utils

There is also a module missing from /etc/modules, which is critical to getting your device recognized. (kudos to johnsu01 on irc.freenode.net:#openmoko-debian for the find)

# echo ohci-hcd >> /etc/modules

The first time you try this, you can also

# modprobe ohci-hcd

The only atypical part of using bluetooth on the FreeRunner is turning it on, which can be done with

# echo 1 > /sys/bus/platform/devices/neo1973-pm-bt.0/power_on
# echo 0 > /sys/bus/platform/devices/neo1973-pm-bt.0/reset

Then the device should be visible using

# hcitool dev

Better Xorg

By default debian uses fbdev... But we can use Xglamo:

apt-get install xserver-xglamo

after that edit /etc/X11/xorg.conf and change the line

Driver          "fbdev"

to:

Driver          "Xglamo"

and if you want to run xserver as normal user:

chmod u+s /usr/bin/Xglamo

with that you:

  • can use xrandr
  • don't have the pointer callibration bug with the rotated mode
  • have better performances

Running X as normal user

1. Create a new user

# useradd -m -G audio,dialout,floppy,video,staff username
# passwd username

2. Edit /etc/init.d/zhone-session and change USER=root to USER=username in it. Then to make sure changes are not lost on upgrade, run

dpkg-divert --add /etc/init.d/zhone-session

This will make new versions of /etc/init.d/zhone-session be written to /etc/init.d/zhone-session.distrib

3. Edit /etc/X11/Xwrapper.config and change allowed_users=console to allowed_users=anybody

4. Make apm setuid root so that zhone can do suspend and make it only executable for users in the staff group

dpkg-statoverride --update --add root staff 4750 /usr/bin/apm 

It would also be possible to use sudo, but then you would have to edit /usr/bin/zhone.

Sound

Make sure to put your user in the audio group ("adduser <username> audio").

If there is no error but no sound, try these state files: Talk:Manual_Debian#Sound

How to replace the default kernel with a recent openmoko kernel

If you would like to update to a new kernel, here is a short summary of what to do to update the kernel to an actual OM kernel. But only do this if you know what you are doing. At the moment there is a little problem in the question which kernel to use. Hopefully it will be solved in the near future.

The original openmoko kernel works fine except for the fact that suspending with zhone doesn't work. But this kernel supports different really nice usb gadgets. :)
download stable: http://downloads.openmoko.org/releases/Om2008.8-update/
download testing: http://downloads.openmoko.org/daily/

The new FSO3 kernel works fine and suspend/resume with zhone is also possible. But this kernel still has no loadable usb gadget modules (17-Sep-2008 01:39). :/
download testing: http://downloads.freesmartphone.org/fso-testing/images/
download unstable: http://downloads.freesmartphone.org/fso-unstable/images/

  1. Download a recent kernel and rootfs (tar.gz) from one of the above mentioned sources. It's your decision if you want suspend or usb gadget modules at the moment.
  2. Backup your running kernel like mv /boot/uImage.bin /boot/uImage.bin.old, then
    copy the downloaded uImage file to the freerunner as /boot/uImage.bin.
  3. Backup your actual modules like mv /lib/modules/2.6.24 /lib/modules/2.6.24.old, then
    extract the downloaded rootfs tar.gz to a temporary directory and copy lib/modules/2.6.24 from the temp directory to /lib/modules/2.6.24 on the FreeRunner.
  4. Run a depmod -a.
  5. Do a chown -R root.root /lib/modules/2.6.24 because the owner from the tar.gz is something else.
  6. This step is only needed for the OM kernel but it doesn't harm the FSO kernel setup. Add "g_ether" Module to /etc/modules like echo g_ether >> /etc/modules. I read in an email, that the module "ohci-hcd" is also needed for some bluetooth functions, but i don't know this for real. I inserted it to my modules file to be on the safe side.
  7. Reboot and hope everything works as expected. :)

--User:Pini Sun Sep 28 15:01:46 UTC 2008

  • Actually suspend/resume doesn't work anymore on the Neo Freerunner with the FSO3 kernel starting from september 16th. It does work with the Om2008.8 kernel from september 3rd.

Software

You can install dselect(~2.2MB) or aptitude(~12MB) to visually inspect the available debian packages using the desktop's console.
Also the gtk-based package-manager synaptic(~15.7MB) is probably working.
Finally, on constrained systems, just issue the command:

grep -e Package: -e Description /var/lib/dpkg/available|more

Web Browser

Arne Anka suggested trying the light-weight webkit-based midori browser:

 apt-get install midori

TangoGPS

Main article: TangoGPS


e-book reader

Main article: FBReader


Evince is also available in debian, and handles pdf, djvu, cbz, and other formats.

There is also a hack to convert drm protected adobe ebooks to .cbz files readable with evince, which is mentioned on the mailing list.

XFCE

xfce is small and lightweight and so is quite fast for the FreeRunner.

apt-get install xfce4
cp /etc/init.d/zhone-session /etc/init.d/xfce

Then you may hack /etc/init.d/xfce making

PROG_FSO=/usr/bin/startxfce4

Customize the boot process (this may have to be redone when zhone-session is updated):

update-rc.d -f zhone-session remove
update-rc.d -f xfce defaults

edit your /etc/hosts to have :

127.0.0.1 localhost debian-gta02

Start XFCE !

/etc/init.d/zhone-session stop
/etc/init.d/xfce start

The desktop takes a while to start but once up was snappy as can be expected. I've not yet looked at the reason for the seemingly too slow start for the desktop.

zhone is available from the "Office" menu in xfce. The matchbox keyboard is available in "Accessories".

If you want to display the screen on the long side (ie rotated, 4:3 aspect), add the following to the /etc/X11/xorg.conf in both the Device and InputDevice sections :

 Option          "Rotate"                "CCW"

and then (re)start xfce.

Using matchbox-window-manager with XFCE

XFCE's window manager is poorly configured for use with the FreeRunner. Fortunately, matchbox's window manager is compatible with xfce. To use the matchbox window manager, arrange to run the following commands at X startup. If you followed the instructions above to run X as a normal user, put this in ~/.xinitrc:

  1. !/bin/sh

zhone & matchbox-keyboard-toggle & exec matchbox-window-manager -use_titlebar no -use_cursor no & xfce4-session


TODO: And if I didn't run X as a normal user? (See: To-Do List)

Miscellaneous

Making the cursor invisible

Using matchbox

Matchbox has an option, use_cursor, that can be used to control whether to show the cursor. For the default setup, edit /usr/bin/zhone-session and change the matchbox command to

matchbox-window-manager -use_titlebar no -use_cursor no

Using unclutter

Unclutter is a program that hides the cursor after a period of inactivity. To use unclutter, install it

#apt-get install unclutter

and choose Yes to the question Start unclutter automatically?. To change settings edit /etc/default/unclutter.

Changing the cursor

To make the cursor invisible create a file called empty.cursor with this content:

#define empty.cursor_width 16
#define empty.cursor_height 16
static unsigned char empty.cursor_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

Now you can execute:

xsetroot -cursor empty.cursor empty.cursor

and the cursor will be invisible. To make this permanent you have to invent something ;) It must be executed after zhone has finished starting up.

Running X applications on your desktop in nested X server

Sometimes it is helpful to have a big screen, keyboard and mouse. You can run X applications in a nested X server window. On your desktop install the nested X server application Xephyr (better that Xnest)

apt-get install xserver-xephyr

Run a nested X server as display :1

Xephyr :1 -ac -br -screen 480x640 -reset -terminate &

Now you are able to run apps on your Neo which will display on your desktop PC. Make sure to set the display, for example if "mydesktop" is your desktop hostname

DISPLAY=mydesktop:1 xfce4-session &

Using the mouse and keyboard from your desktop on the OM device

If you are running Linux (or a similar xorg capable operating system) on your Desktop, you can export your xsession to the openmoko device and use your mouse and keyboard on the Neo screen. A little program called x2x makes it even possible to do this simultaneously on the fly. When activated you just move your mouse to the edge of your monitor and then the mouse cursor continues on the screen of your openmoko device. If you select a window on the OM, the input of your keyboard is automatically entered in that window. You can even use the clipboard to copy data from tour desktop to OM and in the reverse direction.

Configure your desktop computer to export your xsession:

On your desktop (with root permissions):
Make sure that sshd is installed and in /etc/ssh/sshd_config you have set
X11Forwarding yes

In K/Ubuntu sshd is in the package openssh-server.

On your OM device install x2x (with root permissions)

apt-get install xauth x2x

Now open a new X terminal on your desktop computer. You MUST be the same user that is running the xsession on your desktop (i.e. do not su to root or another user in your x terminal!). Use the same username that is running an xsession on your OM device. Assuming that you have a usb networking connection to OM (with standard configuration) on the user prompt of your desktop type:

user@desktop:~$ ssh -X openmoko@192.168.0.202 "/usr/bin/x2x -east -to :0.0"

Hit return and enter your password. The xterm window will be unresponsive after that, but keep it open until you disconnect your OM device.

Now move your mouse cursor across the right edge of your monitor. It should enter the screen of your OM device from the left. Of course you can also use -west, -north or -south, depending on your preference where you place your OM.

If computer says:

sh: /usr/X11R6/bin/xauth: No such file or directory
X11 connection rejected because of wrong authentication.
x2x - error: can not open display localhost:11.0

It means you haven't installed xauth on your OM. So on your OM (with root permissions)

apt-get install xauth

Support

Debian is supported on the linux to go smartphone mailing list

Known Issues

apt-get segmentation fault

Whenever you get a segmentation fault while using apt-get or aptitude, clean the database so it will rebuild it

rm /var/cache/apt/*.bin

Why use debian

The point of debian on the freerunner is that you get a huge army of software in a repository, all compiled for the arm processor.

Debian is used on many other embedded devices too and so there's a much larger repository of software already available than in the 2008.8 opkg archives.

You can build your own things without need to play with openembedded.

For example compiling natively is a snap w/ debian, just apt-get gcc&libc-dev (on gentoo too) and not so easy w/ om images :) (borked compiler, borked headers).