The SquashFS home site is located at http://squashfs.sourceforge.net/ - it contains news for the latest release and it's changelog, as well as general information about SquashFS. You can grab the latest version at the SqaushFS project page at SourceForge.
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 will almost surely not work, as SquashFS patches are made against original Linux kernels.
With a kernel source and a proper 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 squashfs-patch) to /usr/src/linux.
bash# cd /usr/src/squashfs bash# cp linux-2.x.y/squashfs-patch /usr/src/linux |
Go to the linux kernel source directory /usr/src/linux:
bash# cd /usr/src/linux |
Note: please remember that we will not be leaving this directory during all further kernel-related procedures, and all paths will be given relative to /usr/src/linux.
Now patch the source with the SquashFS patch:
bash# patch -p1 < squashfs-patch |
Cleanup and prepare the kernel source:
bash# make distclean bash# make mrproper |
Configure the kernel using your favourite method (config/menuconfig/xconfig/gconfig):
bash# make menuconfig |
Now you may compile the kernel and modules:
bash# make |
Configure the kernel:
bash# make menuconfig |
Now you may compile the kernel and modules:
bash# make dep bash# make bzImage bash# make modules |
It's time to install your new SquashFS-enabled kernel. The instructions below are for installing and booting the kernel on the host machine. You may want to install and test it on the target system.
We assume that the kernel was compiled for a x86 architecture, and the compressed kernel image is located in the arch/i386/boot/ subdirectory of the kernel tree. Now copy the kernel to the /boot directory (and name it bzImage-sqsh for convenience, if you like):
bash# cp arch/i386/boot/bzImage /boot/bzImage-sqsh |
Don't forget to install the kernel modules if you have any:
bash# make modules_install |
Modify your boot loader's configuration file to include your new kernel and install (update) the boot loader. Now you may reboot with your new kernel. When it boots, check that everything went fine:
bash# cat /proc/filesystems |
Or, if you built SquashFS support as a kernel module:
bash# insmod squashfs bash# cat /proc/filesystems |
If you 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 shell prompt should print it's "usage" message.