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

99.3. e2fsprogs-1.47.4

Utilities for the ext2, ext3 and ext4 filesystems

Version 1.47.4, release 2
Shelf filesystem — Filesystem utilities, FUSE, and network or encrypted filesystems
Phase 41_system (System), 168 of 1047 in build order
Licence GPL-2.0-only AND LGPL-2.0-only AND BSD-3-Clause AND MIT
Homepage https://e2fsprogs.sourceforge.net/
Build time 0.8 SBU
Installed size 5.5 MiB in 113 files
Recipe ports/core/filesystem/e2fsprogs/kpkgbuild

About

e2fsprogs is the toolkit for the ext2, ext3 and ext4 filesystems: mke2fs (and mkfs.ext4), e2fsck, resize2fs, tune2fs, debugfs, fuse2fs and the rest, with the libraries libext2fs, libe2p, libcom_err and libss. ext4 is the default filesystem kinstall formats an installed root with, and the one kdos persist makes a persistence store on, so mkfs.ext4 must be present on the ISO; see The filesystem table. script/phases/70_image/090_initramfs.sh copies e2fsck and its three libraries into the initramfs, which checks an ext2, ext3 or ext4 root with e2fsck -p before mounting it read-write; see Checking the root.

Sources

Dependencies

Depends on: util-linux, fuse, libarchive, file, eudev.

Required by (10): btrfs-progs, gparted, kpmcore, krb5, libblockdev, mc, nbdkit, partclone, samba, testdisk.

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 e2fsprogs'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/filesystem/e2fsprogs.

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/e2fsprogs
echo 'fd5bf388cbdbe006a3d3b318d983b2948382440acc85a87f1e7d108653e8db0b  e2fsprogs-1.47.4.tar.xz' | 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/e2fsprogs
SRC=$SRC_ROOT/e2fsprogs-1.47.4
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf e2fsprogs-1.47.4.tar.xz -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:

mkdir -v build
cd build

../configure --prefix=/usr           \
             --bindir=/bin           \
             --with-root-prefix=""   \
             --enable-elf-shlibs     \
             --disable-libblkid      \
             --disable-libuuid       \
             --disable-uuidd         \
             --disable-fsck          \
             --enable-fuse2fs        \
             --with-libarchive       \
             --with-udev-rules-dir=/lib/udev/rules.d \
             --without-crond-dir     \
             --without-systemd-unit-dir
make
make DESTDIR=$PKG install
make DESTDIR=$PKG install-libs

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/e2fsprogs, 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 e2fsprogs-1.47.4-2.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/e2fsprogs, and runs the triggers its paths call for.

Contents

Installed programs: badblocks, chattr, compile_et, debugfs, dumpe2fs, e2freefrag, e2fsck, e2image, e2label, e2mmpstatus, e2scrub, e2scrub_all, e2undo, e4crypt, e4defrag, filefrag, fsck.ext2, fsck.ext3, fsck.ext4, fuse2fs, logsave, lsattr, mk_cmds, mke2fs, mkfs.ext2, mkfs.ext3, mkfs.ext4, mklost+found, resize2fs, tune2fs.

Installed libraries: libcom_err.a, libcom_err.so, libe2p.a, libe2p.so, libext2fs.a, libext2fs.so, libss.a, libss.so.

Installed directories: /usr/include/e2p, /usr/include/et, /usr/include/ext2fs, /usr/include/ss, /usr/share/et, /usr/share/licenses/e2fsprogs, /usr/share/ss.

Short descriptions

badblocks search a device for bad blocks
chattr change file attributes on a Linux file system
compile_et error table compiler
debugfs ext2/ext3/ext4 file system debugger
dumpe2fs dump ext2/ext3/ext4 file system information
e2freefrag report free space fragmentation information
e2fsck check a Linux ext2/ext3/ext4 file system
e2image Save critical ext2/ext3/ext4 file system metadata to a file
e2label Change the label on an ext2/ext3/ext4 file system
e2mmpstatus Check MMP status of an ext4 file system
e2scrub check the contents of a mounted ext[234] file system
e2scrub_all check all mounted ext[234] file systems for errors.
e2undo Replay an undo log for an ext2/ext3/ext4 file system
e4crypt ext4 file system encryption utility
e4defrag online defragmenter for ext4 file system
filefrag report on file fragmentation
fsck.ext2 check a Linux ext2/ext3/ext4 file system
fsck.ext3 check a Linux ext2/ext3/ext4 file system
fsck.ext4 check a Linux ext2/ext3/ext4 file system
fuse2fs FUSE file system client for ext2/ext3/ext4 file systems
logsave save the output of a command in a logfile
lsattr list ext2/ext3/ext4 file attributes
mk_cmds error table compiler
mke2fs create an ext2/ext3/ext4 file system
mkfs.ext2 create an ext2/ext3/ext4 file system
mkfs.ext3 create an ext2/ext3/ext4 file system
mkfs.ext4 create an ext2/ext3/ext4 file system
mklost+found create a lost+found directory on a mounted ext2/ext3/ext4 file system
resize2fs ext2/ext3/ext4 file system resizer
tune2fs adjust tunable file system parameters on ext2/ext3/ext4 file systems
com_err.pc Common error description library
e2p.pc Ext2fs userspace programs utility library
ext2fs.pc Ext2fs library
ss.pc Subsystem command parsing library

Notes

make install-libs after make install installs the libraries’ headers, static archives and pkg-config files. Upstream’s top-level install target already ends by running install-libs (configure comments that line out only for --disable-subset), so the second command installs the same files again and changes nothing.

The initramfs copies e2fsck only when libext2fs, libcom_err and libe2p are all in /usr/lib, and otherwise prints a note and leaves it out; an ext4 root is then mounted without the check. A change here that renames those libraries, or makes e2fsck link another of its own, has to be matched in 090_initramfs.sh.