The SquashFS home site is located at http://squashfs.sourceforge.net/. The current release is 1.3r2. You can always get the latest version at the SquashFS SourceForge project page.
In order to read SquashFS, you need it supported in your kernel - just as if it was a reiserfs or ext3 file system. You have to make sure there is an appropriate patch for your kernel version - it should be located in linux-2.x.y subdirectory of the SquashFS source tree. Also, remember that in most cases you will need a clean (original) Linux kernel source from kernel.org. If your kernel source is from a distro vendor, it may be already pre-patched with custom vendor patches, and patching with a SquashFS patch may raise errors, as SquashFS patches are made against original Linux kernels.
With the 2.x.y kernel source and a proper 2.x.y SquashFS patch present, all you have to do is (we'll assume that you have your Linux kernel source in /usr/src/linux and that you have the SquashFS source in /usr/src/squashfs):
Change to the SquashFS source directory and copy the kernel patch (we'll assume it's named squashfs1.3r2-patch as of the 1.3r2 release) to /usr/src/linux.
bash# cd /usr/src/squashfs bash# cp linux-2.x.y/squashfs1.3r2-patch /usr/src/linux |
Go into the directory /usr/src/linux:
bash# cd /usr/src/linux |
Patch the Linux kernel:
bash# patch -p1 < squashfs1.3r2-patch |
Configure your kernel:
bash# make menuconfig |
In the "File systems" section, make sure you enable "Squashed filesystem." If you want to be able to mount the squashed file system via a loopback device in future, you should enable "Loopback device support" in the "Block devices" section.
Now you may compile the kernel and modules:
bash# make dep && make bzImage && make modules && make modules_install |
Install your new kernel (name it bzImage-sqsh for convenience, if you like):
bash# cp arch/i386/boot/bzImage /boot/bzImage-sqsh |
Modify your boot loader's configuration file to include your new kernel and install the boot loader. Now you may reboot with your new kernel. When it boots, check that everything went fine:
bash# cat /proc/filesystems |
You should see the squashfs line among other file systems. This means you have successfully enabled SquashFS in your kernel.
Now you need to compile mksquashfs - the tool for creating squashed file systems.
bash# cd /usr/src/squashfs/squashfs-tools |
Compile and install mksquashfs:
bash# make bash# cp mksquashfs /usr/sbin |
If everything went fine, typing mksquashfs at the Bash prompt should print it's "usage" message.