Showing posts with label opie. Show all posts
Showing posts with label opie. Show all posts

Wednesday, July 11, 2007

X and OPIE - the saga continues

I decided that the proper way to make X work along side with OPIE is to follow the HowTos/OPIE and GPE.
So after changing -terminal 2 to -terminal 3 in /etc/init.d/opie

I first installed gpe-dm thinking (wrongly) that this will solve the problem,

# ipkg install -d loop0 gpe-dm
# ipkg-link -d loop0 gpe-dm

then ipkg install again to fix the errors. gpe-dm started X which I had to stop from command line by /etc/init.d/gpe-dm stop

I installed gpe-task & gpe-base-depends
# ipkg install -d loop0 gpe-task-base gpe-base-depends
# ipkg-link add bl ; ipkg-link add gpe-base-depends ; ipkg-link add xcursor-transparent-theme ; ipkg-link add detect-stylus ; ipkg-link add esd ; ipkg-link add gpe-autostarter ; ipkg-link add gpe-conf ; ipkg-link add gpe-confd ; ipkg-link add gpe-login ; ipkg-link add gpe-screenshot ; ipkg-link add gpe-soundserver ; ipkg-link add gpe-task-base ; ipkg-link add gpe-theme-industrial ; ipkg-link add gtk-engine-industrial ; ipkg-link add gtk-engine-mist ; ipkg-link add gtk2-theme-angelistic ; ipkg-link add hotplug-dbus ; ipkg-link add ipaq-sleep ; ipkg-link add libfontconfig-utils ; ipkg-link add libgtkstylus ; ipkg-link add libxsettings0 ; ipkg-link add libxss1 ; ipkg-link add matchbox-themes-gtk ; ipkg-link add rxvt-unicode ; ipkg-link add startup-monitor ; ipkg-link add suspend-desktop ; ipkg-link add teleport ; ipkg-link add ttf-bitstream-vera ; ipkg-link add xst
then ipkg install again to fix the errors.

Now reboot, gpe and opie will run after reboot...
Ok, now there is some kind of a problem with fluxbox, so I changed the x-window-session symlink to point to the matchbox-session,
# ln -s /usr/bin/matchbox-session /usr/bin/x-window-manager
Now everything runs fine (but with the matchbox windowmanager).

To disable the the login screen, set AUTOLOGIN to true in /etc/sysconfig/gpelogin

After fixing ~/.profile (removing the exec command from .profile and fixing passwd - see the following post) and linking x-window-manager,
# ln -s /usr/bin/matchbox-session /usr/bin/x-window-manager
fluxbox starts ok.

To prevent from GPE to start on boot remove it from the boot sequence,
# rm /etc/rc5.d/S99gpe-dm

Saturday, July 7, 2007

X and OPIE

The original idea was to setup the X according to endors mini how-to X/Qt on OESF, and then to use Xqt2 as an Xserver. the first part worked fine, but I couldn't convince the Xqt2 server work properly. Then something corrupted the boot sequence and I had te reflash. I installed X again, with some success, but not Xqt2.
The situation after the installation process is that fluxbox hangs during startup in such a way I have to soft-boot the Zaurus (Alt-Home-B). It seems that if I stop OPIE start the X from the command line and go back to OPIE X will start up fine. I thought the problem was memory so I created a swap file -but this didn't solve the problem.
I have found a little bit more about this problem, it seems that in the cases fluxbox hangs it goes into "uninterruptible sleep" ('D' status under top or ps - someone said that D stands for 'Dead'). Apparently there is no way to kill those processes apart of reboot.

first add the X11 feed to /etc/ipkg.conf,

