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

os: disable dracut for ostree based systems on rpm installation #895

Merged
merged 4 commits into from
Sep 3, 2024

Conversation

mmartinv
Copy link
Contributor

@mmartinv mmartinv commented Sep 3, 2024

Installing the minimal-environment RPM group implies the installation
of dracut-config-rescue which makes org.osbuild.ostree.preptree to
fail because rpm-ostree detects multiple kernels within the tree
(the usual one and the rescue one). Disabling dracut during the rpm
installation prevents the rescue kernel/initrd to be generated and
makes rpm-ostree to finish the compose succesfully.

rpm-ostree runs dracut on his own during the compose so this doesn't
seem to affect the final result.

Resolves: #624

supakeen
supakeen previously approved these changes Sep 3, 2024
Copy link
Member

@supakeen supakeen left a comment

Choose a reason for hiding this comment

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

Does what it needs to do; perhaps we could use a (boot) test to ensure that user customized systems that add dracut-config-rescue build after this.

@achilleas-k How do you feel having the check here, I could also see it living inside the RPM stage wrapper.

@achilleas-k
Copy link
Member

The edge AMI builds are boot tested in gitlab CI, so the base case here has already passed.
The edge-ostree-pull-user config for example is configured to build an edge-ami:

"./configs/edge-ostree-pull-user.json": {
"image-types": [
"edge-ami"
]
},

using the edge-container image type with the empty config as its base:
"depends": {
"config": "empty.json",
"image-type": "edge-container"
},

In the CI run for this PR, the edge-container was built with dracut disabled: https://gitlab.com/redhat/services/products/image-builder/ci/images/-/jobs/7725683968#L1903
and the AMI that was built using it was successfully booted in AWS:
https://gitlab.com/redhat/services/products/image-builder/ci/images/-/jobs/7725901360

So we're covered for the base case in terms of testing, which is nice. But since this PR was made to address a specific use case, we could add an extra test config that installs @minimal-environment (or dracut-config-rescue directly) to make sure the intended use case is also working as expected.

@achilleas-k
Copy link
Member

Added new build configs for this scenario.

supakeen
supakeen previously approved these changes Sep 3, 2024
@achilleas-k
Copy link
Member

Messed something up with the configs. Fixing.

Installing the `minimal-environment` RPM group implies the installation
of `dracut-config-rescue` which makes `org.osbuild.ostree.preptree` to
fail because `rpm-ostree` detects multiple kernels within the tree
(the usual one and the rescue one). Disabling dracut during the rpm
installation prevents the rescue kernel/initrd to be generated and
makes `rpm-ostree` to finish the compose succesfully.

`rpm-ostree` runs dracut on his own during the compose so this doesn't
seem to affect the final result.

Resolves: osbuild#624
supakeen
supakeen previously approved these changes Sep 3, 2024
The @minimal-environment rpm group includes 'dracut-config-rescue'
which, by default, will create a rescue kernel configuration.  With
ostree-based images, this will fail, since rpm-ostree requires that only
one kernel exists in an image.  We now disable dracut when installing
packages for ostree commits, so this should no longer be a problem.

Adding a configuration pair to test that the image builds and boots.
The configs include:
1. An edge-container built with the @minimal-environment rpm group,
   which will pull in the dracut-config-rescue package.  This is built
   for all RHEL 9 versions.
2. An edge-ami built using the new edge container as input.  The config
   includes a user so that the image can be booted in CI.
The podman stop command was passing the list of container IDs as a
single argument with spaces in it, which is wrong.  The arguments need
to be separate, so we should expand the list of IDs instead.

This was never an issue because we never had multiple containers in a
distro's ostree build config until now.
@achilleas-k achilleas-k added this pull request to the merge queue Sep 3, 2024
Merged via the queue into osbuild:main with commit 3ee4b46 Sep 3, 2024
18 checks passed
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.

Consider excluding dracut-config-rescue in ostree-based images
3 participants