Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

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

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.

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:

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