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

Require KERNEL_VERSION argument in driver-toolkit #718

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

fabiendupont
Copy link
Contributor

The default base image for the Driver Toolkit image is centos:stream9. The original work for Driver Toolkit is in OpenShift and the base image is ubi9/ubi. In bother cases, the images don't have the kernel package installed.

This change adds a test on the KERNEL_VERSION argument and exits if it's not provided at build time. This also ensure that only the relevant kernel is present when using centos:stream9 or ubi9/ubi as the base image. And this realigns a bit with the original Driver Toolkit.

&& export KERNEL_VERSION="${VERSION}-${RELEASE}" ;\
fi \
&& echo "${KERNEL_VERSION}" \
RUN if [ "${KERNEL_VERSION}" == "" ] ; then \
Copy link
Member

Choose a reason for hiding this comment

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

I prefer
test -z ${KERNEL_VERSION}

Copy link
Member

Choose a reason for hiding this comment

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

If this is not a bootable container image ,is there a reason for requiring the kernel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Driver Toolkit is only used to compile out-of-tree kernel modules. It is used for the intel-bootc and nvidia-bootc image build with a multi-stage approach. The drivers are built in DriverToolkit, then copied over the final image, which is bootable.

The default base image for the Driver Toolkit image is `centos:stream9`.
The original work for Driver Toolkit is in OpenShift and the base image
is `ubi9/ubi`. In bother cases, the images don't have the `kernel`
package installed.

This change adds a test on the `KERNEL_VERSION` argument and exits if
it's not provided at build time. This also ensure that only the
relevant kernel is present when using `centos:stream9` or `ubi9/ubi`
as the base image. And this realigns a bit with the original Driver
Toolkit.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
@fabiendupont fabiendupont force-pushed the simplify-driver-toolkit branch from a533e89 to 1a16a7a Compare August 5, 2024 10:07
@rhatdan
Copy link
Member

rhatdan commented Aug 5, 2024

LGTM

@rhatdan rhatdan merged commit 701564e into containers:main Aug 5, 2024
1 check 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.

2 participants