Adding modules to Damn Small Linux (DSL)

This is not a simple task. Adding or compiling modules is a tricky feat when it comes to 2.4 kernels. It requires you compile the entire kernel yourself before.

I have used a diskless machine, with an NFS mount as the place where I have kept all persistent data. Mounted it at /tmp/mnt directory.

Preparations

  • Boot into DSL
  • Mount remote NFS with no_root_squash server options
  • Use mydslPanel.lua if this is the first run to download and save the packages described below to the NFS share, or
  • Use mydsl-load to install packages

Compiling Kernel

Installing required packages

  • mydsl-load gcc-2.95.unc (could be .dsl, too)
  • mydsl-load gcc1-with-libs.dsl
  • mydsl-load gnu-utils.dsl
  • mydsl-load kernelheaders
  • Download kernel 2.4.26

Extracting the kernel

  • mkdir /usr/src (if doesn’t exist already)
  • cd /usr/src
  • tar xzf /full/path/to/kernel/linux-2.4.26.tar.gz
  • patch -p1 -d linux-2.4.26 < knoppix-kernel.patch
  • chown -R dsl linux-2.4.26

Configure the kernel – as the user “dsl”

  • cd /usr/src/linux-2.4.26
  • make mrproper
  • Get config file from DSL mirror and save it to /usr/src/config in the kernel source directory
  • make menuconfig
  • Go to last before bottom option in the menu – “Load alternate configuration file”
  • Change the path and name of your config file. In our example – change the value to /usr/src/config
  • Save and exit kernel configuraiton
  • Run make dep clean bzImage

Compiling the module

I used make in rtl8168 driver source. This should cause no problems, if you have followed the previos notes

Loading the modules

You can run “insmod src/r8168.o” to load the module, however, some of the modules will require predefined modules for them to load. In the r8168 module, you must insmod crc32 modules before.

Keep the new module for later use

You don’t need to follow this entire process to load the modules on another DSL system with the same kernel running.

I will follow this up with an explenation on how to close the ISO correctly under Ubuntu, and make it work later on. The source for this specific post can be found here.

Tags: , , ,

5 Responses to “Adding modules to Damn Small Linux (DSL)”

  1. jim Says:

    Good guide – even 3 years after you wrote it!

    Rather than NFS I set up a 4GB disk under VirtualBox and did a frugal install onto that and then ran the MyDSL browser to add packages (with 2.4.31 rather than 2.4.26). This has the advantage that compilation is very fast and you can archive the DSL VirtualBox image easily. Not really an easy option in 2009, but now the whole setup is painless.

    I had to do: Apps->Net->Download Mirror Selector to select a mirror that is still alive for MyDSL browser.

    Using the 8.028.00 2012/2/3 source for the r8168 module, after building I had unresolved symbols on insmod (copy_to_user and copy_from_user) these seem to be solved by adding the line:

    #include

    Into rtltool.c I just put it at the end of the includes. So far everything seems fine.

  2. ez-aton Says:

    It makes me happy to know this post has assisted you, even three years after. Thanks for the feedback and update!
    Ez

  3. Abelliqueux Says:

    Hi, great guide, worked for me on DSL 4.4.10 with Linux 2.4.31.
    Just so that the next one who gets here and end puzzled with the copy_to_user and copy_from_user issue, which jim appears to have sold, I’ll add that you have to edit rtltool.c in the ‘src’ folder of your module sources, and add

    #include (lesser than sign)asm/uaccess.h(greater than sign)

    It seems your CMS striped what was after “#include” in Jim’s message, due to the syntax looking like an HTML markup.

  4. ez-aton Says:

    Indeed. Markups are blocked…
    Thanks for the tip!

    Ez

  5. Ed Says:

    I installed Damn Small Linux 4.11RC2 in a Compaq Presario 2292.
    I am now using this computer as a web server!

    I wrote some tips and tricks on how to install Damn Small Linux 4.11RC2 and use it as a web server, that you can find in:

    http://cosmolinux.no-ip.org/dsl/dsl.html

    I wish it is helpful to someone!!!

Leave a Reply