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