SHR

From WikiMwyann

Jump to: navigation, search

This page describes tips, tricks and fixes for SHR on an Openmoko Freerunner. I tested these tips on my phone.

Contents

Problems and workarounds

  • WEP Wifi freezes the phone. Workaround : install the kernel version kernel_2.6.24+gitr76014+fb42ce6724576fc173faf8abfb04aa2c36d213b7-r2.01_om-gta02 that can be found at http://downloads.openmoko.org/repository/Om2008.8/om-gta02/. Of course you just have to install the kernel* files (not the big vmlinux file) witk --force-downgrade option. Seems to break Bluetooth, but I prefer to have Wifi than Bluetooth. If it's not your case, don't do the downgrade. Also I noticed a bit speed up, but it's probably me...
  • For non-US people (specially French people) you can find more tips at http://openmoko-fr.org/wiki/index.php/SHR.

Useful scripts

Rotate

This script is used to rotate the screen just by tapping an icon on the screen.

/usr/local/rotatenow/rotate.sh

#!/bin/sh

log="/var/volatile/tmp/rotate.log"
status=$(cat $log)

newStatus=$(($status+3))
if [ $newStatus -eq 6 ]
then
        newStatus=0
fi
echo $newStatus > $log
echo $newStatus

sh /usr/local/rotatenow/rotateNow.sh &

/usr/local/rotatenow/rotateNow.sh

#!/bin/sh

log="/var/volatile/tmp/rotate.log"
sleep 1
newStatus=$(cat $log)
xrandr -o $newStatus

/usr/share/applications/rotate.desktop

[Desktop Entry]
Encoding=UTF-8
Name=Rotate
Comment=Rotate the screen
Exec=/usr/local/rotatenow/rotate.sh
Icon=Accel-rotate-fdom80
Terminal=false
Type=Application
Categories=Application;Utilities;
SingleInstance=true
StartupNotify=true

Set Wifi

Uses zenity for GUI displaying.

/usr/local/setwifi/setwifi.sh

#!/bin/sh

IFS="
"
echo \# Enabling WiFi...
/usr/bin/mdbus -s org.freesmartphone.odeviced /org/freesmartphone/Device/PowerControl/WiFi org.freesmartphone.Resource.Enable
echo 10
echo \# Scanning wifi ap...
wifilist=`iwlist eth0 scan | grep ESSID: | colrm 1 26 | tr -d '"'`
if [ "$wifilist" != "" ]; then
paramlist=`ls ~/.wifi/*.wifi | sort`
availablelist=""
echo 40
echo \# Reading wifi settings...
for w in $wifilist; do
param=`echo "$paramlist" | grep "\.$w\.wifi"`
if [ "$param" != "" ]; then
echo 60
echo \# Found parameters for $w
availablelist="$availablelist
$param"
fi
done
if [ "$availablelist" != "" ]; then
availablelist=`echo "$availablelist" | sort | grep wifi | head -n 1`
echo 80
echo \# Setting up wifi parameters
sh $availablelist
networkname=`echo "$availablelist" | sed 's/^.*wifi\/[^\.]*\.//' | sed 's/\.wifi$//'`
echo 100
echo \# Wifi OK, connected to $networkname.
else
echo 100
echo \# No Wifi parameters found.
fi
else
echo 100
echo \# No Wifi found.
fi

/usr/local/setwifi/setwifigui.sh

#!/bin/sh

/usr/local/setwifi/setwifi.sh | zenity --progress --title="Set WiFi" --text="Loading..." --percentage=0 --auto-close

/usr/share/applications/setwifi.desktop

[Desktop Entry]
Encoding=UTF-8
Name=Set WiFi
Comment=Autoset WiFi params
Exec=/usr/local/setwifi/setwifigui.sh
Icon=Icon-wifi
Terminal=false
Type=Application
Categories=Application;Utilities;
SingleInstance=true
StartupNotify=true

For example: /home/root/.wifi/10.Mwyann.wifi

#!/bin/sh

wmiconfig -i eth0 --power maxperf
iwconfig eth0 key 12345 restricted
iwconfig eth0 essid Mwyann
udhcpc eth0

Full install

If you want to apply all these tips (including AZERTY keyboards, French dictionnary and CET/CEST timezone), follow this (assuming your host is a Linux machine with ip forwarding and masquerading activated):

dfu-util -a kernel -R -D uImage-2.6.29-oe11+gitr119861+b90406de472c1aa5371ab593a2bb79136d5de658-r6-om-gta02.bin
dfu-util -a rootfs -R -D shr-lite-eglibc-ipk--20091209-om-gta02.rootfs.jffs2
  • Boot the Neo, answer the first-launch questions, and when finished, go into the settings and deactivate auto-suspend.
  • Plug your Neo on the host by using the USB cable and type in these commands on the host (as root, and assuming eth1 is the eth device of the Neo):
