Hacking DSL-de

From DSL Wiki

This page in other languages: spanish


Hacking DSL

For some of us, extending DSL with MyDSL extensions is simply not enough. Especially when it comes to subtracting stuff. So here's a page dedicated to hacking DSL to make it work the way you want it.


  • This method is applicable mostly to the frugal install users.
  • It involves the modification of KNOPPIX cloop image.
  • Right now.. this is somewhat 'quick and dirty'.

If the system seems to hang while building the cloop, do a sysrq and try removing 'toram' in the kernel command line.

First off locate where you KNOPPIX image is stored, usually in /cdrom/KNOPPIX/KNOPPIX. Setup a loop device to access the compressed loop image.

losetup /dev/cloop1 /cdrom/KNOPPIX/KNOPPIX

mount the cloop:

mkdir -p /mnt/loop
mount /dev/cloop1 /mnt/loop

Copy everything in the loop to a temporary storage:

cp -a /mnt/loop/* $SAND_BOX
rm -rf .rr_moved

Replace <path_to_storage> with an appropriate path. Make sure you have enough space in there. It's going to be around ~255 Mb. Example SAND_BOX=/tmp/my_knoppix where /tmp/my_knoppix has more than around 260 Mb of free space.

You must remove $SAND_BOX/.rr_moved and its content because mkisofs(8) will attempt to recreate it. That attempt will fail if the directory already exists.

Once inside your SAND_BOX, hack to your heart's content.

Here's an example on adding the latest mplayer binary codecs in DSL-n 0.1RC4 (as of Apr-20-2007):

mkdir -p $SAND_BOX/usr/lib/win32/
cd $SAND_BOX/usr/lib/win32/
wget http://www1.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
tar jxvf essential-20061022.tar.bz2
ln -s essential-20061022/* .

When you are done, create a new compressed loop image:

mkisofs -hide-rr-moved -allow-leading-dots -R -l \
  -V "KNOPPIX ISO9660" -v -allow-multidot $SAND_BOX |
    create_compressed_fs - 65536 > <path_to_your_KNOPPIX_directory>/KNOPPIX2

where <path_to_your_KNOPPIX_directory> is where you have your original KNOPPIX image (usually /cdrom/KNOPPIX/); and KNOPPIX2 being the name of our new cloop image.

the create_compressed_fs process can take considerable time to run, especially if your build system is light on processor power. For example, a 233MHz i586 takes around 30 minutes to execute the above pipeline and produce a 1835-block image.

Unmount and detach:

cd $HOME
umount /mnt/loop
losetup -d /dev/cloop1


Since we've named our new image KNOPPIX2 we'll have to modify the kernel command line to make DSL load this new image instead of the original. Add the boot option:


(maybe case insensitive/sensitive depending on your filesystem) in your /etc/lilo.conf or /boot/grub/menu.lst — whichever boot loader you may be using.

Publishing Your Hack (if you wish to)

Enter a new topic in the System section of the DSL Forums. Describe what you've done, the purpose of the hack and how people can contact you to try out your hack.

Please note: These hacks are not part of Damn Small Linux. If the developers like your hack, they may take it up, but that's their choice.

You should also be careful about selling or appearing to sell your hack, especially as "Damn Small" Anything. At the very least, have the decency to offer it back to the DSL developers instead of just forking another DSL.

Desired Hacks

See Desired Hacks if you have a hack you'd like to request.

Other examples of modification