Gao Xiang | 587bd19 | 2019-04-11 08:46:44 +0800 | [diff] [blame] | 1 | erofs-utils |
| 2 | =========== |
| 3 | |
| 4 | erofs-utils includes user-space tools for erofs filesystem images. |
| 5 | Currently only mkfs.erofs is available. |
| 6 | |
| 7 | mkfs.erofs |
| 8 | ---------- |
| 9 | |
| 10 | It 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 | |
| 19 | Dependencies |
| 20 | ~~~~~~~~~~~~ |
| 21 | |
| 22 | lz4-1.8.0+ for lz4 enabled [2], lz4-1.9.0+ recommended |
| 23 | |
| 24 | How to build for lz4-1.9.0 or above |
| 25 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 26 | |
| 27 | To build you can run the following commands in order: |
| 28 | |
| 29 | :: |
| 30 | |
| 31 | $ ./autogen.sh |
| 32 | $ ./configure |
| 33 | $ make |
| 34 | |
| 35 | mkfs.erofs binary will be generated under mkfs folder. |
| 36 | |
| 37 | How to build for lz4-1.8.0~1.8.3 |
| 38 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 39 | |
| 40 | For these old lz4 versions, lz4hc algorithm cannot be supported without |
| 41 | lz4 static libary due to LZ4_compress_HC_destSize unstable api usage, |
| 42 | which means only lz4 algrithm is available if lz4 static library isn't found. |
| 43 | |
| 44 | On Fedora, static lz4 can be installed using: |
| 45 | |
| 46 | yum install lz4-static.x86_64 |
| 47 | |
| 48 | However, it's not recommended to use those versions since there was a bug |
| 49 | in these compressors, see [2] as well. |
| 50 | |
| 51 | How to generate erofs images |
| 52 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 53 | |
| 54 | Currently lz4 and lz4hc are available for compression, e.g. |
| 55 | $ mkfs.erofs -zlz4hc foo.erofs.img foo/ |
| 56 | |
| 57 | Or leave all files uncompressed as a option: |
| 58 | $ mkfs.erofs foo.erofs.img foo/ |
| 59 | |
Gao Xiang | 1f11cf0 | 2019-07-16 11:15:27 +0800 | [diff] [blame^] | 60 | How to generate legacy erofs images |
| 61 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 62 | |
| 63 | Decompression inplace and compacted indexes have been introduced in |
| 64 | linux-5.3, which are not backward-compatible with older kernels. |
| 65 | |
| 66 | In order to generate _legacy_ erofs images for old kernels, |
| 67 | add "-E legacy-compress" to the command line, e.g. |
| 68 | |
| 69 | $ mkfs.erofs -E legacy-compress -zlz4hc foo.erofs.img foo/ |
| 70 | |
Gao Xiang | 587bd19 | 2019-04-11 08:46:44 +0800 | [diff] [blame] | 71 | Obsoleted erofs.mkfs |
| 72 | ~~~~~~~~~~~~~~~~~~~~ |
| 73 | |
| 74 | There is an original erofs.mkfs version developped by Li Guifu, |
| 75 | which was replaced by the new erofs-utils implementation. |
| 76 | |
| 77 | git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git -b obsoleted_mkfs |
| 78 | |
| 79 | It may still be useful since new erofs-utils has not been widely used in |
| 80 | commercial products. However, if that happens, please report bug to us |
| 81 | as well. |
| 82 | |
| 83 | Contribution |
| 84 | ------------ |
| 85 | |
| 86 | erofs-utils is a GPLv2+ project as a part of erofs file system, |
| 87 | feel free to send patches or feedback to us. |
| 88 | |
| 89 | To: |
| 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 | |
| 95 | Cc: |
| 96 | Gao Xiang <gaoxiang25@huawei.com> |
| 97 | Chao Yu <yuchao0@huawei.com> |
| 98 | |
| 99 | Comments |
| 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 | |