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

Make kairos-sysext be generic enough to include on all flavors #477

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

Itxaka
Copy link
Member

@Itxaka Itxaka commented Oct 10, 2023

It will not install the systemd-sysext package if the binary is not there

@Itxaka Itxaka requested a review from a team October 10, 2023 08:28
@Itxaka Itxaka force-pushed the generic_sysext_package branch from f0586f2 to eda60c4 Compare October 10, 2023 08:34
@Itxaka
Copy link
Member Author

Itxaka commented Oct 10, 2023

Test ongonig for this: kairos-io/kairos#1904

@Itxaka Itxaka added the blocked label Oct 10, 2023
@Itxaka Itxaka force-pushed the generic_sysext_package branch from eda60c4 to 518df4d Compare October 10, 2023 09:32
@Itxaka
Copy link
Member Author

Itxaka commented Oct 10, 2023

Expected: On systems that do not support systemd-sysext becuase they are older, its not installed, on systems that support it, it is.

Outcome of the test:

on ubuntu-20-lts (no sysext available): +base-image | dracut: dracut module 'kairos-sysext' will not be installed, because command 'systemd-sysext' could not be found!
on ubuntu-22-lts (no sysext available): systemd-sysext module was NOT added to initramfs. Silent skip due to the comments in the code, mainly it has the binary but not the dracut module, so we add extra checks and fail in a different place.

on opensuse-tumbleweed (sysext available), systemd-sysext module was added to initramfs
on opensuse-leap (sysext available), systemd-sysext module was added to initramfs
on ubuntu (sysext available), systemd-sysext module was added to initramfs
on almalinux (sysext available), systemd-sysext module was added to initramfs
on fedora (sysext available), systemd-sysext module was added to initramfs
on debian (sysext available), systemd-sysext module was added to initramfs
on rockylinux (sysext available), systemd-sysext module was added to initramfs

So as a side effect of this generic approach of adding if its there, we GAIN sysext support in all newer distros :D

It will not install the systemd-sysext package if the binary is not
there

Signed-off-by: Itxaka <[email protected]>
@Itxaka Itxaka force-pushed the generic_sysext_package branch from 518df4d to 2dad077 Compare October 10, 2023 09:42
@Itxaka Itxaka removed the blocked label Oct 10, 2023

# called by dracut
check() {
return 0
Copy link
Member Author

Choose a reason for hiding this comment

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

This indicates to dracut to always include the module

files=( "${dracutbasedir}"/modules.d/??systemd-sysext )
[ "${#files[@]}" -ge 2 ] && return 1
if [ -d "${files[0]}" ]; then
echo "systemd-sysext"
Copy link
Member Author

Choose a reason for hiding this comment

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

this is what brings the systemd-sysext module as dependent, so it includes on systems that have botht he binary and the dracut module available, otherwise this module depends on nothing and its basically an empty thing that does nothing.

Copy link
Member

@mauromorales mauromorales left a comment

Choose a reason for hiding this comment

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

very nice

@Itxaka Itxaka merged commit d8b416b into kairos-io:main Oct 10, 2023
3 checks passed
@Itxaka Itxaka deleted the generic_sysext_package branch October 10, 2023 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants