Sometimes you need to compile the squashfs module by yourself, sadly this does not work out of the box at the moment in Ubuntu Jaunty. The first thing to know is that it depends on the lzma module as it has some patches in Ubuntu which add lzma compression to it. To start up we just install the needed packages with this command:

sudo aptitude install lzma-source squashfs-source

After that we simply compile the lzma module with these 3 commands:

sudo m-a prepare
sudo m-a build lzma
sudo m-a install lzma

If we would do the same steps with the squashfs module, the build will not work, we’ll have to fix some code as the supplied is not compilable against that kernel version. The source code for the squashfs module is stored at /usr/src/squashfs.tar.bz2 which we need to edit, so we temporarly extract it to /tmp

cd /tmp
sudo tar jxf  /usr/src/squashfs.tar.bz2

The first change that we need to do is at line 693 in squashfs/inode.c where we need to replace the no longer existing function d_alloc_anon through d_obtain_alias. The other change is at line 2318 in the same file. The init_once function should only take one void* parameter instead of those two that are dcclared here, corrected line 2318 should equal to

static void init_once(void *foo)

After we are finished with the changes we have to repack the source code into the archive.

sudo tar jcf /usr/src/squashfs.tar.bz2 squashfs

Now, we are able to build the squashfs module with the already known commands:

sudo m-a build squashfs
sudo m-a install squashfs

Thanks to Carlos Costa who wrote an article how to fix this squashfs compile problem in general.