ifconfig eth1 192.168.0.200
route add -host 192.168.0.202 dev eth1
  • ssh into the Neo by issuing this command:
ssh root@192.168.0.202
  • If your ssh client complains about an offending key and won't connect at all, check your ~/.ssh/known_hosts file.
  • Type this into your Neo:
mkdir /media/card/reinstall
cd /media/card/reinstall
pico reinstall-shr
  • Type this as the content of the file, and save it.
#!/bin/sh

ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
opkg update
cd /media/card
dd if=/dev/zero of=swapfile.swp bs=1k count=256000
mkswap swapfile.swp
swapon swapfile.swp
yes | opkg --force-overwrite upgrade
swapoff swapfile.swp

echo Now reboot please. Then run the next reinstall script.
  • Now type:
pico reinstall-shr2
  • File content (of course you can customize it):
#!/bin/sh

swapon /media/card/swapfile.swp
cd /
tar xvf /media/card/reinstall/opkg-shr.tar
opkg update
yes | opkg install --force-downgrade --force-overwrite /media/card/reinstall/kernel/*
yes | opkg install --force-overwrite ntpdate util-linux-ng
rm -f `find /etc | grep ntpdate | grep rc`
yes | opkg install --force-overwrite alsa-conf alsa-lib alsa-server alsa-utils alsa-utils-aconnect alsa-utils-alsaconf alsa-utils-aseqdump alsa-utils-aseqnet alsa-utils-iecset alsa-utils-midi alsa-utils-speakertest
yes | opkg install --force-overwrite pidgin libpurple-protocol-msn libpurple-protocol-yahoo mokonnect
yes | opkg install --force-overwrite gpe-calendar gpe-contacts gpe-filemanager gpe-gallery gpe-scap gpe-sketchbook gpe-timesheet gpe-todo
yes | opkg install --force-overwrite gcc gcc-symlinks cpp cpp-symlinks g++ g++-symlinks make binutils binutils-symlinks coreutils
yes | opkg install --force-overwrite -force-depends /media/card/reinstall/apps/*
tar xvf /media/card/reinstall/config-shr.tar
# Manual fixes:
cd /home/root/
unzip /media/card/reinstall/gxrom-r.zip
cd /usr/lib
ln -s libmikmod.so.3.0.0 libmikmod.so.2
mv /usr/share/applications/edit-vcard.desktop /usr/share/applications/edit-vcard.desktop.disabled
swapoff /media/card/swapfile.swp

echo Now reboot again, and you\'re done. You can use opkg update after rebooting.
echo Dont\' even think about upgrading, or disable external feeds in /etc/opkg/armv4t-feed.conf
echo If needed, you can use /media/card/swapfile.swp, it\'s a 256 MB swap file. Don\'t use it too much though.
  • Now type :
chmod +x reinstall-shr*
  • You'll need to create two tar files that will be extracted at reinstall time : config-shr.tar and opkg-shr.tar. The contents of these files for me are as follows :
opkg-shr.tar:
etc/opkg/
etc/opkg/armv4-feed.conf
etc/opkg/all-feed.conf
etc/opkg/om-gta02-feed.conf
etc/opkg/armv4t-feed.conf
etc/opkg/opkg.conf
etc/opkg/arch.conf

config-shr.tar:
etc/hostname
etc/network/interfaces
etc/default/dropbear
usr/lib/enlightenment/modules/illume/dicts/French.dic
usr/lib/enlightenment/modules/illume/keyboards/Azerty.kbd
usr/lib/enlightenment/modules/illume/keyboards/azerty.png
etc/opkg/all-feed.conf
etc/opkg/arch.conf
etc/opkg/armv4-feed.conf
etc/opkg/armv4t-feed.conf
etc/opkg/om-gta02-feed.conf
etc/opkg/opkg.conf
etc/samba/smb.conf
etc/profile
usr/share/applications/rotate.desktop
usr/local/rotatenow/
usr/local/rotatenow/rotate.sh
usr/local/rotatenow/rotateNow.sh
usr/share/icons/shr/86x86/apps/Accel-rotate-fdom80.png
usr/share/icons/shr/86x86/apps/vlc.png
usr/local/ledclock/ledclock.py
  • Also you'll need the kernel files from http://downloads.openmoko.org/repository/Om2008.8/om-gta02/ into the /media/card/reinstall/kernel/ directory (all kernel* files but vmlinux). And finally, the /media/card/reinstall/apps/ contains some applications already downloaded that you want to install. For example, here are the ones I choosed:
fsoraw_0.01a-svn13-ant1_armv4t.ipk
gtk+_2.16.4-r0.3_armv4t.ipk
guitartune_0.30_arm.ipk
gwaterpas_0.3_armv4t.ipk
ledclock_0.7_all.ipk
liba52-0_0.7.4-r1.3_armv4t.ipk
libasound2_1.0.20-r0.3_armv4t.ipk
libavahi-client3_0.6.24-r1.3_armv4t.ipk
libavahi-common3_0.6.24-r1.3_armv4t.ipk
libavcodec52_0.5-r2.3_armv4t.ipk
libavformat52_0.5-r2.3_armv4t.ipk
libavutil49_0.5-r2.3_armv4t.ipk
libc6_2.9-r32.0.3_armv4t.ipk
libdvdcss2_1.2.10-r1.2_armv4t.ipk
libdvdread3_0.9.7-r1.2_armv4t.ipk
libfaac0_1.24-r0.3_armv4t.ipk
libfftw3-3_3.1.2-r1_armv4t.ipk
libfltk_1.1.9-0_armv4t.ipk
libgcc1_4.3.3-r5.1.3_armv4t.ipk
libgcrypt11_1.4.1-r0.3_armv4t.ipk
libgdbm3_1.8.3-r3.3_armv4t.ipk
libgio-2.0-0_2.20.4-r0.3_armv4t.ipk
libglib-2.0-0_2.20.4-r0.3_armv4t.ipk
libgmodule-2.0-0_2.20.4-r0.3_armv4t.ipk
libgnutls26_2.4.2-r4.3_armv4t.ipk
libgobject-2.0-0_2.20.4-r0.3_armv4t.ipk
libgsm1_1.0.12-r0.3_armv4t.ipk
libgthread-2.0-0_2.20.4-r0.3_armv4t.ipk
libmp3lame0_3.96.1-r4.3_armv4t.ipk
libmpeg2-0_0.4.0b-r4.2_armv4t.ipk
libnotify_0.4.4-r0.3_armv4t.ipk
libode1_0.11.1-r1_armv4t.ipk
libosso1_2.13-r2.2_armv4t.ipk
libpixman-1-0_0.15.16-r1+gitrf9660ce29ed072c6cbaec711c5d18b9f0ba113ae.3_armv4t.ipk
libpng12-0_1.2.35-r0.3_armv4t.ipk
libpopt0_1.14-r2.3_armv4t.ipk
libpostproc51_0.5-r2.3_armv4t.ipk
libproxy_0.2.3-r0.3_armv4t.ipk
libpulse0_0.9.15-r8.4.3_armv4t.ipk
libpulsecommon_0.9.15-r8.4.3_armv4t.ipk
libqtcore4_4.5.1-r10.1.2_armv4t.ipk
libqtgui4_4.5.1-r10.1.2_armv4t.ipk
libreadline5_5.2-r4.3_armv4t.ipk
libschroedinger-1.0-0_1.0.5-r1.3_armv4t.ipk
libsmbclient0_3.3.0-r3.3_armv4t.ipk
libspeex1_1.1+1.2rc1-r0.3_armv4t.ipk
libstdc++6_4.3.3-r5.1.3_armv4t.ipk
libswscale0_0.5-r2.3_armv4t.ipk
libsysfs2_2.1.0-r1.3_armv4t.ipk
libtheora0_1.0-r3.3_armv4t.ipk
libupnp3_1.6.5-r1.2_armv4t.ipk
libuuid1_2.16-r7.3_armv4t.ipk
libvlc2_0.9.8a-r3.2_armv4t.ipk
libvorbis_1.2.0-1.3_armv4t.ipk
libxmu6_1.0.4-r1.3_armv4t.ipk
libxt6_1.0.5-r2.3_armv4t.ipk
libxv1_1.0.4-r1.3_armv4t.ipk
mikmod_3.2.2-beta1-r1.3_armv4t.ipk
minimo_0.02+cvs20070626-r0_armv4t.ipk
mokomaze_0.5.5+git8-r1_armv4t.ipk
mokox48_1.0_arm_2008.8.ipk
mplayer_0.0+1.0rc2-r12.3_armv4t.ipk
mplayer-common_0.0.1-r0.3_armv4t.ipk
pango_1.24.4-r0.3_armv4t.ipk
samba_3.3.0-r3.3_armv4t.ipk
vlc_0.9.8a-r3.2_armv4t.ipk
x11vnc_0.9.7-r0.3_armv4t.ipk
  • Now you just have to run reinstall-shr, then reboot then re-activate USB and finally run reinstall-shr2. You should run these using screen to avoid problem if you have to lose connection to the terminal somehow.
Personal tools