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

Include "kheaders" and build a kernel-devel RPM #557

Merged
merged 2 commits into from
Dec 5, 2019
Merged

Include "kheaders" and build a kernel-devel RPM #557

merged 2 commits into from
Dec 5, 2019

Conversation

sam-aws
Copy link
Contributor

@sam-aws sam-aws commented Nov 22, 2019

Issue #, if available:
#454

Description of changes:
This includes two changes, one to the Thar image and one that produces an extra build artifact.

  • Include a squashed backport of /sys/kernel/kheaders.tar.xz which provides an archive of (just) the current kernel header files
  • At build time create a "kernel-devel" RPM which includes the configured source tree allowing for out-of-tree module builds. This is intended to later be consumed out of band or via a TUF target, etc.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tested by launching an instance and unpacking the kernel headers. Module building tested by building a module and eBPF probe against the RPM contents and running it on Thar.

Copy link
Contributor

@bcressey bcressey 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!

packages/kernel/kernel.spec Outdated Show resolved Hide resolved
packages/kernel/kernel.spec Outdated Show resolved Hide resolved
packages/kernel/kernel.spec Outdated Show resolved Hide resolved
Copy link
Contributor

@tjkirch tjkirch left a comment

Choose a reason for hiding this comment

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

It might help review to include a copy of kernel_devel_files (in a private gist if it's long) so we can see what will be in the package.

packages/kernel/kernel.spec Outdated Show resolved Hide resolved
packages/kernel/kernel.spec Outdated Show resolved Hide resolved
packages/kernel/kernel.spec Outdated Show resolved Hide resolved
packages/kernel/kernel.spec Outdated Show resolved Hide resolved
@sam-aws
Copy link
Contributor Author

sam-aws commented Dec 4, 2019

Dropped the Requires, reorganised and sorted the file list, and simplified to install -D

Backport the "kheaders" functionality from upstream which adds
/sys/kernels/kheaders.tar.xz, an archive of the current kernel headers.
While this doesn't support out-of-tree module building, for BPF probes
that only need the current kernel headers it is sufficient.

Signed-off-by: Samuel Mendoza-Jonas <[email protected]>
When building the kernel also create a 'kernel-devel' RPM which includes
the configured kernel source tree and extra artifacts to support
building out-of-tree modules. This is not included in the Thar image,
but is instead intended to be downloaded later on a running instance via
a TUF target, for example.

Based off a similar script provided by Ben Cressey <[email protected]>

Signed-off-by: Samuel Mendoza-Jonas <[email protected]>
@sam-aws
Copy link
Contributor Author

sam-aws commented Dec 4, 2019

Updated with the kheaders patches split out individually.

Copy link
Contributor

@iliana iliana left a comment

Choose a reason for hiding this comment

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

Appreciated, ship it!

@sam-aws sam-aws merged commit da6ce03 into develop Dec 5, 2019
@sam-aws sam-aws deleted the kernel branch December 5, 2019 00:09
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.

4 participants