PlayStation 2 Linux - personal projects

by Anthony Tonns
  1. Introduction to PS2Linux
  2. Preparation for cross-compiling for PS2Linux
  3. Project 1: dillo-0.7.1.2
  4. Project 2: wmx-6
  5. Project 3: dillo-ssl-0.7.1.2
Usage:
Copyright (c) 2003 Anthony Tonns
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.1 or any later version published by the Free Software
Foundation; with no Invariant Sections, no Front-Cover Texts and
no Back-Cover Texts.  A copy of the license is included in the
section entitled "GNU Free Documentation License".
GNU Free Documentation License


Introduction to PS2Linux

What is PS2Linux? Well, it's nothing short of a Linux distribution that runs on the PlayStation 2 game console. You generally need a PlayStation 2 and the The Linux Kit (for PlayStation 2) from Sony. This wil give you a 294.912 MHz, 128-bit MIPS ISA level III compliant processor, 32MB of RDRAM, a 40GB HDD, a 10/100mb RJ45 ethernet port, USB keyboard and mouse and a VGA break-out cable for hooking the Playstation 2 to a VGA monitor. After that, you can cruise over to the PlayStation 2 Linux Community site to download all sorts of software and consort with other PS2Linux hobbists.

Me, I'm just a UNIX guy that got myself a PlayStation 2 and the Linux Kit to have another hobby. I'm having a little fun by learning new things I'd never have bother with before. This includes setting up a cross-comple environment (from x86-based PCs to the mips-based PS2), creating rpm packages and finding fast, memory optimized software to run on the PS2.


Preparation for cross-compiling for PS2Linux

Setting up the cross-compiler for PC Linux to PS2Linux was the easy part.
Setting up an old version of rpm to create rpms for PS2Linux was a little more challenging.
  1. Have a PC running Linux for cross-compiling (this is left as an exercise to the student :)

  2. Follow the excellent Mozilla for PlayStation 2 Cross Compiling Mini-HOWTO

  3. copy SRPMS/RPM-30_1.RPM and SOURCES/RPM-30_1.GZ from the PlayStation 2 Linux Kit disc 2 to your PC Linux box

  4. Extract the patches and rename the tarball for compilation
    mkdir build
    cd build
    rpm2cpio ../RPM-30_1.RPM | cpio -ivd
    cp ../RPM-30_1.GZ rpm-3.0.4.tar.gz
    
  5. Untar and patch (no need to apply PS2Linux specific patches - this is an old version of rpm for your PC Linux)
    tar zxf rpm-3.0.4.tar.gz
    cd rpm-3.0.4
    patch -p1 < ../rpm-3.0.3.kondara.patch
    patch -p1 < ../rpm-3.0.4-shortcircuit-000213.patch
    patch -p1 < ../rpm-handlecomment2.patch
    patch -p1 < ../rpm-3.0.4-fclose.patch
    patch -p1 < ../rpm-bz2-1.0.0-kondara.patch
    patch -p1 < ../rpm-configure-in-bz2.patch
    patch -p1 < ../rpm-configure-bz2.patch
    
  6. Now configure and make. NOTE: I'm using /usr/old as the prefix because I don't want this old version of rpm to interfere with the current version of rpm installed for the rest of the system. NOTE: You don't want to install this in /usr/mipsEEel-linux, as that has strictly cross-compile stuff.
    ./configure  --prefix=/usr/old
    make
    
  7. part of the way through the make, it complained about version problems between libtool and ltconfig. I'm not 100% sure what that was all about, but I just regen'd the config and restarted the compile:
    ./ltconfig ltmain.sh
    make
    
  8. Now install your old version of rpm in /usr/old and /var/old.
    make install
    
  9. Of course, it's gonna need some tweaks. First, I setup my .rpmmacros so I don't have to build rpms as root. It was definately wasn't a big fight, thanks to Matthias Saou. :)
    %_topdir                /home/tony/ps2/rpm
    %_tmppath               /var/tmp/rpm
    
    %_rpmtopdir             %{_topdir}/%{name}
    %_builddir              %{_tmppath}/BUILD
    %_rpmdir                %{_rpmtopdir}
    %_sourcedir             %{_rpmtopdir}
    %_specdir               %{_rpmtopdir}
    %_srcrpmdir             %{_rpmtopdir}
    
  10. Next, I had to tweak the global rpmrc and rpmmacros to fix some issues with a) using rpm out of /usr/old b) not using the pre-existing rpm configs for the current version of rpm c) some straaaaaange error where the old rpm was generating script that start with "%/bin/sh" instead of "#!/bin/sh".

    My tweaks
Now I'm not saying this old-version-of-rpm setup is perfect. Matter of factly, this is the first time I've ever built an rpm package, let alone a version of the rpm binary. It sometimes spews an error message about "%define" or something, but I haven't been able to nail it down. Your comments are appreciated.

Project 1: dillo-0.7.1.2

