Skip to content
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

Draft
wants to merge 6 commits into
base: ubuntu-24.04
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions slices/util-linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
package: util-linux

essential:
- util-linux_copyright

slices:
bins:
essential:
- libblkid1_libs
- libc6_libs
- libcap-ng0_libs
- libcrypt1_libs
- libmount1_libs
- libpam0g_libs
- libselinux1_libs
- libsmartcols1_libs
- libsystemd0_libs
- libtinfo6_libs
- libudev1_libs
- libuuid1_libs
- util-linux_generated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- util-linux_generated
- util-linux_generated
- util-linux_pam-profile

I believe su requires those files in pam-profile slice to run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Affirm, su does need those files.

- zlib1g_libs
contents:
/usr/bin/addpart:
/usr/bin/choom:
/usr/bin/chrt:
/usr/bin/delpart:
/usr/bin/dmesg:
/usr/bin/fallocate:
/usr/bin/findmnt:
/usr/bin/flock:
/usr/bin/getopt:
/usr/bin/hardlink:
/usr/bin/i386: { arch: [i386, amd64] }
/usr/bin/ionice:
/usr/bin/ipcmk:
/usr/bin/ipcrm:
/usr/bin/ipcs:
/usr/bin/last:
/usr/bin/lastb:
/usr/bin/linux32:
/usr/bin/linux64:
/usr/bin/lsblk:
/usr/bin/lscpu:
/usr/bin/lsipc:
/usr/bin/lslocks:
/usr/bin/lslogins:
/usr/bin/lsmem:
/usr/bin/lsns:
/usr/bin/mcookie:
/usr/bin/mesg:
/usr/bin/more:
/usr/bin/mountpoint:
/usr/bin/namei:
/usr/bin/nsenter:
/usr/bin/partx:
/usr/bin/ppc: { arch: [ppc64el] }
/usr/bin/ppc32: { arch: [ppc64el] }
/usr/bin/ppc64: { arch: [ppc64el] }
/usr/bin/prlimit:
/usr/bin/rename.ul:
/usr/bin/resizepart:
/usr/bin/rev:
/usr/bin/s390: { arch: [s390x] }
/usr/bin/s390x: { arch: [s390x] }
/usr/bin/setarch:
/usr/bin/setpriv:
/usr/bin/setsid:
/usr/bin/setterm:
/usr/bin/su:
/usr/bin/taskset:
/usr/bin/uclampset:
/usr/bin/unshare:
/usr/bin/utmpdump:
/usr/bin/wdctl:
/usr/bin/whereis:
/usr/bin/x86_64: { arch: [amd64] }
/usr/sbin/agetty:
/usr/sbin/blkdiscard:
/usr/sbin/blkid:
/usr/sbin/blkzone:
/usr/sbin/blockdev:
/usr/sbin/chcpu:
/usr/sbin/chmem:
/usr/sbin/ctrlaltdel:
/usr/sbin/findfs:
/usr/sbin/fsck:
/usr/sbin/fsck.cramfs:
/usr/sbin/fsck.minix:
/usr/sbin/fsfreeze:
/usr/sbin/fstrim:
/usr/sbin/getty:
/usr/sbin/isosize:
/usr/sbin/ldattach:
/usr/sbin/mkfs:
/usr/sbin/mkfs.bfs:
/usr/sbin/mkfs.cramfs:
/usr/sbin/mkfs.minix:
/usr/sbin/mkswap:
/usr/sbin/pivot_root:
/usr/sbin/readprofile:
/usr/sbin/rtcwake:
/usr/sbin/runuser:
/usr/sbin/sulogin:
/usr/sbin/swaplabel:
/usr/sbin/switch_root:
/usr/sbin/wipefs:
/usr/sbin/zramctl:

# the following emulates the post-install script
generated:
contents:
/usr/bin/pager: {symlink: /usr/bin/more}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick 🙃

Suggested change
/usr/bin/pager: {symlink: /usr/bin/more}
/usr/bin/pager: {symlink: /bin/more}


mime:
contents:
/usr/lib/mime/packages/util-linux:

pam-profile:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pam-profile:
pam-profiles:

contents:
/etc/pam.d/runuser:
/etc/pam.d/runuser-l:
/etc/pam.d/su:
/etc/pam.d/su-l:

services:
essential:
- util-linux_bins
contents:
/usr/lib/systemd/system/fstrim.service:
/usr/lib/systemd/system/fstrim.timer:

copyright:
contents:
/usr/share/doc/util-linux/copyright:
31 changes: 31 additions & 0 deletions tests/spread/integration/util-linux/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
summary: Integration tests for util-linux

systems:
- -ubuntu-24.04-ppc64le
- -ubuntu-24.04-s390x

execute: |
rootfs="$(install-slices util-linux_bins)"

# we need dev/sys mounted for some of them
mkdir "${rootfs}"/dev
mkdir "${rootfs}"/sys

mount --rbind /dev "${rootfs}"/dev
mount --rbind /sys "${rootfs}"/sys

# 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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also add a test for su here to ensure that it is working properly?

# cleanup
umount -l "${rootfs}"/dev
umount -l "${rootfs}"/sys

# ensure expected links are generated
if ! [ -e "${rootfs}"/usr/bin/pager ]; then
echo "expected /usr/bin/pager to be generated"
exit 1
fi
Loading