From ed528e72dafbfdeed56ac1123b9549a23a5ff984 Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Mon, 2 Feb 2026 10:14:41 +0100 Subject: [PATCH 1/2] slices,tests: add e2fsprogs --- slices/e2fsprogs.yaml | 130 +++++++++++++++++++ tests/spread/integration/e2fsprogs/task.yaml | 79 +++++++++++ 2 files changed, 209 insertions(+) create mode 100644 slices/e2fsprogs.yaml create mode 100644 tests/spread/integration/e2fsprogs/task.yaml diff --git a/slices/e2fsprogs.yaml b/slices/e2fsprogs.yaml new file mode 100644 index 000000000..d6e272e21 --- /dev/null +++ b/slices/e2fsprogs.yaml @@ -0,0 +1,130 @@ +package: e2fsprogs + +essential: + - e2fsprogs_copyright + +slices: + standard: + essential: + - e2fsprogs_advanced + - e2fsprogs_attr + - e2fsprogs_debug + - e2fsprogs_fsck + - e2fsprogs_mkfs + - e2fsprogs_services + - e2fsprogs_tune + + # Core filesystem checking and repair tools + fsck: + essential: + - libblkid1_libs + - libc6_libs + - libcom-err2_libs + - libext2fs2t64_libs + - libuuid1_libs + contents: + /usr/sbin/e2fsck: + /usr/sbin/fsck.ext2: + /usr/sbin/fsck.ext3: + /usr/sbin/fsck.ext4: + + # Filesystem creation tools + mkfs: + essential: + - e2fsprogs_config + - libblkid1_libs + - libc6_libs + - libcom-err2_libs + - libext2fs2t64_libs + - libuuid1_libs + contents: + /usr/sbin/mke2fs: + /usr/sbin/mkfs.ext2: + /usr/sbin/mkfs.ext3: + /usr/sbin/mkfs.ext4: + + # Filesystem tuning and maintenance + tune: + essential: + - libblkid1_libs + - libc6_libs + - libcom-err2_libs + - libext2fs2t64_libs + - libuuid1_libs + contents: + /usr/sbin/e2label: + /usr/sbin/resize2fs: + /usr/sbin/tune2fs: + + # Debugging and diagnostic tools + debug: + essential: + - libblkid1_libs + - libc6_libs + - libcom-err2_libs + - libext2fs2t64_libs + - libss2_libs + - libuuid1_libs + contents: + /usr/sbin/badblocks: + /usr/sbin/debugfs: + /usr/sbin/dumpe2fs: + /usr/sbin/e2freefrag: + /usr/sbin/e2image: + /usr/sbin/e2mmpstatus: + + # File attribute tools + attr: + essential: + - libc6_libs + - libcom-err2_libs + contents: + /usr/bin/chattr: + /usr/bin/lsattr: + + # Advanced features + advanced: + essential: + - libc6_libs + - libext2fs2t64_libs + contents: + /usr/sbin/e2undo: + /usr/sbin/e4crypt: + /usr/sbin/e4defrag: + /usr/sbin/filefrag: + /usr/sbin/mklost+found: + + # Scrubbing/integrity checking + scrub: + essential: + - e2fsprogs_config + - e2fsprogs_fsck + - systemd_services + contents: + /usr/libexec/e2fsprogs/e2scrub_all_cron: + /usr/libexec/e2fsprogs/e2scrub_fail: + /usr/sbin/e2scrub: + /usr/sbin/e2scrub_all: + + config: + contents: + /etc/e2scrub.conf: + /etc/mke2fs.conf: + + services: + essential: + - e2fsprogs_scrub + - logsave_bins + contents: + /etc/cron.d/e2scrub_all: + /usr/lib/systemd/system/e2scrub@.service: + /usr/lib/systemd/system/e2scrub_all.service: + /usr/lib/systemd/system/e2scrub_all.timer: + /usr/lib/systemd/system/e2scrub_fail@.service: + /usr/lib/systemd/system/e2scrub_reap.service: + /usr/lib/udev/rules.d/64-ext4.rules: + /usr/lib/udev/rules.d/96-e2scrub.rules: + + copyright: + contents: + /usr/share/doc/e2fsprogs/copyright: diff --git a/tests/spread/integration/e2fsprogs/task.yaml b/tests/spread/integration/e2fsprogs/task.yaml new file mode 100644 index 000000000..3bbcbd16c --- /dev/null +++ b/tests/spread/integration/e2fsprogs/task.yaml @@ -0,0 +1,79 @@ +summary: Integration tests for e2fsprogs + +execute: | + rootfs="$(install-slices e2fsprogs_standard)" + + cleanup() { + umount -l "${rootfs}/dev" 2>/dev/null || true + rm -f "${rootfs}/tmp/ext2.img" "${rootfs}/tmp/ext3.img" "${rootfs}/tmp/ext4.img" "${rootfs}/tmp/ext4.e2i" "${rootfs}/tmp/testfile" 2>/dev/null || true + rm -rf "${rootfs}/tmp/mklostfound" 2>/dev/null || true + } + trap cleanup EXIT + + mkdir -p "${rootfs}/dev" "${rootfs}/tmp" + mount --bind /dev "${rootfs}/dev" + + # Basic smoke: versions/help + chroot "${rootfs}" /usr/sbin/e2fsck -V >/dev/null + chroot "${rootfs}" /usr/sbin/mke2fs -V >/dev/null + chroot "${rootfs}" /usr/sbin/debugfs -V >/dev/null + + # Create tiny filesystem images on the host (no real devices touched) + dd if=/dev/zero of="${rootfs}/tmp/ext2.img" bs=1M count=16 + dd if=/dev/zero of="${rootfs}/tmp/ext3.img" bs=1M count=16 + dd if=/dev/zero of="${rootfs}/tmp/ext4.img" bs=1M count=16 + + # mkfs.* and fsck.*: do something real but safe (-n for fsck) + chroot "${rootfs}" /usr/sbin/mkfs.ext2 -F /tmp/ext2.img >/dev/null + chroot "${rootfs}" /usr/sbin/fsck.ext2 -n /tmp/ext2.img >/dev/null + + chroot "${rootfs}" /usr/sbin/mkfs.ext3 -F /tmp/ext3.img >/dev/null + chroot "${rootfs}" /usr/sbin/fsck.ext3 -n /tmp/ext3.img >/dev/null + + chroot "${rootfs}" /usr/sbin/mkfs.ext4 -F /tmp/ext4.img >/dev/null + chroot "${rootfs}" /usr/sbin/fsck.ext4 -n /tmp/ext4.img >/dev/null + + # e2fsck should also be able to check the image directly + chroot "${rootfs}" /usr/sbin/e2fsck -fn /tmp/ext4.img >/dev/null + + # Label/tune/dump/debug/resize against the ext4 image + chroot "${rootfs}" /usr/sbin/e2label /tmp/ext4.img TESTIMG + chroot "${rootfs}" /usr/sbin/e2label /tmp/ext4.img | grep -F TESTIMG >/dev/null + + chroot "${rootfs}" /usr/sbin/tune2fs -l /tmp/ext4.img | grep -E '^Filesystem volume name:[[:space:]]*TESTIMG$' >/dev/null + chroot "${rootfs}" /usr/sbin/dumpe2fs -h /tmp/ext4.img | grep -E '^Filesystem volume name:[[:space:]]*TESTIMG$' >/dev/null + chroot "${rootfs}" /usr/sbin/resize2fs -P /tmp/ext4.img >/dev/null + chroot "${rootfs}" /usr/sbin/debugfs -R 'stats' /tmp/ext4.img | grep -E '^Block size:' >/dev/null + + # Other diagnostic tools + chroot "${rootfs}" /usr/sbin/filefrag -v /tmp/ext4.img >/dev/null + chroot "${rootfs}" /usr/sbin/badblocks -sv /tmp/ext4.img >/dev/null + + # e2image: generate a raw metadata image and ensure it was created + chroot "${rootfs}" /usr/sbin/e2image -r /tmp/ext4.img /tmp/ext4.e2i >/dev/null + test -s "${rootfs}/tmp/ext4.e2i" + + # Attributes: best-effort functional smoke on a regular file + echo "hello" > "${rootfs}/tmp/testfile" + chroot "${rootfs}" /usr/bin/lsattr /tmp/testfile >/dev/null || true + chroot "${rootfs}" /usr/bin/chattr --help 2>&1 | grep -i 'Usage' >/dev/null + + # Advanced tools: cover binaries without requiring a mounted ext4 filesystem + chroot "${rootfs}" /usr/sbin/e4crypt help 2>&1 | grep -i 'Usage\|Commands\|help' >/dev/null + chroot "${rootfs}" /usr/sbin/e4defrag --help >/dev/null + chroot "${rootfs}" /usr/sbin/e2undo --help >/dev/null + + mkdir -p "${rootfs}/tmp/mklostfound" + chroot "${rootfs}" /usr/sbin/mklost+found /tmp/mklostfound >/dev/null + test -d "${rootfs}/tmp/mklostfound/lost+found" + + # Scrub tooling (scripts/services): just verify the entrypoints respond + chroot "${rootfs}" /usr/sbin/e2scrub --help >/dev/null || true + chroot "${rootfs}" /usr/sbin/e2scrub_all --help >/dev/null || true + chroot "${rootfs}" /usr/libexec/e2fsprogs/e2scrub_fail --help >/dev/null || true + + # MMP status may require a real block device; ensure it at least runs + chroot "${rootfs}" /usr/sbin/e2mmpstatus --help >/dev/null || true + + # e2freefrag expects a mounted ext filesystem; smoke-test help only + chroot "${rootfs}" /usr/sbin/e2freefrag --help >/dev/null From e9138e0150380aeecd8e6eed291929709357e37f Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Mon, 2 Feb 2026 10:23:37 +0100 Subject: [PATCH 2/2] slices,tests: add libss2 and libext2fs2t64 --- slices/libext2fs2t64.yaml | 16 ++++++++++++++++ slices/libss2.yaml | 16 ++++++++++++++++ tests/spread/integration/libext2fs2t64/task.yaml | 9 +++++++++ tests/spread/integration/libss2/task.yaml | 8 ++++++++ 4 files changed, 49 insertions(+) create mode 100644 slices/libext2fs2t64.yaml create mode 100644 slices/libss2.yaml create mode 100644 tests/spread/integration/libext2fs2t64/task.yaml create mode 100644 tests/spread/integration/libss2/task.yaml diff --git a/slices/libext2fs2t64.yaml b/slices/libext2fs2t64.yaml new file mode 100644 index 000000000..22b81b64d --- /dev/null +++ b/slices/libext2fs2t64.yaml @@ -0,0 +1,16 @@ +package: libext2fs2t64 + +essential: + - libext2fs2t64_copyright + +slices: + libs: + essential: + - libc6_libs + contents: + /usr/lib/*-linux-*/libe2p.so.2*: + /usr/lib/*-linux-*/libext2fs.so.2*: + + copyright: + contents: + /usr/share/doc/libext2fs2t64/copyright: diff --git a/slices/libss2.yaml b/slices/libss2.yaml new file mode 100644 index 000000000..d6f347d09 --- /dev/null +++ b/slices/libss2.yaml @@ -0,0 +1,16 @@ +package: libss2 + +essential: + - libss2_copyright + +slices: + libs: + essential: + - libc6_libs + - libcom-err2_libs + contents: + /usr/lib/*-linux-*/libss.so.*: + + copyright: + contents: + /usr/share/doc/libss2/copyright: diff --git a/tests/spread/integration/libext2fs2t64/task.yaml b/tests/spread/integration/libext2fs2t64/task.yaml new file mode 100644 index 000000000..e906f360e --- /dev/null +++ b/tests/spread/integration/libext2fs2t64/task.yaml @@ -0,0 +1,9 @@ +summary: Integration tests for libext2fs2t64 + +execute: | + rootfs="$(install-slices libext2fs2t64_libs)" + + arch=$(uname -m)-linux-gnu + + test -f ${rootfs}/usr/lib/${arch}/libe2p.so.2 + test -f ${rootfs}/usr/lib/${arch}/libext2fs.so.2 diff --git a/tests/spread/integration/libss2/task.yaml b/tests/spread/integration/libss2/task.yaml new file mode 100644 index 000000000..7285801f6 --- /dev/null +++ b/tests/spread/integration/libss2/task.yaml @@ -0,0 +1,8 @@ +summary: Integration tests for libss2 + +execute: | + rootfs="$(install-slices libss2_libs)" + + arch=$(uname -m)-linux-gnu + + test -f ${rootfs}/usr/lib/${arch}/libss.so.*