The Dillo Project Homepage: http://dillo.auriga.wearlab.de/
  1. the spec file for my cross compile of dillo-0.7.1.2. Created with the command:
    /usr/old/bin/rpm -bb --target mipsel dillo-0.7.1-spec
    
  2. nag patch - dillo likes to strictly adhere to the RFC for HTML. That's an admirable goal, but inserting nag tables into the HTML for non-compliant pages is a little much. I've just simply modified the nag so it's a little less intrusive - nometarefreshnag-dillo-0.7.1.2-patch.

  3. this new version of dillo has a "bookmarks server" this either saves or uses a little more RAM. if you don't care about bookmarks, it saves it. If you want bookmarks, you need to start the bookmark "server" first. I just created an alias in my .bashrc that does:
    alias godillo="bm_srv12& dillo&";
    
    NOTE: according to the dillo docs, the bookmark server _should_ be started automatically by dillo. However, I can't get it to work.

  4. the fruits of my labor: dillo-0.7.1-2.mipsel.rpm and of course, a README file explaining how to use it.

    The contents of the rpm:
    $ rpm -qpl dillo-0.7.1-2.mipsel.rpm
    /usr/doc/dillo-0.7.1
    /usr/doc/dillo-0.7.1/AUTHORS
    /usr/doc/dillo-0.7.1/COPYING
    /usr/doc/dillo-0.7.1/Cache.txt
    /usr/doc/dillo-0.7.1/ChangeLog
    /usr/doc/dillo-0.7.1/Cookies.txt
    /usr/doc/dillo-0.7.1/Dillo.txt
    /usr/doc/dillo-0.7.1/Dw.txt
    /usr/doc/dillo-0.7.1/DwImage.txt
    /usr/doc/dillo-0.7.1/DwPage.txt
    /usr/doc/dillo-0.7.1/DwStyle.txt
    /usr/doc/dillo-0.7.1/DwTable.txt
    /usr/doc/dillo-0.7.1/DwWidget.txt
    /usr/doc/dillo-0.7.1/HtmlParser.txt
    /usr/doc/dillo-0.7.1/INSTALL
    /usr/doc/dillo-0.7.1/IO.txt
    /usr/doc/dillo-0.7.1/Images.txt
    /usr/doc/dillo-0.7.1/NC_design.txt
    /usr/doc/dillo-0.7.1/NEWS
    /usr/doc/dillo-0.7.1/README
    /usr/local/bin/bm_srv12
    /usr/local/bin/dillo
    /usr/local/etc/dillorc
    

Project 2: wmx-6

The wmx homepage: http://www.all-day-breakfast.com/wmx/
  1. the spec file for my cross compile of wmx-6. Created with the command:
    /usr/old/bin/rpm -bb --target mipsel wmx-6-spec
    
  2. ps2 customization patch - a little cutomization to make "New" point to rxvt and the RedHat X11 session file - wmx-6-ps2linux-patch.

  3. For the middle-button root menu, I added symlinks in /usr/local/lib/wmx to dillo, rxvt and xmms. This is just the default root menu, if enabled. (I can't get it to see the default, but this is covered in the README)

  4. the fruits of my labor: wmx-6-1.mipsel.rpm and of course, a README file explaining how to use it.

    The contents of the rpm:
    $ rpm -qpl wmx-6-1.mipsel.rpm
    /etc/X11/xinit/session.d/wmx
    /usr/doc/wmx-6
    /usr/doc/wmx-6/README
    /usr/local/bin/wmx
    /usr/local/lib/wmx
    /usr/local/lib/wmx/dillo
    /usr/local/lib/wmx/rxvt
    /usr/local/lib/wmx/xmms
    

Project 3: dillo-ssl-0.7.1.2

The Dillo Project Homepage: http://dillo.auriga.wearlab.de/

This went almost exactly the same way as the dillo package. I just chose not to make it a complete package (with bm_srv12) but more of an "add on" package for the first one that I did.
  1. the spec file for my cross compile of dillo-ssl-0.7.1.2. Created with the command:
    /usr/old/bin/rpm -bb --target mipsel dillo-ssl-0.7.1-spec
    
  2. nag patch - dillo likes to strictly adhere to the RFC for HTML. That's an admirable goal, but inserting nag tables into the HTML for non-compliant pages is a little much. I've just simply modified the nag so it's a little less intrusive - nometarefreshnag-dillo-0.7.1.2-patch.

  3. This has the custom dillo-ssl patch installed. The original patch can be found at: http://users.auriga.wearlab.de/~andi/dillo-ssl-0.7.diff.gz. I also have a local copy of dillo-ssl-0.7.diff. (Thanks go to Andreas Kemnade for patching and Robert W. Hall for testing.)

  4. the fruits of my labor: dillo-ssl-0.7.1-2.mipsel.rpm and of course, a README file explaining how to use it.



Tonns.org Homepage