Debian

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Sound)
(add a remark that zhone is dead and phoneui-apps should be used instead)
 
(283 intermediate revisions by 76 users not shown)
Line 1: Line 1:
= Installation =
+
{{Languages|Debian}}
There are "official" instructions on how to install [http://wiki.debian.org/DebianOnFreeRunner Debian on FreeRunner] or [http://wiki.debian.org/DebianOnNeo1973 Debian on Neo1973] (see the [http://lists.linuxtogo.org/pipermail/smartphones-standards/2008-August/000232.html original announcement]).
+
  
Previous information (partly outdated, now) on how to install Debian manually has been moved to [[Manual Debian]].
+
Debian is a ''universal operating system'' used on many other embedded devices, and also on home computers. Using Debian on the FreeRunner gives access to the Huge army of software packaged in the Debian repositories, already compiled for the Neo's arm(v4) processor. Moreover, one can build one's own source files for programs without having to learn the OpenEmbedded way. For example compiling natively is a snap with Debian, just apt-get gcc&libc-dev.
  
See also : http://www.debian.org/ to know more about Debian.
+
For an existing Debian/Ubuntu user, choosing Debian for Neo FreeRunner makes phone a very familiar, trustworthy and flexible place to hack in.
  
= System =
+
'''The bulk of information related to running Debian on FreeRunner is supposed to be at [http://wiki.debian.org/ wiki.debian.org]. For all installation, support or bug reporting needs please see [http://wiki.debian.org/DebianOnFreeRunner DebianOnFreeRunner] in the Debian wiki.'''
== Password ==
+
  
The default root password is blank. You should change that as soon as you can. 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.
+
''The current method of installation, install.sh, is not fail-proof. Work is progressing on a real debian-installer support.'' Please be sure Bash is installed before trying install.sh. The main reason why install.sh fails is because it installs debian unstable which is constantly in motion.
  
== Speeding up booting ==
+
== Screenshot for Manual ==
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: [http://paste.ubuntuusers.de/391456/ configure-uboot.sh].
+
It might be useful to improve this manual with screenshots. You can create screenshots on Debian with [http://www.imagemagick.org ImageMagick]:
 +
  # sudo apt-get install imagemagick
  
It changes default booting to quiet-mode and adds another boot-option to boot without quiet-mode for debugging purpose.
+
Then you can take a screenshot of the full screen with the '''import'''-command:
== 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.
+
  
 +
  # import -window root screenshot.jpg
  
Issues:
+
If you take the screenshot with some delay you have to add the pause parameter (e.g. waiting for  10sec)
* [[User:Wuth|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.
+
  
* [[User:Phyce|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.
+
import -pause 10 -window root screenshot.jpg
 +
 +
== Installation Debian on Freerunner ==
 +
The following steps are a quick installation guide with and installed [[SHR]] on your freerunner and [[Qi]] as bootloader already installed on your freerunner. For further information refer to the [http://wiki.debian.org/DebianOnFreeRunner Debian on Freerunner Wiki] from which this short summary is derived from.  
  
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
+
{{Note|The installation script for Debian, used in the following manual, stopped on SHR with errors. To run a complete Debian installation process it might be necessary to flash the FR with current minimal rootfs for SHR again. You could also try in your [[SHR]] distribution to remove some software packages with [[opkg]] (not tested). Recommended to flash memory with a minimal [[SHR]].}}
#!/bin/sh
+
The following manual was successful with a fresh flash of [[SHR]] in NAND memory.
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 [[User:Morlac|Morlac]]: (more debianish i think ;) <br />
+
=== Installing Qi ===
etc/apm/scripts.d/sd_idleclk and corresponding link in /etc/apm/event.d<br />
+
The following manual needs [[Qi]] to be installed as bootloader. If you more options for using the bootloader usethe [http://wiki.debian.org/DebianOnFreeRunner Debian on Freerunner Wiki] for further details.
(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
+
Switch off you freerunner (if necessary) and start NOR uBoot by pressing AUX and Power-On at the same time and then start [[dfu-util]] on your desktop computer with the following parameters for GTA2:
 +
  # dfu-util -a u-boot -R -D [http://wiki.openmoko.org/wiki/Qi#Download qi-s3c2442-master-hist_3b8513d8b3d9615e.udfu]
 +
See [[Flashing the Neo FreeRunner]] or [[Flashing the Neo 1973]] for more details on flashing your phone.
  
== Time ==
+
=== Online Script Installation ===
 +
==== Login to Freerunner with SHR ====
 +
Login to your freerunner with the booted SHR distribution:
 +
# ssh -X -l root 192.168.0.202
 +
and an [[USB Networking]] connection (e.g. IP-address 192.168.0.202 of your freerunner). Change the IP-address if your network settings differ from this IP-address. Prepare SHR so that you have a working internet connection from your freerunner. This is necessary because SHR will download the Debian packages.
  
The default time zone is UTCReconfigure it by running
+
==== Script Installation and Running install.sh ====
 +
Run the following commands from shell in SHR after ssh-login to freerunner:
 +
  # wget -O install.sh http://pkg-fso.alioth.debian.org/freerunner/install.sh
 +
# chmod +x install.sh
 +
# TASKS="ALL" QI=true ./install.sh all
 +
The following commands above assumes that you have [[Qi]] installed and you want to use a single partition for Debian on freerunner. The SD card (2GB suggested) will be formated by the script. 
 +
* If you want to install Debian with different installation parameters or
 +
*  if you ran into network problems or errors during installation
 +
please see [http://wiki.debian.org/DebianOnFreeRunner DebianOnFreerunner-Wiki] for further details and support.
  
# dpkg-reconfigure tzdata
+
{{Note|The installation could take more than 90 minutes to complete and you will download approximately 250MB on your freerunnner. Time for installation is depending on network speed.}}
  
To set the clock manually do something like
+
After successful installation you will see:
 +
  I: Unmounting - done
 +
  I: All done!
 +
  Now reboot, and hope for the best!
 +
Shutdown SHR operating system with:
 +
# shutdown -h now
 +
Press power on button to start Debian via Qi:
  
# date -s 00:33
+
=== debian4freeunner.tar.gz ===
 +
The online installation process sometimes fails. It is be helpful to an tar.gz-image for Debian that could be extracted to a SD-card with an installed bootloader [[Qi]]
  
If you have a network connection, do something like
+
One such tarball is available here (add others if you have):
  
# apt-get install ntpdate
+
http://people.debian.org/~timo/NeoFreeRunner/ (Debian_NeoFreeRunner_minimalrootfs_20120321.tar.xz)
# ntpdate-debian
+
  
 +
Note that it is a ''minimal'' rootfs, meaning that your first job is to connect to the device over USB cable and install more packages to your liking. Some basic libraries/daemons like FSO2 and omhacks are available, though, and the X starts (pretty much empty) by default via /root/.xsession. Root password is the default 'changeme'.
  
Issues:
+
==== First Login on Debian ====
* That's probably not sufficient to keep the clock accurate. It might be worth configuring some form of NTP.
+
Your Linux Desktop has created RNDIS/Ethernet Interface, configure the interface as in [[USB Networking]] explained:
** Setting the clock could be done via GPS: [[Getting_GPS_console_output_with_gllin#GPRMC_message]]
+
RNDIS/Ethernet Gadget
 +
Now you can login on Debian (if booted) with:
 +
  # ssh -X -l root 192.168.0.202
 +
{{Note|'''(SSH Known Hosts)''' If you have installed other distributions on your Freerunner before, edit '''<tt>.ssh/known_hosts</tt>''' and remove old key for your freerunner. }}
 +
The default password is ''"changeme"'', so change the password directly after first login on your Freerunner with:
 +
  neo# passwd
 +
Then run an update for apt-get
 +
  neo# apt-get update
 +
This could take several minutes depending on network speed.
  
== WLAN ==
+
== Debian Showcase: Desktop Environments And Applications ==
  
Make sure the following packages are installed
+
=== fbpanel + Matchbox ===
# apt-get install wireless-tools wpasupplicant dhcp3-client
+
  
=== An example configuration ===
+
It is not really a Desktop environment, but using fbpanel with Matchbox you can have a fast, lightweight, gtk2 desktop panel.
 +
[[Image:Debian_fbpanel_zhone.png|right|thumb|150px|Debian with fbpanel, matchbox-window-manager and Zhone running, default settings]]
 +
[[Image:Debian5.png|right|thumb|150px|Custom matchbox theme and fbpanel configuration.]]
  
Assuming your wireless router uses WPA security and DHCP,
+
Quick howto:
edit <code>/etc/network/interfaces</code> to include a section like this:
+
<ol><li>Install fbpanel:
 +
<pre>sudo apt-get install fbpanel hicolor-icon-theme</pre></li>
 +
<li>Customize the X startup process:
 +
<pre>~/.xsession</pre>
 
<pre>
 
<pre>
auto eth0
+
#!/bin/sh
iface eth0 inet dhcp
+
export GTK_MODULES=libgtkstylus.so
      wpa-driver wext
+
zhone &
      wpa-ssid "MyWirelessName"
+
xsetroot -solid black
      wpa-psk "MyWirelessPassword"
+
matchbox-keyboard-toggle &
 +
matchbox-window-manager -use_titlebar yes &
 +
# -use_titlebar yes to minimize & toggle between apps
 +
# fbpanel's taskbar does not work with matchbox-window-manager
 +
#~/bin/auxlaunch &
 +
while true;
 +
do
 +
fbpanel;
 +
sleep 1;
 +
done;
 +
</pre></li>
 +
 
 +
<li>Read http://fbpanel.sourceforge.net/docs.html#config
 +
<pre>~/.fbpanel/default</pre>
 +
<pre>
 +
mkdir ~/.fbpanel
 +
cp /etc/fbpanel/default ~/.fbpanel/default
 +
nano ~/.fbpanel/default
 
</pre>
 
</pre>
Where, of course, you're using the name of your wireless network and it's password
+
Remove section with 'taskbar' plugin - it's useless with matchbox-window-manager. You may add plugin 'cpu'
instead of ''MyWirelessName'' and ''MyWirelessPassword''.
+
<pre>Plugin {
 +
type = cpu
 +
}</pre>
 +
Also, plugin 'genmon' is useful:
 +
<pre>Plugin {
 +
type = genmon
 +
config {
 +
Command = echo -e $(grep "MemFree" /proc/meminfo | \
 +
awk '{printf "%0.2f", $2 / 1024}') "|"\
 +
$(cat /proc/loadavg | awk '{print $3}') "|" \
 +
$(apm | awk '{print $5}')
 +
PollingTime = 60
 +
TextSize = small
 +
TextColor = darkblue
 +
}
 +
}</pre>
 +
[[Image:Debian6.png|right|thumb|150px|Custom edje Zhone theme. Click to enlarge]]
 +
After 'killall fbpanel' it will show: free mem in megabytes | loadavg | battery % left.</li>
 +
<li>Default theme is ugly. You can change it and / or make fonts bigger:
 +
<pre>~/.gtkrc-2.0</pre>
 +
<pre>sudo apt-cache search gtk2-engines
 +
sudo apt-get install gtk2-engines gtk-theme-switch
 +
DISPLAY=:0 gtk-theme-switch2</pre>
 +
Now choose your theme, font and save it. To see changes do 'killall fbpanel'. (killall requires psmisc package to be installed)</li></ol>
  
You can test by running
+
=== Illume ===
  # ifup eth0
+
[[Image:Debian_illume_zhone.png|right|thumb|150px|Debian with illume, and Zhone running]]
 +
[[Image:Debian_illume_zhone_kb.png|right|thumb|150px|Debian with illume, and Zhone running, with the on-screen keyboard visible]]
 +
[[Illume]], the desktop environment used in recent openmoko distribution releases, is also available under Debian. It's part of the Enlightenment window manager version 17 (which is currently in the alpha stage of development), which the Debian FSO package maintainers have placed in their repository.  If you have a Debian FSO system running, you can use the following commands to install illume.
  
You can determine your IP address by running
+
  apt-get install e17
  # ifconfig eth0
+
  
Issues:
+
Then use the following commands to ensure that it starts on boot.
* only works if in presence of wireless network on boot, or when manually running <code>ifup eth0</code>
+
* 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
+
  
=== Configuration options ===
+
apt-get remove zhone-session
 +
apt-get install nodm
 +
 +
mv /root/.xsession /root/.xsession.backup
 +
cat << END > /root/.xsession
 +
#!/bin/sh
 +
zhone &
 +
enlightenment_start
 +
END
  
To use all the possibilities of <code>wpasupplicant</code> like roaming and automatic connection to different networks,
+
'''Update 03/2012: zhone is a dead end. For current Debian, install phoneui-apps instead, which support the FSO2 now default in Debian.'''
you should read <code>/usr/share/doc/wpasupplicant/README.Debian.gz</code>
+
  
== Bluetooth ==
+
<br style="clear:both" />
  
The FreeRunner uses the standard Linux bluez stack, installed with
+
=== LXDE ===
# 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)
+
If you want a really nice desktop enviroment but you think XFCE is too fat, you can try to install [http://en.wikipedia.org/wiki/LXDE LXDE]. It give to you the GTK comfort, but use only a fraction of the ram needed by XFCE.
# echo ohci-hcd >> /etc/modules
+
[[Image:Debian_lxde_zhone.png|right|thumb|300px|Debian with lxde and Zhone running]]
 +
To install it:
 +
<pre>apt-get install lxde</pre>
  
The first time you try this, you can also
+
to launch it create a <code>/etc/init.d/lxde</code> script in the same way descripted for xfce4, replacing <code>startxfce4</code> occurrences with <code>startlxde</code>.
# modprobe ohci-hcd
+
<div style="clear:right;">&nbsp;</div>
  
The only atypical part of using bluetooth on the FreeRunner is turning it on, which can be done with
+
=== OpenOffice.org ===
# echo 1 > /sys/bus/platform/devices/neo1973-pm-bt.0/power_on
+
[[Image:Freerunner_Debian_runs_openoffice3.jpg|right|thumb|300px|Debian running OpenOffice.org 3]]
# echo 0 > /sys/bus/platform/devices/neo1973-pm-bt.0/reset
+
  
Then the device should be visible using
+
Did we already mention you can install ''anything'' in Debian?
# hcitool dev
+
  
== Running X as normal user ==
+
<br style="clear:both" />
  
First you need to create a user
+
=== XFCE ===
<pre>
+
The debian installation script installs by default the matchbox window manager. It doesn't feature a desktop environment. '''xfce''' is a small and lightweight desktop environment and so is quite fast for the FreeRunner.
# useradd -m -G audio,dialout,floppy,video username
+
# passwd username
+
</pre>
+
Then you need to stop zhone-session and disable it on boot
+
<pre>
+
# /etc/init.d/zhone-session stop
+
# update-rc.d -f zhone-session remove
+
</pre>
+
  
Now you need to setup autologin and startup of X for the user you created. There are several ways of doing this, one
+
<pre>apt-get install xfce4</pre>
method is using <code>rungetty</code>
+
<pre>
+
# apt-get install rungetty
+
# cp /usr/bin/zhone-session ~username/.xinitrc
+
# chown username. ~username/.xinitrc /tmp/zhone.log
+
</pre>
+
Then edit <code>/etc/inittab</code> and change
+
1:2345:respawn:/sbin/getty 38400 tty1
+
to
+
1:2345:respawn:/sbin/rungetty -u username -g username tty1 /usr/bin/xinit /etc/X11/Xsession /home/username/.xinitrc
+
To activate the change and start up X
+
<pre>
+
# init q
+
# pkill getty
+
</pre>
+
  
== Sound ==
+
Edit your .xsession to launch xfce4 at X startup :
Make sure to put your user is in the audio group.
+
  
If there is no error but no sound, try these state files:
+
<pre>#!/bin/sh
[[Talk:Manual_Debian#Sound]]
+
xfce4-session</pre>
 
+
= Software =
+
== Web Browser ==
+
[http://lists.openmoko.org/nabble.html#nabble-td781547 Arne Anka suggested] trying the light-weight webkit-based [http://en.wikipedia.org/wiki/Midori_(browser) midori] browser:
+
  apt-get midori
+
 
+
== TangoGPS ==
+
{{main|TangoGPS}}
+
== e-book reader ==
+
{{main|FBReader}}
+
 
+
== XFCE ==
+
 
+
xfce is small and lightweight and so 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
+
  
 +
Edit section [Failsafe Session] of /etc/xdg/xfce4-session/xfce4-session.rc (or ~/.config/xfce4-session/xfce4-session.rc) to handle the auto-started apps. For example:
 +
<pre>[Failsafe Session]
 +
Count=3
 +
Client0_Command=xfce4-panel
 +
Client0_PerScreen=False
 +
Client1_Command=xfdesktop
 +
Client1_PerScreen=False
 +
Client2_Command=zhone
 +
Client2_PerScreen=True</pre>
 
Start XFCE !
 
Start XFCE !
  
/etc/init.d/zhone-session stop
+
<pre>/etc/init.d/nodm restart</pre>
/etc/init.d/xfce start
+
  
 
The desktop takes a while to start but once up was snappy as can be expected.
 
The desktop takes a while to start but once up was snappy as can be expected.
Line 210: Line 215:
 
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 :
 
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"
+
<pre>Option          "Rotate"                "CCW"</pre>
  
 
and then (re)start xfce.
 
and then (re)start xfce.
  
= Miscellaneous =
+
If you want to be able to shutdown/restart the device, add the following line to ''/etc/sudoers'' (don't forget to replace ''username'' with your actual username):
== Making the cursor invisible ==
+
<pre>username localhost = NOPASSWD: /usr/sbin/xfsm-shutdown-helper</pre>
 
+
=== Using matchbox ===
+
 
+
Matchbox has an option, <code>use_cursor</code>, that can be used to control whether to show the cursor.
+
For the default setup, edit <code>/usr/bin/zhone-session</code> 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 <code>Start unclutter automatically?</code>. To change settings edit
+
<code>/etc/default/unclutter</code>.
+
 
+
=== 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.
+
 
+
== 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 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.
+
''' Using matchbox-window-manager with XFCE '''
  
If computer says:
+
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, modify ~/.xsession as follows:
  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 istalled xauth on your OM. So on your OM (with root permissions)
+
<pre>#!/bin/sh
apt-get install xauth
+
exec matchbox-window-manager -use_titlebar no -use_cursor no &
 +
xfce4-session</pre>
  
=Known Issues=
+
== Derivative Distributions of Debian ==
  
TBA
+
Several distributions are sharing Debian's infrastructure - this is long known. For the Openmoko,
 +
* [[Fyp]] extends the basic Debian installation while avoiding the need of an SD
 +
* [[Hackable1]] focuses on GNOME Mobile integration
 +
* [[Mer]] : based on [[Maemo]] ; see demo and download image at http://www.newlc.com/en/mer-best-maemo-debianubuntu-mobiles-watch-freerunner-demo
 +
* [[QtMoko]] - Debian with Qt Extended Improved plus configuration changes put manually on top of it
 +
* [[Telefoninux]] http://telefoninux.projects.openmoko.org/index.html
 +
* [[Deb19]] - pre-configured, ready to copy to SD, Debian with improvements. No install.sh required.
  
[[Category:Debian]]
+
[[Category:Debian| ]]
[[Category:Documentation]]
+

Latest revision as of 05:48, 26 March 2012


Debian is a universal operating system used on many other embedded devices, and also on home computers. Using Debian on the FreeRunner gives access to the Huge army of software packaged in the Debian repositories, already compiled for the Neo's arm(v4) processor. Moreover, one can build one's own source files for programs without having to learn the OpenEmbedded way. For example compiling natively is a snap with Debian, just apt-get gcc&libc-dev.

For an existing Debian/Ubuntu user, choosing Debian for Neo FreeRunner makes phone a very familiar, trustworthy and flexible place to hack in.

The bulk of information related to running Debian on FreeRunner is supposed to be at wiki.debian.org. For all installation, support or bug reporting needs please see DebianOnFreeRunner in the Debian wiki.

The current method of installation, install.sh, is not fail-proof. Work is progressing on a real debian-installer support. Please be sure Bash is installed before trying install.sh. The main reason why install.sh fails is because it installs debian unstable which is constantly in motion.

Contents

[edit] Screenshot for Manual

It might be useful to improve this manual with screenshots. You can create screenshots on Debian with ImageMagick:

 # sudo apt-get install imagemagick

Then you can take a screenshot of the full screen with the import-command:

 # import -window root screenshot.jpg

If you take the screenshot with some delay you have to add the pause parameter (e.g. waiting for 10sec)

import -pause 10 -window root screenshot.jpg

[edit] Installation Debian on Freerunner

The following steps are a quick installation guide with and installed SHR on your freerunner and Qi as bootloader already installed on your freerunner. For further information refer to the Debian on Freerunner Wiki from which this short summary is derived from.

NOTE: The installation script for Debian, used in the following manual, stopped on SHR with errors. To run a complete Debian installation process it might be necessary to flash the FR with current minimal rootfs for SHR again. You could also try in your SHR distribution to remove some software packages with opkg (not tested). Recommended to flash memory with a minimal SHR.


The following manual was successful with a fresh flash of SHR in NAND memory.

[edit] Installing Qi

The following manual needs Qi to be installed as bootloader. If you more options for using the bootloader usethe Debian on Freerunner Wiki for further details.

Switch off you freerunner (if necessary) and start NOR uBoot by pressing AUX and Power-On at the same time and then start dfu-util on your desktop computer with the following parameters for GTA2:

 # dfu-util -a u-boot -R -D qi-s3c2442-master-hist_3b8513d8b3d9615e.udfu

See Flashing the Neo FreeRunner or Flashing the Neo 1973 for more details on flashing your phone.

[edit] Online Script Installation

[edit] Login to Freerunner with SHR

Login to your freerunner with the booted SHR distribution:

# ssh -X -l root 192.168.0.202

and an USB Networking connection (e.g. IP-address 192.168.0.202 of your freerunner). Change the IP-address if your network settings differ from this IP-address. Prepare SHR so that you have a working internet connection from your freerunner. This is necessary because SHR will download the Debian packages.

[edit] Script Installation and Running install.sh

Run the following commands from shell in SHR after ssh-login to freerunner:

# wget -O install.sh http://pkg-fso.alioth.debian.org/freerunner/install.sh
# chmod +x install.sh
# TASKS="ALL" QI=true ./install.sh all

The following commands above assumes that you have Qi installed and you want to use a single partition for Debian on freerunner. The SD card (2GB suggested) will be formated by the script.

  • If you want to install Debian with different installation parameters or
  • if you ran into network problems or errors during installation

please see DebianOnFreerunner-Wiki for further details and support.

NOTE: The installation could take more than 90 minutes to complete and you will download approximately 250MB on your freerunnner. Time for installation is depending on network speed.


After successful installation you will see:

 I: Unmounting - done
 I: All done!
 Now reboot, and hope for the best!

Shutdown SHR operating system with:

# shutdown -h now

Press power on button to start Debian via Qi:

[edit] debian4freeunner.tar.gz

The online installation process sometimes fails. It is be helpful to an tar.gz-image for Debian that could be extracted to a SD-card with an installed bootloader Qi

One such tarball is available here (add others if you have):

http://people.debian.org/~timo/NeoFreeRunner/ (Debian_NeoFreeRunner_minimalrootfs_20120321.tar.xz)

Note that it is a minimal rootfs, meaning that your first job is to connect to the device over USB cable and install more packages to your liking. Some basic libraries/daemons like FSO2 and omhacks are available, though, and the X starts (pretty much empty) by default via /root/.xsession. Root password is the default 'changeme'.

[edit] First Login on Debian

Your Linux Desktop has created RNDIS/Ethernet Interface, configure the interface as in USB Networking explained:

RNDIS/Ethernet Gadget 

Now you can login on Debian (if booted) with:

 # ssh -X -l root 192.168.0.202
NOTE: (SSH Known Hosts) If you have installed other distributions on your Freerunner before, edit .ssh/known_hosts and remove old key for your freerunner.


The default password is "changeme", so change the password directly after first login on your Freerunner with:

 neo# passwd

Then run an update for apt-get

 neo# apt-get update

This could take several minutes depending on network speed.

[edit] Debian Showcase: Desktop Environments And Applications

[edit] fbpanel + Matchbox

It is not really a Desktop environment, but using fbpanel with Matchbox you can have a fast, lightweight, gtk2 desktop panel.

Debian with fbpanel, matchbox-window-manager and Zhone running, default settings
Custom matchbox theme and fbpanel configuration.

Quick howto:

  1. Install fbpanel:
    sudo apt-get install fbpanel hicolor-icon-theme
  2. Customize the X startup process:
    ~/.xsession
    #!/bin/sh
    export GTK_MODULES=libgtkstylus.so
    zhone &
    xsetroot -solid black
    matchbox-keyboard-toggle &
    matchbox-window-manager -use_titlebar yes &
    # -use_titlebar yes to minimize & toggle between apps
    # fbpanel's taskbar does not work with matchbox-window-manager
    #~/bin/auxlaunch &
    while true;
    do
    fbpanel;
    sleep 1;
    done;
    
  3. Read http://fbpanel.sourceforge.net/docs.html#config
    ~/.fbpanel/default
    mkdir ~/.fbpanel
    cp /etc/fbpanel/default ~/.fbpanel/default
    nano ~/.fbpanel/default
    

    Remove section with 'taskbar' plugin - it's useless with matchbox-window-manager. You may add plugin 'cpu'

    Plugin {
    type = cpu
    }

    Also, plugin 'genmon' is useful:

    Plugin {
    type = genmon
    config {
    Command = echo -e $(grep "MemFree" /proc/meminfo | \
     awk '{printf "%0.2f", $2 / 1024}') "|"\
    $(cat /proc/loadavg | awk '{print $3}') "|" \
     $(apm | awk '{print $5}')
    PollingTime = 60
    TextSize = small
    TextColor = darkblue
    }
    }
    Custom edje Zhone theme. Click to enlarge
    After 'killall fbpanel' it will show: free mem in megabytes | loadavg | battery % left.
  4. Default theme is ugly. You can change it and / or make fonts bigger:
    ~/.gtkrc-2.0
    sudo apt-cache search gtk2-engines
    sudo apt-get install gtk2-engines gtk-theme-switch
    DISPLAY=:0 gtk-theme-switch2
    Now choose your theme, font and save it. To see changes do 'killall fbpanel'. (killall requires psmisc package to be installed)

[edit] Illume

Debian with illume, and Zhone running
Debian with illume, and Zhone running, with the on-screen keyboard visible

Illume, the desktop environment used in recent openmoko distribution releases, is also available under Debian. It's part of the Enlightenment window manager version 17 (which is currently in the alpha stage of development), which the Debian FSO package maintainers have placed in their repository. If you have a Debian FSO system running, you can use the following commands to install illume.

apt-get install e17

Then use the following commands to ensure that it starts on boot.

apt-get remove zhone-session
apt-get install nodm

mv /root/.xsession /root/.xsession.backup 
cat << END > /root/.xsession
#!/bin/sh
zhone &
enlightenment_start
END

Update 03/2012: zhone is a dead end. For current Debian, install phoneui-apps instead, which support the FSO2 now default in Debian.


[edit] LXDE

If you want a really nice desktop enviroment but you think XFCE is too fat, you can try to install LXDE. It give to you the GTK comfort, but use only a fraction of the ram needed by XFCE.

Debian with lxde and Zhone running

To install it:

apt-get install lxde

to launch it create a /etc/init.d/lxde script in the same way descripted for xfce4, replacing startxfce4 occurrences with startlxde.

 

[edit] OpenOffice.org

Debian running OpenOffice.org 3

Did we already mention you can install anything in Debian?


[edit] XFCE

The debian installation script installs by default the matchbox window manager. It doesn't feature a desktop environment. xfce is a small and lightweight desktop environment and so is quite fast for the FreeRunner.

apt-get install xfce4

Edit your .xsession to launch xfce4 at X startup :

#!/bin/sh
xfce4-session

Edit section [Failsafe Session] of /etc/xdg/xfce4-session/xfce4-session.rc (or ~/.config/xfce4-session/xfce4-session.rc) to handle the auto-started apps. For example:

[Failsafe Session]
Count=3
Client0_Command=xfce4-panel
Client0_PerScreen=False
Client1_Command=xfdesktop
Client1_PerScreen=False
Client2_Command=zhone
Client2_PerScreen=True

Start XFCE !

/etc/init.d/nodm restart

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.

If you want to be able to shutdown/restart the device, add the following line to /etc/sudoers (don't forget to replace username with your actual username):

username localhost = NOPASSWD: /usr/sbin/xfsm-shutdown-helper

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, modify ~/.xsession as follows:

#!/bin/sh
exec matchbox-window-manager -use_titlebar no -use_cursor no &
xfce4-session

[edit] Derivative Distributions of Debian

Several distributions are sharing Debian's infrastructure - this is long known. For the Openmoko,

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.

System

Password

The default root password is blank. You should change that as soon as you can. 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

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

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.
  • 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

Make sure the following packages are installed

# apt-get install wireless-tools wpasupplicant dhcp3-client

An example 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

# ifup eth0

You can determine your IP address by running

# 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

Configuration options

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

Running X as normal user

First you need to create a user

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

Then you need to stop zhone-session and disable it on boot

# /etc/init.d/zhone-session stop
# update-rc.d -f zhone-session remove

Now you need to setup autologin and startup of X for the user you created. There are several ways of doing this, one method is using rungetty

# apt-get install rungetty
# cp /usr/bin/zhone-session ~username/.xinitrc
# chown username. ~username/.xinitrc /tmp/zhone.log

Then edit /etc/inittab and change

1:2345:respawn:/sbin/getty 38400 tty1

to

1:2345:respawn:/sbin/rungetty -u username -g username tty1 /usr/bin/xinit /etc/X11/Xsession /home/username/.xinitrc

To activate the change and start up X

# init q
# pkill getty

Sound

Make sure to put your user is in the audio group.

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

Software

Web Browser

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

 apt-get midori

TangoGPS

Main article: TangoGPS


e-book reader

Main article: FBReader


XFCE

xfce is small and lightweight and so 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.

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.

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 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 istalled xauth on your OM. So on your OM (with root permissions)

apt-get install xauth 

Known Issues

TBA