99.20. erofs-utils-1.9.4
Tools for the EROFS read-only filesystem KDOS packs are built as
| Version | 1.9.4, release 1 |
| Shelf | filesystem — Filesystem utilities, FUSE, and network or encrypted filesystems |
| Phase | 41_system (System), 523 of 1047 in build order |
| Licence | MIT AND (GPL-2.0-or-later OR MIT) |
| Homepage | https://erofs.docs.kernel.org/ |
| Build time | 1.0 SBU |
| Installed size | 945.0 KiB in 11 files |
| Recipe | ports/core/filesystem/erofs-utils/kpkgbuild |
About
erofs-utils builds and inspects EROFS images, the compressed read-only filesystem the kernel mounts directly: mkfs.erofs makes one, fsck.erofs checks and extracts one, and dump.erofs prints its layout. Every KDOS pack is an EROFS image with its metadata, icon and signatures appended. kdos-pack makes the image by running mkfs.erofs -zzstd -b 4096 with a fixed timestamp, owner and UUID, so that a pack depends only on its inputs; see Reproducibility. script/phases/70_image/100_packs.sh runs it the same way for the root-filesystem pack when KDOS_PACK_KDOS=1 asks for one. The kdos-pack and kdos-packd ports depend on this one.
Sources
erofs-utils-1.9.4.tar.gz(267.1 KiB)
sha2567d135aa2550326a5acf20f53c518aea5a8900015ce50700044e40f818c31dd80
upstream: https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/snapshot/erofs-utils-1.9.4.tar.gz
archive copy: sources-2/filesystem--erofs-utils-1.9.4.tar.gz
Dependencies
Depends on: autoconf, automake, libtool, pkgconf, lz4, zstd, xz, zlib.
Required by (2): kdos-pack, kdos-packd.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
--without-xxhash, line 23: xxhash (explained with the switches below)--without-libcurl, line 24: curl--without-openssl, line 25: openssl--without-libxml2, line 26: libxml2--without-json-c, line 27: json-c--without-uuid, line 29: util-linux (explained with the switches below)--disable-fuse, line 31: fuse (explained with the switches below)
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install erofs-utils'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/filesystem/erofs-utils.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/filesystem/erofs-utils
echo '7d135aa2550326a5acf20f53c518aea5a8900015ce50700044e40f818c31dd80 erofs-utils-1.9.4.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/erofs-utils
SRC=$SRC_ROOT/erofs-utils-1.9.4
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf erofs-utils-1.9.4.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
autoreconf -f -i -s
./configure \
--prefix=/usr \
--libdir=/usr/lib \
--sbindir=/usr/sbin \
--disable-static \
--enable-lz4 \
--enable-lzma \
--enable-multithreading \
--with-libzstd \
--with-zlib \
--without-xxhash \
--without-libcurl \
--without-openssl \
--without-libxml2 \
--without-json-c \
--without-libnl3 \
--without-uuid \
--without-selinux \
--disable-fuse
make
make DESTDIR=$PKG install
The switches, and why each is set:
autoreconf -f -i -s— The source is a git snapshot from kernel.org withconfigure.acbut noconfigure, so the build system is generated first.--sbindir=/usr/sbin— Wheremount.erofsgoes, the default for--prefix=/usr, named here.mkfs.erofs,fsck.erofsanddump.erofsinstall into/usr/bin.--enable-lz4,--enable-lzma— Build LZ4 and LZMA compression, from lz4 and xz. Both default toauto, which would build them only when the library is found.--with-libzstd— Builds zstd compression, from zstd, and makes a missing libzstd a configure error where the default,auto, would build without it. A pack’s image is compressed with zstd (-zzstd); amkfs.erofswithout zstd refuses that compressor and no pack can be built.--with-zlib— Uses zlib to inflate DEFLATE data, so the tools can read a DEFLATE-compressed image andmkfs.erofscan take a gzip-compressed tar as input. Named, the switch makes a missing zlib a configure error where the default,auto, would build without it. DEFLATE compression itself is erofs-utils’ own code and is built either way.--enable-multithreading— Compresses with several threads. It is upstream’s default.--without-xxhash,--without-libcurl,--without-openssl,--without-libxml2,--without-json-c,--without-libnl3— Link none of these libraries. libcurl and json-c are what the OCI registry input needs, and libcurl, OpenSSL and libxml2 what S3 image generation needs; both features are off unless asked for (--enable-oci,--enable-s3). libnl3 is the generic-netlink library of the NBD backend, and without libxxhash erofs-utils compiles its own copy of the hash. Each defaults toauto: without the switch configure links the library whenever an earlier port has installed it, and the package then needs a library itsdependsline does not name.--without-uuid— Builds without util-linux’s libuuid, which upstream’s default requires: without the switch configure stops when pkg-config finds nouuid, anddependsdoes not name util-linux. erofs-utils then generates a UUID withgetrandomand parses one given with-Uby its own code, sokdos-pack’s fixed UUID works the same.--without-selinux— Builds no SELinux file labelling. No libselinux port exists. It is upstream’s default.--disable-fuse— Builds noerofsfuse, which mounts an image in user space through FUSE.kdos-packdmounts packs with the kernel’s EROFS driver, from the pack file directly or through a loop device. It is upstream’s default.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/erofs-utils, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf erofs-utils-1.9.4-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/erofs-utils, and runs the triggers its paths call for.
Contents
Installed programs: dump.erofs, fsck.erofs, mkfs.erofs, mount.erofs.
Installed directories: /usr/share/licenses/erofs-utils.
Short descriptions
dump.erofs |
retrieve directory and file entries, show specific file or overall disk statistics information from an EROFS-formatted image. |
fsck.erofs |
tool to check an EROFS filesystem's integrity |
mkfs.erofs |
tool to create an EROFS filesystem |
mount.erofs |
manage EROFS filesystem |