-
Notifications
You must be signed in to change notification settings - Fork 69
/
README
299 lines (223 loc) · 8.57 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
squashfuse - Mount SquashFS archives using FUSE
https://github.com/vasi/squashfuse
Squashfuse lets you mount SquashFS archives in user-space. It supports almost
all features of the SquashFS format, yet is still fast and memory-efficient. So
that everyone can use it, squashfuse supports many different operating systems
and is available under a permissing license.
SquashFS is an efficiently compressed, read-only storage format. Support for it
has been built into the Linux kernel since 2009. It is very common on Live CDs
and embedded Linux distributions.
Quick start:
$ ./configure && make
$ ./squashfuse foo.squashfs mountpoint
1. Table of contents
====================
0. Introduction
1. Table of contents
2. Getting started
- System requirements
- Getting the source
- Building
- Usage
3. About squashfuse
- Is squashfuse for you?
- What's included?
- Features
- Known bugs
4. References
- Licensing
- Acknowledgements
- Links
2. Getting started
==================
2a. System requirements
-----------------------
To build and use squashfuse, you must be able to use the terminal of your
operating system.
Runtime requirements:
- FUSE 2.5 or later
- At least one of the following compression libraries
- zlib
- lzo2
- xz (aka. liblzma)
- lz4
- zstd
- (optional) libattr, for better extended attribute support on Linux
Build requirements:
- A C compiler
- make (any variant)
- sed
- (optional) pkg-config, for detection of dependencies
To build from the development repository, rather than a tarball, you'll need:
- autoconf 2.60 or later
- automake 1.11 or later
- libtool 2
Known fully-supported platforms:
- Linux
- Mac OS X
- FreeBSD
- NetBSD
- OpenIndiana
- Android
- other platforms may work too!
For a precise list of packages you will need on your OS, and other platform
notes, please see the file `PLATFORMS'.
2b. Getting the source
----------------------
The squashfuse distribution can be downloaded from SourceForge:
https://sourceforge.net/projects/squashfuse/files/
The development repository uses git, at GitHub:
http://github.com/vasi/squashfuse
2c. Installation
----------------
Squashfuse is built with the usual `configure && make'. If you need more
detailed instructions:
0. Ensure you're at your terminal, in the directory containing this README.
1. (if needed) If the file `configure' is already present, skip this step.
Otherwise, run `./autogen.sh' to generate one.
2. Run `./configure' to set up the build. You can find useful configuration
options in the file `CONFIGURATION', or by running `./configure --help'.
If configure fails, check that you really have all the requirements
installed. You may also want to check the `PLATFORMS' file to see if there
are any special notes for your operating system.
3. Run `make' to build `squashfuse'.
4. (optional) If you want to use squashfuse in this directory, that's ok.
But if you'd rather install it, run `make install'. If you need root
privileges, `sudo make install' may work.
2d. Example: Ubuntu
-------------------
For example on Ubuntu 22.04:
$ sudo apt install gcc make pkg-config libfuse3-dev \
zlib1g-dev liblzo2-dev liblzma-dev liblz4-dev libzstd-dev \
automake autoconf libtool \
fuse3 fio squashfs-tools
$ ./autogen.sh
$ ./configure
$ make -j4
$ make check
$ sudo make install
2e. Example: NixOS
------------------
For example on NixOS:
$ nix-shell
$ ./autogen.sh
$ ./configure
$ make -j4
To install to your system, a custom Nix package should be built. Otherwise,
you can simply move the binaries to `~/.local/bin'
2f. Example: macOS
------------------
On macOS, for example, install macFUSE, and then:
$ brew install autoconf automake pkg-config libtool lzo xz
$ ./autogen.sh
$ ./configure --prefix=/usr/local/ \
--with-lzo=/usr/local/Cellar/lzo/2.10 \
--with-xz=/usr/local/Cellar/xz/5.4.4
$ make -j
$ make check
$ make install
2g. Usage
---------
You'll need a SquashFS archive to use squashfuse. If you don't already have
one, you can create one using the `mksquashfs' utility from the squashfs-tools
project.
To create a SquashFS archive:
$ mksquashfs DIRECTORY ARCHIVE
To mount a SquashFS archive with squashfuse:
$ squashfuse ARCHIVE MOUNTPOINT
To unmount when you're done:
$ umount MOUNTPOINT # On Mac/BSD
$ fusermount -u MOUNTPOINT # On Linux
For more options, see the man page squashfuse(1).
3. About squashfuse
===================
3a. Is squashfuse for you?
--------------------------
Squashfuse is a great option if you have a SquashFS archive, and:
- You're not running Linux, or
- You don't have root access, or
- You're too concerned about security to use root, or
- You find it inconvenient to elevate privileges, or
- SquashFS is not built into your kernel, but FUSE is, or
- You want to hack on the SquashFS format without risking kernel panics.
Squashfuse is probably not the right tool for the job, if:
- You don't have FUSE.
More and more systems have FUSE, but some don't. Squashfuse requires it.
- You have a very old SquashFS archive.
Neither squashfuse nor the Linux kernel support SquashFS versions less
than 4.0. Use `unsquashfs' from the squashfs-tools project.
- You want to create or modify a SquashFS archive.
Neither squashfuse nor the Linux kernel support write access, use
`mksquashfs' from squashfs-tools.
- You want to extract an entire SquashFS archive.
If you don't want to mount anything, it's more efficient and convenient
to just use unsquashfs.
- You want your root filesystem `/' to be SquashFS.
This isn't well-tested, though it may be possible.
- You're highly concerned about bugs.
The SquashFS kernel module has seen much more testing than squashfuse.
If you don't yet use SquashFS, consider starting, now that squashfuse exists.
For many uses, the chief drawbacks of SquashFS were requiring Linux and root
access, but squashfuse has that covered.
- Use SquashFS for archival and backup, instead of tar.
It offers faster creation (multi-core), and browsing without unpacking.
- Use SquashFS instead of zip.
It has better compression, and faster directory lookup.
- Use SquashFS instead of compressed disk images like DMG, uzip or Partimage.
It has better compression and portability.
3b. What's included?
--------------------
Squashfuse currently comprises three programs:
* squashfuse Allows you to mount a squashfs filesystem.
* squashfuse_ll Like `squashfuse', but implemented using the low-level
FUSE API. It's a tiny bit faster, but less portable.
* squashfuse_ls Lists all the files in a squashfs archive. A demonstration
of using the squashfuse core in the absence of FUSE.
3c. Features
------------
Squashfuse supports the following SquashFS features:
- zlib, LZO, LZMA2, LZ4 and zstd decompression
- Fast, indexed directory lookup
- Fast, indexed seeking within files
- Caching of decompressed blocks
- De-duplicated files
- Sparse files
- Extended attributes
- Files larger than 4GB
Squashfuse is missing the following features:
- LZMA1 compression (deprecated)
- Support for SquashFS versions less than 4.0
- Multi-core decompression
3c. Known bugs
--------------
- On 32-bit systems with a large inode cache, when mounting a large SquashFS
archive created with the "-no-exports" option, squashfuse_ll may use a large
amount of memory. This is due to a bug in the FUSE API, where ino_t is shrunk
to 32-bits.
4. References
=============
4a. Licensing
-------------
Squashfuse is copyright (c) 2012-2014 Dave Vasilevsky <[email protected]>
Squashfuse is distributed under the 2-clause BSD license. See the file LICENSE
for details.
4b. Acknowledgements
--------------------
Thanks to:
* Phillip Lougher, for designing the SquashFS format, and implementing support
in the kernel. Also for providing permission to use and distribute
squashfs_fs.h under a BSD-style license.
* Maël Kerbiriou, for implementing LZ4 support.
4c. Links
---------
* SquashFS
- SquashFS home page, includeing squashfs-tools:
http://squashfs.sourceforge.net/
- squashfs-tools for non-Linux: https://github.com/vasi/squashfs-tools
* FUSE
- FUSE home page: http://fuse.sourceforge.net/
- OSXFUSE (FUSE for Macs): http://osxfuse.github.io/
* Other implementations of the SquashFS format
- Linux kernel: https://github.com/torvalds/linux/tree/master/fs/squashfs
- 7-zip / p7zip: http://www.7-zip.org/
- GRUB 2 bootloader: http://www.gnu.org/software/grub/