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 debianutils #335

Open
wants to merge 1 commit into
base: ubuntu-24.04
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
35 changes: 35 additions & 0 deletions slices/debianutils.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package: debianutils

essential:
- debianutils_copyright

slices:
bins:
essential:
- debianutils_config
- libc6_libs

Choose a reason for hiding this comment

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

dash_bins can be added as a dependency here for the executables that are actually shell scripts.

contents:
/usr/bin/ischroot:
/usr/bin/run-parts:
/usr/bin/savelog:

Choose a reason for hiding this comment

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

A few of these executables are scripts. We need to figure out how we are going to link /bin/sh in #337 first

/usr/bin/tempfile:
/usr/bin/which.debianutils:
/usr/sbin/add-shell:
/usr/sbin/installkernel:
/usr/sbin/remove-shell:
/usr/sbin/update-shells:

# the following emulates the post-install script
which:
essential:
- debianutils_bins
contents:
/usr/bin/which: {symlink: /usr/bin/which.debianutils}

Choose a reason for hiding this comment

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

/usr/bin/which.debianutils: should be in contents here so that this slice doesn't unnecessarily depend on unneeded binaries in bins slice.


config:
contents:
/usr/share/debianutils/shells:

Choose a reason for hiding this comment

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

This file isn't necessary as a slice. However, this file is copied in the maintainer scripts to /etc/shells if that file doesn't exist, so please add a mutation script for that.


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

execute: |
rootfs="$(install-slices bash_bins base-files_base coreutils_bins debianutils_bins debianutils_which)"

# ischroot needs proc mounted
mkdir -p "${rootfs}"/proc
mount --bind /proc "${rootfs}"/proc

# some executables are scripts that need /bin/sh
chroot "$rootfs" ln -s /usr/bin/bash /bin/sh

# smoke test some of the binaries
chroot "${rootfs}" /usr/bin/ischroot
chroot "${rootfs}" /usr/bin/which savelog | grep "/usr/bin/savelog"
chroot "${rootfs}" /usr/bin/run-parts --list --regex 'shell$' /usr/sbin | tr '\n' ' ' | grep "/usr/sbin/add-shell /usr/sbin/remove-shell"

# run the update-shells to generate the shells file, this
# will output an error due to missing dpkg-realpath

Choose a reason for hiding this comment

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

Since it's this case, the package dpkg which contains dpkg-realpath should be a dependency of debianutils as well.

chroot "${rootfs}" /usr/sbin/update-shells || true

# still expect the file to be generated
if ! [ -e "${rootfs}/etc/shells" ]; then
echo "expected shells file to be generated"
exit 1
fi

# cleanup
umount "${rootfs}"/proc
Loading