blob: 9e65ad015a0b1abf369a7c5815b2633d27f0534a [file] [log] [blame]
Gao Xiang587bd192019-04-11 08:46:44 +08001erofs-utils
2===========
3
4erofs-utils includes user-space tools for erofs filesystem images.
5Currently only mkfs.erofs is available.
6
7mkfs.erofs
8----------
9
10It can create 2 primary kinds of erofs images: (un)compressed.
11
12 - For compressed images, it's able to use several compression
13 algorithms, but lz4(hc) are only supported due to the current
14 linux kernel implementation.
15
16 - For uncompressed images, it can decide whether the last page of
17 a file should be inlined or not properly [1].
18
19Dependencies
20~~~~~~~~~~~~
21
22 lz4-1.8.0+ for lz4 enabled [2], lz4-1.9.0+ recommended
23
24How to build for lz4-1.9.0 or above
25~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26
27To build you can run the following commands in order:
28
29::
30
31 $ ./autogen.sh
32 $ ./configure
33 $ make
34
35mkfs.erofs binary will be generated under mkfs folder.
36
37How to build for lz4-1.8.0~1.8.3
38~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39
40For these old lz4 versions, lz4hc algorithm cannot be supported without
41lz4 static libary due to LZ4_compress_HC_destSize unstable api usage,
42which means only lz4 algrithm is available if lz4 static library isn't found.
43
44On Fedora, static lz4 can be installed using:
45
46 yum install lz4-static.x86_64
47
48However, it's not recommended to use those versions since there was a bug
49in these compressors, see [2] as well.
50
51How to generate erofs images
52~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53
54Currently lz4 and lz4hc are available for compression, e.g.
55 $ mkfs.erofs -zlz4hc foo.erofs.img foo/
56
57Or leave all files uncompressed as a option:
58 $ mkfs.erofs foo.erofs.img foo/
59
Gao Xiang1f11cf02019-07-16 11:15:27 +080060How to generate legacy erofs images
61~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62
63Decompression inplace and compacted indexes have been introduced in
64linux-5.3, which are not backward-compatible with older kernels.
65
66In order to generate _legacy_ erofs images for old kernels,
67add "-E legacy-compress" to the command line, e.g.
68
69 $ mkfs.erofs -E legacy-compress -zlz4hc foo.erofs.img foo/
70
Gao Xiang587bd192019-04-11 08:46:44 +080071Obsoleted erofs.mkfs
72~~~~~~~~~~~~~~~~~~~~
73
74There is an original erofs.mkfs version developped by Li Guifu,
75which was replaced by the new erofs-utils implementation.
76
77git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git -b obsoleted_mkfs
78
79It may still be useful since new erofs-utils has not been widely used in
80commercial products. However, if that happens, please report bug to us
81as well.
82
83Contribution
84------------
85
86erofs-utils is a GPLv2+ project as a part of erofs file system,
87feel free to send patches or feedback to us.
88
89To:
90 linux-erofs mailing list <linux-erofs@lists.ozlabs.org>
91 Li Guifu <bluce.liguifu@huawei.com>
92 Miao Xie <miaoxie@huawei.com>
93 Fang Wei <fangwei1@huawei.com>
94
95Cc:
96 Gao Xiang <gaoxiang25@huawei.com>
97 Chao Yu <yuchao0@huawei.com>
98
99Comments
100--------
101
102[1] According to the erofs on-disk format, the last page of files could
103 be inlined aggressively with its metadata in order to reduce the I/O
104 overhead and save the storage space.
105
106[2] There was a bug until lz4-1.8.3, which can crash erofs-utils randomly.
107 Fortunately bugfix by our colleague Qiuyang Sun was merged in lz4-1.9.0.
108
109 For more details, please refer to
110 https://github.com/lz4/lz4/commit/660d21272e4c8a0f49db5fc1e6853f08713dff82
111