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

Makefile: require user to provide extract-vmlinux #1088

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Jul 4, 2023

extract-vmlinux is GPL licensed code which makes it harder for cilium to graduate in the CNCF. Remove the vendored copy and require the user to provide the binary instead.

The path is currently hardcoded to where the binary is located on my Fedora install. We can change this so something more portable once someone runs into a problem. The target is executed only very seldomly as it is.

@lmb lmb requested a review from tgraf July 4, 2023 15:17
Makefile Outdated
@@ -107,7 +107,7 @@ generate-btf: KERNEL_VERSION?=5.19
generate-btf:
$(eval TMP := $(shell mktemp -d))
curl -fL "$(CI_KERNEL_URL)/linux-$(KERNEL_VERSION).bz" -o "$(TMP)/bzImage"
./testdata/extract-vmlinux "$(TMP)/bzImage" > "$(TMP)/vmlinux"
/usr/src/kernels/$(uname -r)/scripts/extract-vmlinux "$(TMP)/bzImage" > "$(TMP)/vmlinux"

Choose a reason for hiding this comment

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

The path is currently hardcoded to where the binary is located on my Fedora install. We can change this so something more portable once someone runs into a problem.

As far as I know, /lib/modules/$(uname -r)/build/scripts/extract-vmlinux should be more portable. /lib/modules/.../build should point to the distribution-specific location of the kernel sources. For example, on Ubuntu it's a symlink to /usr/src/linux-headers-$(uname -r), on Arch it's a plain directory, etc. Does it also work for you on Fedora?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

$ ls -l /lib/modules/$(uname -r)/build/scripts/extract-vmlinux
-rwxr-xr-x. 3 root root 1699 May 30 01:00 /lib/modules/6.3.5-200.fc38.x86_64/build/scripts/extract-vmlinux

Very nice, thanks for the suggestion!

extract-vmlinux is GPL licensed code which makes it harder for
cilium to graduate in the CNCF. Remove the vendored copy and require
the user to provide the binary instead.

Use the full path in /lib/modules which seems to be fairly portable
across Ubuntu, Arch and Fedora.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
@lmb lmb merged commit 0f74f86 into cilium:master Jul 4, 2023
2 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.

None yet

2 participants