src/gz x11 http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/x11
src/gz x11-old http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4/feed/x11
src/gz upgrades-old http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4/feed/upgrades
Then install (don't forget to ipkg update) xserver-kdrive-fbdev and it's dependencies,
# ipkg install -d loop0 xserver-kdrive-fbdev
# ipkg-link add libxau0 ; ipkg-link add libxdmcp0 ; ipkg-link add libxfont1 ; ipkg-link add xserver-kdrive-fbdev
next, install xserver-common,
# ipkg install -d loop0 xserver-common
# ipkg-link add libexpat0 ; ipkg-link add libfontconfig1 ; ipkg-link add libx11-6 ; ipkg-link add libxcalibrate0 ; ipkg-link add libxext6 ; ipkg-link add libxft2 ; ipkg-link add libxrandr2 ; ipkg-link add libxrender1 ; ipkg-link add libxtst6 ; ipkg-link add xdpyinfo ; ipkg-link add xmodmap ; ipkg-link add xrandr ; ipkg-link add xserver-common ; ipkg-link add xtscal
install xbase-clients
# ipkg install -d loop0 xbase-clients
# ipkg-link add libxmuu1 ; ipkg-link add xauth ; ipkg-link add xhost ; ipkg-link add xrdb ; ipkg-link add xset
install libcairo1,
# ipkg install -d loop0 libcairo1
# ipkg-link add libcairo1 ; ipkg-link add libpixman1
install gpe-session-scripts (this will install GPE),
# ipkg install -d loop0 gpe-session-scripts
# ipkg-link add atd ; ipkg-link add blueprobe ; ipkg-link add bluez-utils-dbus ; ipkg-link add dbus-1 ; ipkg-link add gdk-pixbuf-loader-gif ; ipkg-link add gdk-pixbuf-loader-jpeg ; ipkg-link add gdk-pixbuf-loader-png ; ipkg-link add gdk-pixbuf-loader-xpm ; ipkg-link add glibc-gconv ; ipkg-link add glibc-gconv-iso8859-1 ; ipkg-link add gpe-announce ; ipkg-link add gpe-bluetooth ; ipkg-link add gpe-clock ; ipkg-link add gpe-icons ; ipkg-link add gpe-login ; ipkg-link add gpe-question ; ipkg-link add gpe-session-scripts ; ipkg-link add gtk+ ; ipkg-link add libatk-1.0-0 ; ipkg-link add libaudiofile0 ; ipkg-link add libcontactsdb0 ; ipkg-link add libesd0 ; ipkg-link add libeventdb0 ; ipkg-link add libglade-2.0-0 ; ipkg-link add libgpelaunch0 ; ipkg-link add libgpepimc0 ; ipkg-link add libgpevtype0 ; ipkg-link add libgpewidget1 ; ipkg-link add libice6 ; ipkg-link add libiw28 ; ipkg-link add libmb1 ; ipkg-link add libmimedir-0.3-0 ; ipkg-link add libschedule0 ; ipkg-link add libsm6 ; ipkg-link add libsoundgen1 ; ipkg-link add libsqlite0 ; ipkg-link add libstartup-notification-1-0 ; ipkg-link add libxcursor1 ; ipkg-link add libxfixes0 ; ipkg-link add libxinerama1 ; ipkg-link add libxpm4 ; ipkg-link add libxsettings-client0 ; ipkg-link add matchbox ; ipkg-link add matchbox-applet-inputmanager ; ipkg-link add matchbox-common ; ipkg-link add matchbox-desktop ; ipkg-link add matchbox-panel ; ipkg-link add matchbox-wm ; ipkg-link add pango ; ipkg-link add pango-module-basic-fc ; ipkg-link add pango-module-basic-x ; ipkg-link add xkbd ; ipkg-link add xstroke
to correct the errors:
# mkdir /media/loop0/packages/etc/gtk-2.0 # ln /media/loop0/packages/etc/gtk-2.0 /etc/gtk-2.0 -s
and then rerun,
# ipkg install -d loop0 gpe-session-scripts
remove gpe-login
# ipkg-link remove gpe-login
# ipkg remove gpe-login
fluxbox
To solve the "Interruptible sleep" I tried installing it to the internal memory,
# ipkg install fluxbox-gpe
mrxvt - more than rxvt,
# ipkg install -d loop0 mrxvt
# ipkg-link add mrxvt
OpenSSH
I'll install openssh for the X11 forwarding,
# ipkg install -d loop0 openssh-ssh
# ipkg-link add openssh-ssh

ROX-filer
this package seems to be problematic - the first time I installed it it cause corruption in the filesystem - after fsck.ext2 /media/card/images/loop0 and reinstalling the package for the Zaurus - not by ssh'ing it was installed okay.
# ipkg install rox-filer -d loop0
# ipkg-link add libxml2 ; ipkg-link add rox-filer ; ipkg-link add shared-mime-info
and to fix the errors rerun,
# ipkg install rox-filer -d loop0
In order for rox-filer to work propely the APP_DIR variable needs to be defined,
# export APP_DIR=/usr/share/rox/
startx.sh
I couldn't find the package that provides the startx script so I created one, which sets the DISPLAY and APP_DIR variables and runs Xserver, Xinit, rox-filer and fluxbox.

X/Qt 2
I'll try Xqt once more,
# ipkg install xqt2 -d loop0
# ipkg-link add xqt2
Runing Xqt failed with segmentation fault, when I changed the QWS_DISPLAY to "Transformed:Rot270:0" variable I managed to start Xqt but with the same problems as before (screen is rotated and doesn't get refreshed).

Friday, March 9, 2007

Reflash OZ3.5.4.1

GPE fail to load, so I decided to reflash the whole thing.

Before reflashing, I moved the root folder to root.old.

# mv /home/root /home/root.old
Downloaded the OpenZaurus 3.5.4.1 OPIE Image from ewi546.ewi.utwente.nl mirror and followed the OpenZaurus C7x0/Install Howto.


Loop0 Image:

I have an image on the SD. To create one (512MB):
# dd if=/dev/zero of=ext2.img bs=1024 count=512000
Format the image as ext2: # mkfs.ext2 /media/card/images/loop0.imgCreate a directory to accommodate the mount:
# mkdir /media/loop0
to manually mount the image:
# mount -t ext2 -o loop /media/card/images/loop0.img /media/loop0
add it to fstab so it will be auto-mounted upon reboot, add the following line at the end of /etc/fstab:
/media/card/images/loop0.img /media/loop0 ext2 loop,rw 0
This can be verified by:
# mount /media/loop0
Exit OPIE:
# /etc/init.d/opie stop
Move /home/ and /opt/ directories to loop0:
# mkdir /media/loop0/home
# mv /home/root /media/loop0/home

# ln /media/loop0/home/root /home/root -s

# mv /opt /media/loop0/
# ln /media/loop0/opt /opt -s
Restart OPIE
# /etc/init.d/opie start

Configure USB networking:
I use this Windows XP driver for USB networking (I tried this only with OpenZaurus on Windows XP). Some times the driver crashes, I then reenable USB from the Zaurus side (see below)... sometimes I have to reboot windows...
Zaurus Side (usb0):
ip: 192.168.0.100
Subnet Mask: 255.255.255.0
Gateway: 192.168.0.1
DNS: 192.168.1.1
PC Side:
Make sure the IP 192.168.0.1 is free.
In network settings, advanced tab, enable internet sharing with the Zaurus interface.
settings:
ip: 192.168.0.1
Subnet Mask: 255.255.255.0
Gateway: 192.168.0.100
DNS: 192.168.1.1

EnableUSB:
Create the script enableUSB.sh:
#! /bin/sh
# Check if usb storage module is loaded, if it does remove it.
if ["`lsmod | grep g_file_storage`" != "" ]; then
echo g_file_storage is loaded
echo Unloading g_file_storage
rmmod g_file_storage
fi

# Check if usb networking module is loaded, if it does remove it.
if ["`lsmod | grep g_ether`" != "" ]; then
echo Stopping USB networking module...
echo Unloading g_file_storage
rmmod g_ether
fi

#Load USB networking module:
echo Starting USB networking module...
modprobe g_ether

#Enable the network interface.
echo Bringing up network interface:
ifup usb0
Enable networking
# /media/card/myScripts/enableUSB.sh
To automatically enable networking on reboot:
# ln -s /media/card/myScripts/enableUSB.sh /etc/rcS.d/S49local
For ssh to work a password must be set:
# passwd
Now ssh can connect to the Zaurus from the host computer.

Install to loop0:
In order for ipkg to be able to install packages to loop0 (using the -d loop0 switch) it must be mounted using the ipkg-link, at the end of /etc/ipkg.conf add:
dest loop0 /media/loop0/packages/


Timezone
First, update ipkg:
# ipkg update
Install timezones-asia:
# ipkg install -d loop0 timezones-asia
# ipkg-link add timezones-asia
For some reason /etc/profile does not search for ~/.profile to fix it I added before the export line:
if [ -e "$HOME/.profile" ]; then
. $HOME/.profile
fi
Set the local timezone in ~/.profile
export TZ="Asia/Jerusalem"
Update the clock:
# ntpdate nist1.datum.com

Install
mplayer
# ipkg install -d loop0 mplayer
# ipkg-link add liblzo1; ipkg-link add libmad0; ipkg-link add libmp3lame0; ipkg-link add libsdl-1.2-0; ipkg-link add mplayer; ipkg-link add mplayer-common
The mplayer from the feed is missing the font files (maybe the local fonts can be used...) to have OSD mplayer fonts should be copied to ~/.mplayer/fonts.
Key binding can be configured in input.conf. To see a list of available commands run:
# mplayer -input cmdlist
to see a list of keys:
# mplayer -input keylist
I'm using mpfsr.sh script to run mplayer:
#! /bin/sh

if [ "$1" = "" ]; then
echo "Please supply filename"
else
#disable screen saver and autosleep:
qcop QPE/System 'setScreenSaverMode(int)' 2
qcop QPE/System 'setScreenSaverIntervals(int,int,int)' 0 0 0

#change resolution to 240x320:
fbset -n -xres 240 -yres 320 -match;

#Invert rotation, for some reason with default rotation SDL runs upside down. and then start mplayer:
SDL_QT_INVERT_ROTATION=1 mplayer $@

#change resolution back to normal:
fbset -n -xres 640 -yres 480 -match;

#enable screensaver and autosleep:
qcop QPE/System 'setScreenSaverIntervals(int,int,int)' -1 -1 -1
qcop QPE/System 'setScreenSaverMode(int)' 100

#Update the screen otherwise the screen remains black.
qcop "QPE/System" "applyStyle()";
fi

Add MyScripts and MyApps tabs:
tabs are directories under /opt/QtPalmtop/apps, so to create new tabs:
# mkdir /opt/QtPalmtop/apps/myApps
# mkdir /opt/QtPalmtop/apps/myScripts

A .directory file is also needed to be created for both directories:
[Desktop Entry]
File=/opt/opie/apps/myApps/.directory
Icon=myAppsIcon
Type=application/octet-stream
Name=MyApps
Restart OPIE for the changes to take effect:
# /etc/init.d/opie stop
# /etc/init.d/opie start
Install BASH:
# ipkg install -d loop0 bash
# ipkg-link add bash
The default shell cannot be changed in /etc/passwd, but I can add to ~/.profile:
exec /bin/bash
which will do the trick this is a very bad solution.

To disable the history file, add to .bashrc:
unset HISTFILE

Install less:
less is much better than more...
# ipkg install -d loop0 less
# ipkg-link add less

Install opie-autorotateapplet
I don't like the autorotation feature, and I think it causes problems when closing the hinge, this applet can disable/enable the autorotation "feature"
# ipkg install -d loop0 opie-autorotateapplet
# ipkg-link add opie-autorotateapplet
Install opie-reader
# ipkg install -d loop0 opie-reader
# ipkg-link add opie-reader; ipkg-link add opie-reader-codec-aportis; ipkg-link add opie-reader-codec-arrierego; ipkg-link add opie-reader-codec-chm; ipkg-link add opie-reader-codec-isilo; ipkg-link add opie-reader-codec-plucker; ipkg-link add opie-reader-codec-ppms; ipkg-link add opie-reader-codec-reb; ipkg-link add opie-reader-codec-weasel; ipkg-link add opie-reader-filter-htmlfilter
Hebrew fonts
Install unicode which includes also hebrew fonts:
# ipkg install -d loop0 qte-font-unifont-160
# ipkg-link add qte-font-unifont-160;
ipkg-link add qpf-font-common

Install ZKBApplet
# ipkg install -d loop0 opie-zkbapplet
# ipkg-link add opie-zkbapplet
ZKBApplet requires a XML file with the key definitions. this file should be placed in /opt/QtPalmtop/share/zkb/.

Install opie-clipboardapplet:
# ipkg install -d loop0 opie-clipboardapplet
# ipkg-link add opie-clipboardapplet

Disable LCD Softkeys:
Mark out the entries for the LCD Softkeys in /etc/keymap-2.6.map (lines 121-131).
reboot for the changes to affect.


Install opie-networkapplet

# ipkg install -d loop0 opie-networkapplet
# ipkg-link add opie-networkapplet
Couldn't make this to work...

Install opie-memoryapplet
# ipkg install -d loop0 opie-memoryapplet
# ipkg-link add opie-memoryapplet

Install ScummVM-qpe:

Using the version from the old (OZ3.5.4) feed, all other versions seem to have a problem with the menu key (not working):
# ipkg install -d loop0 /media/card/scummvm-qpe_0.6.1b-r0_arm.ipk
# ipkg-link add libmpeg2; ipkg-link add libogg0; ipkg-link add libvorbisidec1; ipkg-link add scummvm-qpe
At the beginning the cursor is a bit off, to fix that, choose "Fix aspect ratio" under options (in the main screen).
A newer version is installed later


Install Knights
Knights is a front end for the Phalanx chess engine.
# ipkg install -d loop0 knights
# ipkg-link add knights; ipkg-link add phalanx