-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat(24.04): add util-linux #330
base: ubuntu-24.04
Are you sure you want to change the base?
feat(24.04): add util-linux #330
Conversation
Diff of dependencies: slices/util-linux.yaml@@ -1,8 +1,11 @@
+base-files
libblkid1
libc6
libcap-ng0
libcrypt1
libmount1
+libpam-modules
+libpam-runtime
libpam0g
libselinux1
libsmartcols1 |
8e61ec5
to
cbaa976
Compare
cbaa976
to
f61b1cb
Compare
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.
Looks good overall. Just a couple of comments.
This commit adds a new slice su-support, which segregates the su and runuser binaries to that slice for granularity. It also modifies the tests a bit.
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.
With these changes applied, spread tests should pass, and the functionality of util-linux
should be fulfilled. The spread tests will pass only when this PR is rebased upon the newest ubuntu-24.04
branch, where PR #306 is already merged.
Co-authored-by: zhijie-yang <zhijie.yang@canonical.com> Co-authored-by: Linostar <linux.anas@gmail.com>
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.
Fix linting and wrong slice name.
Co-authored-by: zhijie-yang <zhijie.yang@canonical.com>
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.
It looks good to me now. Thanks!
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.
LGTM!
- util-linux_pam-profiles | ||
- util-linux_su-support | ||
- zlib1g_libs | ||
contents: |
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.
Sry I have to throw one more request here, but to follow our own practices, we should test every binary in the slice.
# smoke test a couple of the bundled applications | ||
chroot "${rootfs}" lsblk | grep "loop0" | ||
chroot "${rootfs}" lsipc | grep "MSGMNI" | ||
chroot "${rootfs}" lsmem | grep "Total online memory" | ||
chroot "${rootfs}" whereis lsblk | grep "/usr/bin/lsblk" |
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.
# smoke test a couple of the bundled applications | |
chroot "${rootfs}" lsblk | grep "loop0" | |
chroot "${rootfs}" lsipc | grep "MSGMNI" | |
chroot "${rootfs}" lsmem | grep "Total online memory" | |
chroot "${rootfs}" whereis lsblk | grep "/usr/bin/lsblk" | |
# Binaries involving disk, partition and device operations are only tested with | |
# the `--help` command as the smoke test. | |
# Some of the binaries are not possible to be tested with their functionalities | |
# due to the limitation of the spread test environment. | |
# Some of the binaries neither changes the status of the system, nor have | |
# deterministic outputs across different systems. They are tested without | |
# assertions. | |
chroot "${rootfs}" addpart --help | |
chroot "${rootfs}" choom -p 1 | |
chroot "${rootfs}" chrt -p 1 | |
chroot "${rootfs}" delpart --help | |
# Accessing kernel dmesg is not permitted in LXD. | |
chroot "${rootfs}" dmesg --help | |
chroot "${rootfs}" fallocate -l 1M /tmp/fallocate-test | |
test -f "${rootfs}"/tmp/fallocate-test | |
chroot "${rootfs}" findmnt | grep "/dev" | |
chroot "${rootfs}" flock /tmp/bash.lock -c "exit 0" | |
chroot "${rootfs}" getopt Hello world | grep " -- world" | |
mkdir -p "${rootfs}"/tmp/hardlink-test | |
echo "Hello world" > "${rootfs}"/tmp/hardlink-test/file1 | |
cp "${rootfs}"/tmp/hardlink-test/file1 "${rootfs}"/tmp/hardlink-test/file2 | |
chroot "${rootfs}" hardlink /tmp/hardlink-test/ | grep 'Saved:[[:blank:]]*12 B' | |
chroot "${rootfs}" ionice -P 1 | grep "best-effort: prio" | |
ipcmk_out=$(chroot "${rootfs}" ipcmk -M 1) | |
shm_id=$(echo "${ipcmk_out}" | grep -oP '\d+') | |
chroot "${rootfs}" ipcs -m | grep "${shm_id}" | |
chroot "${rootfs}" ipcrm shm "${shm_id}" | |
cp /var/log/wtmp "${rootfs}"/var/log/wtmp | |
chroot "${rootfs}" last | grep "wtmp begins" | |
chroot "${rootfs}" lsblk | grep "loop0" | |
chroot "${rootfs}" lscpu | grep "Architecture" | |
chroot "${rootfs}" lsipc | grep "MSGMNI" | |
chroot "${rootfs}" lsmem | grep "Total online memory" | |
chroot "${rootfs}" lsns | grep "init" | |
chroot "${rootfs}" mcookie | grep -E '^[0-9a-f]{32}$' | |
chroot "${rootfs}" mesg --help | |
chroot "${rootfs}" more /usr/share/doc/util-linux/copyright | grep "format" | |
chroot "${rootfs}" mountpoint /dev | grep "/dev is a mountpoint" | |
chroot "${rootfs}" namei /bin/bash | grep "l bin -> usr/bin" | |
chroot "${rootfs}" nsenter bash -c "exit 0" | |
chroot "${rootfs}" partx --help | |
chroot "${rootfs}" prlimit | grep "CPU" | |
chroot "${rootfs}" rename.ul copyright copyright2 /usr/share/doc/util-linux/copyright | |
test -f "${rootfs}"/usr/share/doc/util-linux/copyright2 | |
chroot "${rootfs}" resizepart --help | |
echo "Hello" | chroot "${rootfs}" rev | grep "olleH" | |
# i386, ppc, ppc32, ppc64, s390, s390x and x86_64 are symlinks to setarch. | |
chroot "${rootfs}" setarch --list | grep "linux32" | |
chroot "${rootfs}" setpriv bash -c "exit 0" | |
chroot "${rootfs}" setsid bash -c "exit 0" | |
chroot "${rootfs}" setterm --help | |
chroot "${rootfs}" taskset -p 1 | grep "pid 1's current affinity mask:" | |
chroot "${rootfs}" uclampset -p 1 | grep "util_clamp: min: " | |
chroot "${rootfs}" unshare bash -c "exit 0" | |
chroot "${rootfs}" utmpdump --help | |
chroot "${rootfs}" wdctl --help | |
chroot "${rootfs}" whereis lsblk | grep "/usr/bin/lsblk" | |
chroot "${rootfs}" agetty --help | |
chroot "${rootfs}" blkdiscard --help | |
fallocate -l 1M "${rootfs}"/test.img | |
mkfs.ext4 -F "${rootfs}"/test.img | |
chroot "${rootfs}" blkid /test.img | grep "ext4" | |
rm "${rootfs}"/test.img | |
chroot "${rootfs}" blkzone --help | |
chroot "${rootfs}" blockdev --help | |
chroot "${rootfs}" chcpu --help | |
chroot "${rootfs}" chmem --help | |
chroot "${rootfs}" ctrlaltdel | grep -P '[soft|hard]' | |
chroot "${rootfs}" findfs --help | |
# Dry run, outputs differ across different system configurations | |
chroot "${rootfs}" fsck -N | |
# fsck.cramfs and fsck.minix are tested together with mkfs.cramfs and mkfs.minix | |
chroot "${rootfs}" fsfreeze --help | |
chroot "${rootfs}" fstrim --help | |
chroot "${rootfs}" getty --help | |
chroot "${rootfs}" isosize --help | |
chroot "${rootfs}" ldattach --help | |
# chroot "${rootfs}" mkfs /test.img | |
fallocate -l 1M "${rootfs}"/test.img | |
chroot "${rootfs}" mkfs.bfs /test.img | |
file "${rootfs}"/test.img | grep "BFS" | |
rm "${rootfs}"/test.img | |
mkdir -p "${rootfs}"/test | |
chroot "${rootfs}" mkfs.cramfs /test /test.cramfs | |
file "${rootfs}"/test.cramfs | grep "Compressed ROM File System" | |
chroot "${rootfs}" fsck.cramfs /test.cramfs | |
rm "${rootfs}"/test.cramfs | |
rm -r "${rootfs}"/test | |
fallocate -l 1M "${rootfs}"/test.img | |
chroot "${rootfs}" mkfs.minix /test.img | |
file "${rootfs}"/test.img | grep "Minix" | |
chroot "${rootfs}" fsck.minix /test.img | |
chroot "${rootfs}" mkswap --help | |
chroot "${rootfs}" pivot_root --help | |
chroot "${rootfs}" readprofile --help | |
chroot "${rootfs}" rtcwake --help | |
cp /etc/passwd "${rootfs}"/etc/passwd | |
# sulogin expects keyboard inputs to continue or exit. | |
# Set timeout to let it exit without keyboard inputs after 1 second. | |
chroot "${rootfs}" sulogin -t 1 | |
chroot "${rootfs}" swaplabel --help | |
chroot "${rootfs}" switch_root --help | |
chroot "${rootfs}" wipefs --help | |
chroot "${rootfs}" zramctl --help |
We need to add tests for all the bins. Some architecture-dependent symlink-based executables are excluded here, but their linked real binary are tested.
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.
thanks. can you comment the tests just so we know what's happening?
What's useful to know?
-
Some architecture-dependent symlink-based executables are excluded here, but their linked real binary are tested.
- why some are just tested with
--help
- fix or explain why certain commands aren't being asserted (e.g
fallocate
,lsns
...)
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.
The following binaries are symbolically linked to /usr/bin/setarch
, and therefore excluded from the spread test:
/usr/bin/i386
/usr/bin/ppc
/usr/bin/ppc32
/usr/bin/ppc64
/usr/bin/s390
/usr/bin/s390x
/usr/bin/x86_64
For those binaries, which require complicated preparations, such as disk/block/partition operations or querying non-existing system logs, and which do not work in LXD (e.g., dmesg
), are only tested with --help
.
Some of the binaries are only run but not asserted since they do not change the system's status. As long as they exit with 0, they pass the smoking test.
Assertions are added for fallocate
and lsns
.
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.
Apologies if it wasn't clear, but the request is to comment the test itself, not the PR, for future reference
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.
Comments updated.
Proposed changes
Proposing the util-linux package
Forward porting
Will open for 24.10 once this is approved.
Related issue
Closes #260
Checklist