Trying to compile the cloop module on my 2.6 kernel in order to play with the KNOPPIX filesystem of Damn Small Linux, in order to get ALSA sound working reliably on one or more of the 3 workstations.

First step was to patch the cloop sources, which apparently have only been compiled on Debian systems:

--- ./advancecomp-1.9_create_compressed_fs/advfs.cc.orig	2004-04-18 20:33:29.000000000 +0000
+++ ./advancecomp-1.9_create_compressed_fs/advfs.cc	2004-09-30 03:08:17.000000000 +0000
@@ -21,6 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
+#include <netinet/in.h>
 #include <asm/byteorder.h>
 #include <fcntl.h>
 #include <zlib.h>
@@ -30,7 +31,6 @@
 #include "utility.h"
 #include "compress.h"
 #include "siglock.h"
-#include <netinet/in.h>
 #include "lib/mng.h"
 #include "lib/endianrw.h"
--- ./Makefile.orig	2004-05-14 19:17:51.000000000 +0000
+++ ./Makefile	2004-09-30 03:15:07.000000000 +0000
@@ -1,12 +1,14 @@
+# note: if this is wrong, specifying in the commandline `make KERNEL_DIR=/usr/src/linux-2.6.7' will override it
 CFLAGS:=-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -s -I. -fno-strict-aliasing -fno-common -fomit-frame-pointer 
 include $(KERNEL_DIR)/.config
-include $(KERNEL_DIR)/conf.vars
+# conf.vars doesn't appear to be in source tarballs from kernel.org, so don't make it mandatory
+-include $(KERNEL_DIR)/conf.vars
 CKERNOPS:=-D__KERNEL__ -DMODULE -fno-builtin -nostdlib -DKBUILD_MODNAME="cloop" -DKBUILD_BASENAME="cloop"
@@ -27,6 +29,10 @@
 # Name of module
+# note -- maybe if conf.vars wasn't found, PATCHLEVEL will be undefined? So let's assume 6 for a 2.6 kernel
 ifeq ($(PATCHLEVEL),6)

However, attempting to load the module still fails:

root@zero:/home/jcomeau# modprobe cloop file=/usr/local/damnsmall/KNOPPIX/KNOPPIX
FATAL: Error inserting cloop (/lib/modules/2.6.7/kernel/fs/cloop.ko): Unknown symbol in module, or unknown parameter (see dmesg)

And dmesg shows "cloop: Unknown symbol ntohl", which strikes me as pretty strange... the TCP/IP stack for sure makes use of this function -- I'm sure the answer will pop up pretty soon. But all this just goes to show how much trouble it is doing something on Linux sometimes. You have to build this so you can fix that so you can build the other thing so you can fix what you originally intended to fix. But, complain as I will, we have the sources and we can fix it. Beats the hell out of closed source any day.

Back to blog or home page

last updated 2013-01-10 20:31:24. served from tektonic.jcomeau.com