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

102.1. libewf-20240506

Expert Witness Format (E01, Ex01) forensic image library, the ewf tools and ewfmount

Version 20240506, release 1
Shelf security — Security applications: GnuPG and front-ends, password and secret managers, certificates, scanners, forensics and audit
Phase 41_system (System), 925 of 1047 in build order
Licence LGPL-3.0-or-later
Homepage https://github.com/libyal/libewf
Build time 1.2 SBU
Installed size 12.1 MiB in 29 files
Recipe ports/core/security/libewf/kpkgbuild

About

libewf reads and writes the Expert Witness Compression Format, the .E01 and .Ex01 (and SMART .s01) evidence files that forensic acquisition tools produce: a disk image split into segments, compressed, and carrying hashes of the acquired data. It reads the logical evidence files, .L01 and .Lx01, as well. The package holds the library and the ewf tools: ewfacquire and ewfacquirestream to make an image, ewfinfo, ewfverify, ewfexport, ewfrecover and ewfdebug, and ewfmount, which presents an image as a raw file through FUSE. sleuthkit and testdisk open evidence files through it. It is one of the libyal libraries, as are libbfio, libvhdi, libvmdk and libvslvm.

Sources

Dependencies

Depends on: pkgconf, zlib, bzip2, openssl, util-linux, fuse.

Required by (2): sleuthkit, testdisk.

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.

Patches

build.sh applies these; kpkg applies nothing by itself.

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

What kpkg does

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

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/security/libewf
echo '247d8ee9572392a2404be514d1137f099970f41f240c1134ddc3f04322281c67  libewf-20240506.tar.gz' | sha256sum -c -
echo 'ae613b97b539dbde175b9450c20236f8f57f065422bd4e3c61fc71a55400651c  fuse3.patch' | 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/libewf
SRC=$SRC_ROOT/libewf-20240506
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libewf-20240506.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:

patch -p1 -i "$PORT_SRC/fuse3.patch"

./configure \
	--prefix=/usr \
	--libdir=/usr/lib \
	--mandir=/usr/share/man \
	--disable-static \
	--disable-nls \
	--disable-rpath \
	--disable-python \
	--enable-multi-threading-support \
	--enable-openssl-evp-md \
	--enable-openssl-evp-cipher \
	--with-pthread \
	--with-zlib \
	--with-adler32=zlib \
	--with-bzip2 \
	--with-openssl \
	--with-libuuid=/usr \
	--with-libfuse \
	--with-libcerror=no \
	--with-libcthreads=no \
	--with-libcdata=no \
	--with-libcdatetime=no \
	--with-libclocale=no \
	--with-libcnotify=no \
	--with-libcsplit=no \
	--with-libuna=no \
	--with-libcfile=no \
	--with-libcpath=no \
	--with-libbfio=no \
	--with-libfcache=no \
	--with-libfdata=no \
	--with-libfdatetime=no \
	--with-libfguid=no \
	--with-libfvalue=no \
	--with-libhmac=no \
	--with-libcaes=no \
	--with-libodraw=no \
	--with-libsmdev=no \
	--with-libsmraw=no

for have in HAVE_PTHREAD HAVE_ZLIB HAVE_BZLIB HAVE_LIBCRYPTO HAVE_UUID_GENERATE_RANDOM HAVE_LIBFUSE3; do
	if ! grep -q "^#define $have 1" common/config.h; then
		echo "libewf: configure did not find $have" >&2
		exit 1
	fi
done

make
make DESTDIR=$PKG install

rm -f $PKG/usr/lib/*.la

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/libewf, 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 libewf-20240506-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/libewf, and runs the triggers its paths call for.

Contents

Installed programs: ewfacquire, ewfacquirestream, ewfdebug, ewfexport, ewfinfo, ewfmount, ewfrecover, ewfverify.

Installed libraries: libewf.so.

Installed directories: /usr/include/libewf, /usr/share/licenses/libewf.

Short descriptions

ewfacquire acquires data in the EWF format
ewfacquirestream acquires data in the EWF format from stdin
ewfexport exports media data stored in EWF files
ewfinfo show meta data stored in EWF files
ewfmount mount data stored in EWF files
ewfrecover exports media data stored in EWF files
ewfverify verifies media data stored in EWF files
libewf.pc Library to access the Expert Witness Compression Format (EWF) format

Notes

The loop after configure reads common/config.h and stops the build unless pthreads, zlib, bzip2, libcrypto, uuid_generate_random and libfuse 3 were all found. configure treats every one of them as optional and would otherwise build a smaller libewf without saying so.

rm -f $PKG/usr/lib/*.la removes the libtool archive the install leaves behind.