-
Notifications
You must be signed in to change notification settings - Fork 71
feat(26.04): add e2fsprogs #883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: ubuntu-26.04
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -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: | ||||||||||||||
|
Comment on lines
+42
to
+44
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| # Filesystem tuning and maintenance | ||||||||||||||
| tune: | ||||||||||||||
| essential: | ||||||||||||||
| - libblkid1_libs | ||||||||||||||
| - libc6_libs | ||||||||||||||
| - libcom-err2_libs | ||||||||||||||
| - libext2fs2t64_libs | ||||||||||||||
| - libuuid1_libs | ||||||||||||||
| contents: | ||||||||||||||
| /usr/sbin/e2label: | ||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| /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: | ||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| # 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: | ||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
scrub:
essential:
- e2fsprogs_scripts
scripts:
...
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also these should be tested. it looks like they both have help if you supply some non-existent flag. you can then assert the return code is 2. this is a bit annoying to do with the #!/usr/bin/env -S bash -ex
function my_program {
echo "doing something"
return 33
}
status_file="$(mktemp)"
trap "rm -f $status_file" EXIT
out="$(
set +e
my_program
echo "$?" >"$status_file"
)"
code="$(cat "$status_file")"
echo "code: $code"
echo "output: $out"
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also, i've done the analysis of
i think you can skip the systemd part since the script accounts for it possibly not being there, but do add a comment saying that |
||||||||||||||
|
|
||||||||||||||
| 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: | ||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||||
| package: libext2fs2t64 | ||||||||
|
|
||||||||
| essential: | ||||||||
| - libext2fs2t64_copyright | ||||||||
|
|
||||||||
| slices: | ||||||||
| libs: | ||||||||
| essential: | ||||||||
| - libc6_libs | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| contents: | ||||||||
| /usr/lib/*-linux-*/libe2p.so.2*: | ||||||||
| /usr/lib/*-linux-*/libext2fs.so.2*: | ||||||||
|
|
||||||||
| copyright: | ||||||||
| contents: | ||||||||
| /usr/share/doc/libext2fs2t64/copyright: | ||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| summary: Integration tests for e2fsprogs | ||
|
|
||
| execute: | | ||
| rootfs="$(install-slices e2fsprogs_standard)" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand that For a better coverage I'd suggest to just run some smoke tests for the Use
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep. seconded ☝️ :) makes for a muuuch cleaner code imo (bash linting + syntax highlight of the test files) + spread runs all the bits as separate tests, so if one breaks it does not take the whole test down |
||
|
|
||
| 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a PR specific comment. @lczyk @cjdcordeiro we have a bunch of tests for libraries like this one, but some other libraries are not tested - should we put a convention in place to always do a simple existence check for the files?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think lots of lower hanging fruit and i'm not convinced that simple existence test is really testing anything that installability tests are not testing already. honestly, i'd even say to remove this and |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.