xref: /aosp_15_r20/external/erofs-utils/docs/INSTALL.md (revision 33b1fccf6a0fada2c2875d400ed01119b7676ee5)
1*33b1fccfSAndroid Build Coastguard WorkerThis document describes how to configure and build erofs-utils from
2*33b1fccfSAndroid Build Coastguard Workersource.
3*33b1fccfSAndroid Build Coastguard Worker
4*33b1fccfSAndroid Build Coastguard WorkerSee the [README](../README) file in the top level directory about
5*33b1fccfSAndroid Build Coastguard Workerthe brief overview of erofs-utils.
6*33b1fccfSAndroid Build Coastguard Worker
7*33b1fccfSAndroid Build Coastguard Worker## Dependencies & build
8*33b1fccfSAndroid Build Coastguard Worker
9*33b1fccfSAndroid Build Coastguard WorkerLZ4 1.9.3+ for LZ4(HC) enabled [^1].
10*33b1fccfSAndroid Build Coastguard Worker
11*33b1fccfSAndroid Build Coastguard Worker[XZ Utils 5.3.2alpha+](https://tukaani.org/xz/xz-5.3.2alpha.tar.gz) for
12*33b1fccfSAndroid Build Coastguard WorkerLZMA enabled, [XZ Utils 5.4+](https://tukaani.org/xz/xz-5.4.1.tar.gz)
13*33b1fccfSAndroid Build Coastguard Workerhighly recommended.
14*33b1fccfSAndroid Build Coastguard Worker
15*33b1fccfSAndroid Build Coastguard Workerlibfuse 2.6+ for erofsfuse enabled.
16*33b1fccfSAndroid Build Coastguard Worker
17*33b1fccfSAndroid Build Coastguard Worker[^1]: It's not recommended to use LZ4 versions under 1.9.3 since
18*33b1fccfSAndroid Build Coastguard Workerunexpected crashes could make trouble to end users due to broken
19*33b1fccfSAndroid Build Coastguard WorkerLZ4_compress_destSize() (fixed in v1.9.2),
20*33b1fccfSAndroid Build Coastguard Worker[LZ4_compress_HC_destSize()](https://github.com/lz4/lz4/commit/660d21272e4c8a0f49db5fc1e6853f08713dff82) or
21*33b1fccfSAndroid Build Coastguard Worker[LZ4_decompress_safe_partial()](https://github.com/lz4/lz4/issues/783).
22*33b1fccfSAndroid Build Coastguard Worker
23*33b1fccfSAndroid Build Coastguard Worker## How to build with LZ4
24*33b1fccfSAndroid Build Coastguard Worker
25*33b1fccfSAndroid Build Coastguard WorkerTo build, the following commands can be used in order:
26*33b1fccfSAndroid Build Coastguard Worker
27*33b1fccfSAndroid Build Coastguard Worker``` sh
28*33b1fccfSAndroid Build Coastguard Worker$ ./autogen.sh
29*33b1fccfSAndroid Build Coastguard Worker$ ./configure
30*33b1fccfSAndroid Build Coastguard Worker$ make
31*33b1fccfSAndroid Build Coastguard Worker```
32*33b1fccfSAndroid Build Coastguard Worker
33*33b1fccfSAndroid Build Coastguard Worker`mkfs.erofs`, `dump.erofs` and `fsck.erofs` binaries will be
34*33b1fccfSAndroid Build Coastguard Workergenerated under the corresponding folders.
35*33b1fccfSAndroid Build Coastguard Worker
36*33b1fccfSAndroid Build Coastguard Worker## How to build with liblzma
37*33b1fccfSAndroid Build Coastguard Worker
38*33b1fccfSAndroid Build Coastguard WorkerIn order to enable LZMA support, build with the following commands:
39*33b1fccfSAndroid Build Coastguard Worker
40*33b1fccfSAndroid Build Coastguard Worker``` sh
41*33b1fccfSAndroid Build Coastguard Worker$ ./configure --enable-lzma
42*33b1fccfSAndroid Build Coastguard Worker$ make
43*33b1fccfSAndroid Build Coastguard Worker```
44*33b1fccfSAndroid Build Coastguard Worker
45*33b1fccfSAndroid Build Coastguard WorkerAdditionally, you could specify liblzma target paths with
46*33b1fccfSAndroid Build Coastguard Worker`--with-liblzma-incdir` and `--with-liblzma-libdir` manually.
47*33b1fccfSAndroid Build Coastguard Worker
48*33b1fccfSAndroid Build Coastguard Worker## How to build erofsfuse
49*33b1fccfSAndroid Build Coastguard Worker
50*33b1fccfSAndroid Build Coastguard WorkerIt's disabled by default as an experimental feature for now due
51*33b1fccfSAndroid Build Coastguard Workerto the extra libfuse dependency, to enable and build it manually:
52*33b1fccfSAndroid Build Coastguard Worker
53*33b1fccfSAndroid Build Coastguard Worker``` sh
54*33b1fccfSAndroid Build Coastguard Worker$ ./configure --enable-fuse
55*33b1fccfSAndroid Build Coastguard Worker$ make
56*33b1fccfSAndroid Build Coastguard Worker```
57*33b1fccfSAndroid Build Coastguard Worker
58*33b1fccfSAndroid Build Coastguard Worker`erofsfuse` binary will be generated under `fuse` folder.
59*33b1fccfSAndroid Build Coastguard Worker
60*33b1fccfSAndroid Build Coastguard Worker## How to install erofs-utils manually
61*33b1fccfSAndroid Build Coastguard Worker
62*33b1fccfSAndroid Build Coastguard WorkerUse the following command to install erofs-utils binaries:
63*33b1fccfSAndroid Build Coastguard Worker
64*33b1fccfSAndroid Build Coastguard Worker``` sh
65*33b1fccfSAndroid Build Coastguard Worker# make install
66*33b1fccfSAndroid Build Coastguard Worker```
67*33b1fccfSAndroid Build Coastguard Worker
68*33b1fccfSAndroid Build Coastguard WorkerBy default, `make install` will install all the files in
69*33b1fccfSAndroid Build Coastguard Worker`/usr/local/bin`, `/usr/local/lib` etc.  You can specify an
70*33b1fccfSAndroid Build Coastguard Workerinstallation prefix other than `/usr/local` using `--prefix`,
71*33b1fccfSAndroid Build Coastguard Workerfor instance `--prefix=$HOME`.
72