From Openmoko

Jump to: navigation, search

Just a list of rather random comments used mainly as a bloc notes for me. Please send me any comments -- Stuart Pook.



The entry in /etc/network/interfaces. I use /30 as my home network is I have a local nameserver.

iptables -A FORWARD --in-interface eth7 -j ACCEPT
allow-hotplug eth7
iface eth7 inet static
	up iptables -A POSTROUTING -t nat -s -j MASQUERADE
	up echo 1 > /proc/sys/net/ipv4/ip_forward
	down iptables -D POSTROUTING -t nat -s  -j MASQUERADE
iptables -A FORWARD --out-interface eth7 -j ACCEPT

Installing Debian

I partitioned by hand because of a problem with fdisk. Changing the type of a partition seems to block with the fdisk from Om 2007.

Disk /dev/mmcblk0: 2032 MB, 2032664576 bytes
4 heads, 16 sectors/track, 62032 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

        Device Boot      Start         End      Blocks  Id System
/dev/mmcblk0p1               1       57984     1855480  83 Linux
/dev/mmcblk0p2           57985       62032      129536  82 Linux swap

Well, - v3.0, from fails.

# HOSTNAME=stuart INST_MIRROR= QI=true LOCALEPURGE=true ./  --no-partitioning --swap-size  128 --part1-fs ext3 --with-tasks GAMES,NET,WEB,WIFI,COM all
P: Configuring package apt
P: Configuring helper cdebootstrap-helper-apt
E: Internal error: install explains that you have to download install-info_4.13a.dfsg.1-4_armel.deb in the middle of the installation.

HOSTNAME=stuart QI=true INST_MIRROR= LOCALEPURGE=true /home/root/  --no-partitioning --swap-size 128 --part1-fs ext3 format mount
mkdir /mnt/debian/var /mnt/debian/var/cache  /mnt/debian/var/cache/bootstrap/
mv install-info_4.13a.dfsg.1-4_armel.deb  /mnt/debian/var/cache/bootstrap/
HOSTNAME=stuart QI=true INST_MIRROR= LOCALEPURGE=true /home/root/  --no-partitioning --swap-size 128 --part1-fs ext3 debian apt fso tasks configuration kernel cleanup unmount

Make a tar of /mnt/debian so that I don't have to go through all this agian.

Configuring Debian


Now I have debian on my SD card but the touchscreen doesn't work. says that it might just be a calibration problem. apt-get install libts-bin TSLIB_TSDEVICE=/dev/input/touchscreen0 DISPLAY=:0 /usr/bin/ts_calibrate

Let's read which suggests

# apt-get remove xserver-xorg-input-synaptics

Did apt-get install xserver-xglamo then ran /usr/bin/Xglamo which says

Failed to open TSLib device, tried /dev/ts /dev/touchscreen/0 .
Try setting TSLIB_TSDEVICE to valid /dev entry?

Ok, a link ln -s input/touchscreen0 /dev/ts. /usr/bin/Xglamo works, update /etc/X11/xorg.conf Debian#Xglamo_acceleration and I have a touchscreen that works.


# apt-get remove xserver-xorg-input-wacom


Dropbear looks for /usr/X11R6/bin/xauth [Debian bug] but xauth is in /usr/bin/xauth and /usr/bin/X11/xauth. Make a symlink.

ln -s . /usr/X11R6

Need to read and

I replaced dropbear with openssh-server.


Install connman and edit /etc/dbus-1/system.d/connman.conf to replace user="root" with group="messagebus" otherwise you get the messages 98 wifi     WARNING  can't use wifi service : org.moblin.connman.Error.PermissionDenied: Permission denied 128 Service  ERROR    Can't init service Wifi : org.moblin.connman.Error.PermissionDenied: Permission denied

if you do not run as root.

Connman does not appears to start at boot. Try

cd /etc/rc2.d &&  mv S01connman S10connman


Mokomaze does not work if you are not root. To fix (let me know if this is not right)

chmod 666 /dev/input/event3 /sys/class/leds/neo1973:vibrator/brightness


to get a nice small font (but not too small), ~/.Xresources should contain

URxvt*font: xft:DejaVu Sans Mono:size=4.0

Vala-terminal is better.

network configuration when USB pluged-in

I want to run a program when I plug the USB in. This program will try to workout where I am and setup the domain and http proxy correctly. A script can be run my creating /etc/udev/rules.d/00-usb-stuart.rules<code>

ENV{POWER_SUPPLY_ONLINE}=="1", KERNEL=="usb", RUN+="/bin/sh -c /etc/network/proxy-setup&"

This script is run twice (and perhaps in parallel) so be careful.

http proxy and /etc/resolv.conf setup

This is my first script to automatically set the http and ftp proxies. It also sets the domain so that smtp resolves to a working smtp server. At the moment I am only using USB networking and this program will have to be modified if I want to use both at once.

# written by Stuart Pook
#(/bin/date; echo "$@"; env) >> /tmp/RUN

usb_ip=$(/sbin/ifconfig usb0 | sed -ne 's/ inet addr:\([0-9.]*\) .*/\1/p')
[ "$usb_ip" ] || exit 1

set -- $(host www-cache-in.$domain1)
if netcat -s $usb_ip -z $machine1 $port1
date "+nameserver $domain%n# %c $ACTION $POWER_SUPPLY_ONLINE $SUBSYSTEM $POWER_SUPPLY_NAME" > /etc/resolv.conf

[ -r $env ] && . $env

[ "$http_proxy" ] || exit 1

set -- $(sed -n -e "s .* $http_proxy " -e 's@http://\([0-9][0-9.]*[0-9]\):\([0-9][0-9]*\)@\1 \2@p' -e q /etc/passwd)
[ "$dest" -a "$port" ] || exit 1
iptables -t $table -F $rule
iptables -t $table -I $rule --protocol tcp --dst $dest --dport $port -j DNAT --to-destination $proxy

<code>/etc/environment contains a junk http proxy address and iptables is used to redirect this to a remote proxy if one is required or a proxy on the Freerunner. This avoids using the proxy on the Freerunner if a remote proxy is available and allows me to change the proxy for running programs.


wicd Network Manager

wicd works except thatit uses too much cpu time when the gui is open. forum question



Personal tools