Making the xosd module

Get the source for xosd

Go to the website for xosd and you'll see a link to the latest version At the time of this writing, that's xosd-2.2.12.tar.gz. We need xosd for the very useful osd_cat binary.

Compile the source and create a Slackware package

Since we're doing this from source, its best to download the source into a running version of the Live CD. We can then do the compilation there to make sure the Live CD has all the necessary dependencies.

First get the source into the Live CD:

 # mkdir build
# cd build
# wget http://www.ignavus.net/xosd-2.2.12.tar.gz
# tar -xzvf xosd-2.2.12.tar.gz

Here's where I get to cheat documenting this process. I did the traditional ./configure, make, make install. The binary compiled without problems but died when I tried to run it complaining that the default font could not be found. After a bit of poking about, I realized that the default font wasn't part of SLAX. I created a patch to modify the c source to set another font that was part of SLAX as the default font ("-adobe-helvetica-medium-r-normal--*-*-*-*-p-*-*"). The default font is set in line 27 of the file ./src/libxosd/xosd.c. The patch I've created is here. Since I know how to fix it, I won't show the debugging the problem, just the fix.

 # cp xosd-2.2.12/src/libxosd/xosd.c ./
# cp xosd.c slax-xosd.c
# vi slax-xosd.c
[edit the file]
# diff -c xosd.c slax-xosd.c > slax-xosd-patch.diff
# less slax-patch.diff
[check the patch]
# cp slax-xosd-patch.diff xosd-2.2.12/src/libxosd/
# cd ./xosd-2.2.12/src/libxosd/
# patch -i slax-xosd-patch.diff
# less xosd.c
[check how the patch was applied]
# cd ../../
# ./configure --prefix=/usr
# make
# checkinstall -S --install=no

The program 'checkinstall' will run "make install" for you and, with the command line switches above, it will create a Slackware package and not actually install the program.

Create a module from the Slackware package

This is the easy part.

 # tgz2lzm xosd-2.2.12-i386-1.tgz xosd-2.2.12-i386-1.lzm

Test the new modules

SLAX will allow you to add modules to a running system. Before going on, you should install the modules and make sure it works like expected. Check out the page Add modules to a running system [PAGE NOT MADE] to see how to do this. Verify that xosd works as expected:

echo "OWASP:  Securing the web... One mind at a time" | \ 
osd_cat -p middle -A center --font=-adobe-helvetica-medium-r-normal--24-240-75-75-p-130-iso8859-1

If everything goes as expected, you'll need to add this module to the ISO image. Since we've created the module in the Live CD, you'll need to move it off to a "real" computer. I save both the .lzm modules as well as the Slackware package. The Slackware package is at /root/build/xosd-2.2.12/xosd-2.2.12-i386-1.tgz and the module will be in the same directory if you've followed the above instructions. You can use a USB drive, scp or whatever to get the files off the Live CD.

Add the modules to the ISO build directory

Also cake

 $ cp -i xosd-2.2.12-i386-1.lzm ../contents/slax/base/
$ chmod 775 ../contents/slax/base/webscarab-20070504.lzm

This assumes your xosd module was moved into your working directory. See Creating the base Live CD from SLAX (Create a Working Directory section)

Clean up and archive

Once you've got a working module, lets clean up a bit.

 $ $ mkdir ./completed_modules/xosd
$ mv xosd-2.2.12-i386-1.lzm ./completed_modules/xosd/
$ mv temp/slax-patch.diff ./completed_modules/xosd/
$ mv temp/xosd-2.2.12.tar.gz ./completed_modules/xosd/
$ rm -rf ./temp/*