blob: cb1824ae0ef50c535846da64c5a0d2e479ee7145 [file] [log] [blame]
Phillip Loughere1621932014-08-08 05:30:01 +01001 INSTALLING SQUASHFS
2
Phillip Lougher2bb74232014-08-08 21:24:28 +01003The squashfs3.0.tar.gz file contains this file, a README file,
Phillip Lougher8e7b9a62014-08-08 20:30:49 +01004an ACKNOWLEDGEMENTS file, a CHANGES file, the squashfs patch
Phillip Lougher2bb74232014-08-08 21:24:28 +01005directories/files, and the squashfs-tools directory (mksquashfs and unsquashfs).
Phillip Lougher2ce29a92014-08-08 05:44:57 +01006
71. Patching the kernel
8----------------------
Phillip Loughere1621932014-08-08 05:30:01 +01009
Phillip Lougher2bb74232014-08-08 21:24:28 +010010There are sixteen kernel patch directories depending on your linux kernel
Phillip Lougher5f692302014-08-08 21:18:11 +010011version. If your kernel version isn't listed then try the patch for the nearest
12kernel listed.
Phillip Lougher2ce29a92014-08-08 05:44:57 +010013
14To patch your kernel, cd into the top level directory, and run the "patch"
15comand, e.g. assuming linux-2.4.20
16
17%cd /usr/src/linux-2.4.20
Phillip Lougher2bb74232014-08-08 21:24:28 +010018%patch -p1 < location-of-squashfs/linux-2.4.20/squashfs3.0-patch
Phillip Lougher2ce29a92014-08-08 05:44:57 +010019
Phillip Lougher2bb74232014-08-08 21:24:28 +010020Where "location-of-squashfs" is the path to the squashfs3.0 source directory.
Phillip Loughere1621932014-08-08 05:30:01 +010021
22The squashfs patches patch the relevant kernel files to add configure support,
23initrd support, include files, and the squashfs directory under linux/fs/.
24Once patched, the kernel must be reconfigured, with squashfs support turned on
Phillip Lougher324aca92014-08-08 19:50:51 +010025(either Y/M) to ensure that inflate support is built into the kernel. The
26squashfs kernel option can be found in the filesystems submenu of the
Phillip Lougher8e7b9a62014-08-08 20:30:49 +010027configure menus. In the 2.6.x kernels, the squashfs option is hiding in
Phillip Lougher324aca92014-08-08 19:50:51 +010028the new miscellaneous filesystems submenu near the bottom of the filesystems
29submenu.
Phillip Lougher2ce29a92014-08-08 05:44:57 +010030
Phillip Lougher2bb74232014-08-08 21:24:28 +010031There are a set of options which are intended for use by embedded systems with
32low memory. At the "Additional options for memory-constrained systems" prompt,
33please say NO unless you're using an embedded system! Saying Y here allows you
34to specify cache sizes and how Squashfs allocates memory.
Phillip Lougher5f692302014-08-08 21:18:11 +010035
36The "Number of fragments cached" prompt allows the number of fragments cached
37to be controlled. By default SquashFS caches the last 3 fragments read from
38the filesystem. Increasing this amount may mean SquashFS has to re-read
39fragments less often from disk, at the expense of extra system memory.
40Decreasing this amount will mean SquashFS uses less memory at the expense of
41extra reads from disk. Note there must be at least one cached fragment.
42Anything much more than three will probably not make much difference.
43
44The "Use Vmalloc rather than Kmalloc" prompt allows you to tell SquashFS to
45use Vmalloc. By default SquashFS uses kmalloc to obtain fragment cache memory.
46Kmalloc memory is the standard kernel allocator, but it can fail on memory
47constrained systems. Because of the way Vmalloc works, Vmalloc can succeed
48when kmalloc fails. Specifying this option will make SquashFS always use
49Vmalloc to allocate the fragment cache memory.
50
Phillip Lougher2ce29a92014-08-08 05:44:57 +0100512. Building squashfs tools
52--------------------------
Phillip Loughere1621932014-08-08 05:30:01 +010053
Phillip Lougher2bb74232014-08-08 21:24:28 +010054The squashfs-tools directory contains the mksquashfs and unsquashfs programs.
55These can be made by typing make. The source files use a local copy of
56squashfs_fs.h (included in the kernel patches) allowing the tools to be made
57without needing to patch the kernel. The programs use Large File Support
Phillip Loughere1621932014-08-08 05:30:01 +010058(64 bit offsets etc.) and so a relatively recent glibc is needed.