A new old Laptop to test iloog:
A few days ago my friend Dimitris gave me his old Sony Vaio PCG-SR21K since he didn’t need it any more.
Specs:
Mobile Pentium III/650 with SpeedStep technology and 256Kb of on-die Level 2 cache, 64Mb of PC100 SDRAM, Intel 440Z motherboard chipset, fixed 10Gb IBM Travelstar DJSA-210 hard disk, external 16x CD-ROM, 8Mb S3 Savage/IX graphics, 10.4in XGA TFT screen, Yamaha DS-XG audio, integrated stereo speakers, integrated V.90 modem, one Type II PC Card slot, expansion port, plus ports for USB, IEEE-1394 and Sony Memory Stick, Windows 2000 Professional (nooooooooooooot!), Sony video-editing suite (crap!). Dimensions: 259 x 209 x 32mm (W x D x H). Weight: 1.4kg.
It is a perfect laptop for iloog testing.
Boot Process:
When I tried to boot iloog to it from it’s external pcmcia cdrom I faced the a problem though, the iloog kernel does not support (yet ?) cdrom drives on pcmcia (I had never thought of booting from such devices when creating the iloog kernel) so iloog’s initrd couldn’t operate as it should. As long as the iloog kernel started and initrd scripts run, they couldn’t find a bootable device since no cdrom device was found, only the hard disk was recognized that far. This laptop is pretty old so there wasn’t either any option to boot from usb. The good news was that the laptop already had an old slackware (version 10 or 11, I can’t really remember) running on it, with two ext3 partitions (hda2 and hda3) and another one for swap (hda1). We had installed that slackware version with Dimitris following the advice posted on this forum http://www.debianforum.de/forum/viewtopic.php?p=9781. One has to add this:
linux ide2=0x180,0x386
to the boot prompt.
Since there was already another linux OS installed on the laptop I didn’t need to put that command on iloog’s boot prompt and decided to take another path. I started slackware normally, then I put iloog-7.06 CD in the pcmcia cdrom drive, mounted it under /mnt/cdrom and then copied the contents of /mnt/cdrom to /mnt/hda3 (where /dev/hda3 was already mounted). I rebooted the laptop and made it boot again from the pcmcia cdrom drive. The iloog kernel and initrd scripts started and could now find the files they needed under /dev/hda3, so it the boot process continued just fine. Since no files but the kernel and initrd scripts ran from the external cdrom the boot process was a lot faster than it would have been running from the old external 16x cdrom drive. This process of storing iloog’s files on a hard disk partition should have provided enough info for those who want to run iloog as a livecd from their hard disk for testing.
Local Install:
The next thing I wanted to do was to install iloog locally on the hard disk than just having it boot as a livecd from the disk. The process was exactly the same as I have described in a previous post about installing an older iloog version to another old laptop. The only difference was that I installed grub instead of lilo, but that’s more of a preference than a necessity.
Incompatibilities:
Even though the laptop has an S3 savage graphics chipset, the only working xorg driver for me is vesa, but it does work just fine. If you don’t know how to change your xorg driver to vesa just use the iloog-vesachange.sh script (found under /usr/local/bin).
Install New Applications:
Since the laptop has only 64Mb of ram, using Firefox is extremely difficult. Fuzz proposed to install Opera. In order to install anything from portage to iloog one must run the iloog-db.sh script first . This script fetches the database of all installed packages on iloog (/var/db/), normally these are not on the livecd because a) they take too much space b) who and why would install new apps on a livecd c) they take way too much space :). When the iloog-db.sh script finishes, one has to run an:
emerge --sync
in order to fetch the latest portage.
The an emerge -avt opera
to install the latest opera 🙂
So, after running iloog-db.sh and emerge --sync
, you can install any applications you want on an iloog.
Kernel:
I wanted to build a newer stable kernel (emerge -avt sys-kernel/gentoo-sources
, gentoo-sources-2.6.21-r4 at the current time) to test the performance and remove unused stuff from the kernel. This newer kernel has also the sony_laptop module included. This is the config I used:
kernel 2.6.21 config for PCG-SR21K
I’ve build the sonypi and sony_laptop as external modules and since udev does not load them automagically I needed to edit
/etc/modules.autoload.d/kernel-2.6 and add the modules in that file.
Extra controls
To control the brightness of the screen, check/set the fan speed, check the temperature and see the remaining battery I run an emerge app-laptop/spicctrl
. spicctrl uses the sonypi module, so make sure you have already loaded it. This module also makes the jog dial button act as extra mouse keys. iloog’s xorg file already has support for 5 button mice, so I was good to go. I was no able to scroll up and down using the jod dial button. When the jog dial is pressed it acts as middle mouse button so I can use it as that too.
In order to make use of the extra function keys I needed to emerge app-misc/sonypid
. With the help of a brilliant perl script called sonypidd I could assign various functions/scripts to the function keys.
I’ve made some modifications to the original one though, the original script uses aumix to change the sound settings but I like amixer more, so I used that one. I’ve even changed the program it used for playing a click.wav upon pressing the function keys (it used sox, I used play), and the click.wav itself (I’ve used the click.wav that comes with the game gweled).
Here’s my sonypidd: sonypidd for iloog
and click.wav: sonypidd for iloog
To make it all work, extract sonypidd.gz to /usr/local/bin/sonypidd and click.tar.gz to /usr/share/sounds/click.wav. Then, edit /etc/conf.d/local.start and add:
/usr/local/bin/sonypidd >/dev/null 2>&1>
to the end of the file
I also wanted to make the jog dial button to appear the fluxbox menu, so I’ve edited ~/.fluxbox/keys file and changed the line that referred to Mouse2 from:
OnDesktop Mouse2 :workspaceMenu
to
None Mouse2 :rootMenu
Now I can open a fluxbox menu even when I have other applications on top of the desktop by pressing the jog dial button 🙂
I’d be glad if sjog or rsjog worked so I could do more with the jogdial, but I haven’t made it yet. Their development has stopped and their code no longer builds with the current libraries. Any good programmers out there to revive these programs ? 🙂
Speeding up compilations:
To speed up package compilation I’ve set up distcc on the laptop and on my desktop pc. The problem I faced though was that iloog is compiled as i586 arch and my desktop as i686 so I had to use distcc with crossdev. Even though crossdev appeared to save the day it had a minor problem with it. It always installs the latest testing packages for crosscompiling, and since iloog uses stable packages there were some conflicts while installing packages. These were solved by a brutal hack, editing the /usr/sbin/crossdev binary (line 472) and commenting out the “if [[ -f package.keywords ]]” loop. Then I could put the versions I wanted inside /etc/portage/package.keywords like that:
=cross-i586-pc-linux-gnu/gcc-4.1.2 x86~x86
=cross-i586-pc-linux-gnu/glibc-2.5-r4 x86 ~x86
TODO:
Since distcc with crossdev in now installed I will try to install xorg-server with kdrive use flag. I think that Xvesa will be a loooot lighter than X server.
References:
Pages I’ve read during the process:
http://www.linux.it/~malattia/wiki/index.php/Main_Page
http://tjworld.net/snc/
http://freenet-homepage.de/obauer/gentoo.html
http://linuxbrit.co.uk/rsjog/
http://sjog.sourceforge.net/
http://www.popies.net/sonypi/
http://www.comp.lancs.ac.uk/~fittond/gentoo-install.txt
http://www.boulder.swri.edu/~deforest/sonypidd
http://www.siglost.org/vgna197vp/sonypidd
http://www.gentoo.org/doc/en/distcc.xml
http://www.gentoo.org/doc/en/cross-compiling-distcc.xml