|
Homepage: http://linux.50webs.org/ filesystem support to SuSE 10). The files on a Live-CD can be compressed in a format known as a squashed filesystem. If you wish to be able to read CD images that use this type of compression, you need to have read support for it. Such support for the squash filesystem has been built at the kernel level, and acquiring it, requires that you patch a standard kernel, or find a distribution that has already done this for you. Mandriva 2005/2006 has squash filesystem support in their stock kernels (as a module). SuSE 10.0, however, does not. So I figured I would add it, and write up the procedure for all those who may be interested. For general compilation, make sure that you have the following packages installed. kernel-source (2.6.13-15) gcc (4.0.2_20050901-3) libgcc (4.0.2_20050901-3) glibc (2.3.5-40) glibc-devel (2.3.5-40) glib2 (2.8.1-3) glib2-devel (2.8.1-3) gcc-c++ (4.0.2_20050901-3) libstdc++-devel (4.0.2_20050901-3) Download squashfs3.0.tar.gz from http://squashfs.sourceforge.net/ and save it in a directory of your choice, say /tmp Change to the /tmp directory and unpackage squashfs3.0.tar.gz cd /tmp tar zxf squashfs3.0.tar.gz Change to the kernel source code directory and clean the code with the command make clean. Make clean deletes old object files, etc. cd /usr/src/linux-2.6.13-15 make clean Patch the kernel source with a patch from /tmp/squashfs3.0 patch -p1 < /tmp/squashfs3.0/linux-2.6.13/squashfs3.0-patch Copy the kernel configuration saved in the boot directory to where menuconfig can find it and run make menuconfig. cp /boot/config-2.6.13-15-default /usr/src/linux-2.6.13-15/.config make menuconfig Follow this path; File systems ---> Miscellaneous filesystems ---> SquashFS 3.0 - Squashed file system support (NEW) Then hit the space bar to enter an M (for module). This will tell the kernel build system to add squash filesystem support as a module. If you choose Y, squash filesystem support will be compiled directly into your kernel. If you do this, your kernel will be about 43 kB larger. The option Additional options for memory-constrained systems (NEW) should be left unchosen. Enter Exit, a few times, and save the configuration. Then make and install the kernel and squashfs module with the commands: make bzImage make M=fs/squashfs modules mkdir /lib/modules/2.6.13-15-default/kernel/fs/squashfs cp fs/squashfs/squashfs.ko /lib/modules/2.6.13-15-default/kernel/fs/squashfs cp /usr/src/linux-2.6.13-15/arch/i386/boot/bzImage /boot/linux-2.6.13-15-squashfs The command make help provides a summary of make options. There is an option to patch called --dry-run that you may wish to use. For more on building modules, enter: less Documentation/kbuild/modules.txt Now edit your grub conf file /boot/grub/menu.lst title SUSE LINUX 10.0 with squashfs support root (hd0,0) kernel /boot/linux-2.6.13-15-squashfs root=/dev/hda1 vga=0x317 selinux=0 resume=/dev/hda2 splash=silent showopts initrd /boot/initrd Comment: The above lines have been added to enable booting of the new kernel. title SUSE LINUX 10.0 root (hd0,0) kernel /boot/vmlinuz root=/dev/hda1 vga=0x317 selinux=0 resume=/dev/hda2 splash=silent showopts initrd /boot/initrd Comment: These lines already existed and are the grub entry for the old kernel. Of course, you have to adjust the /dev/hdaX and (hd0,X-1) entries to correspond to the partition you are using (the resume entry refers to your swap partition). Your vga entry is also likely to be different. The idea is to copy your old grub entry and then change the kernel address to point to the new kernel. The initrd will stay the same. You should probably change the System Map as well, but it doesn't seem to matter. The reason for keeping your old kernel entry, is so that if your new kernel does not boot, you can revert to the old one. Once you are happy with your new kernel (with squash filesystem support) you can toss away the old one. Now reboot, and you are done. If you go to the directory /tmp/squashfs3.0/squashfs-tools/ and type make, you will compile the two tools, mksquashfs and unsquashfs. These tools allow you to make and unmake squashed filesystems without the kernel module squashfs. What the kernel module allows you to do is to mount a squashed filesystem and treat it as any other read-only filesystem. You can move through the directories, check file sizes, read, copy, execute files, etc, etc. |