kbuild: add resolve_btfids to pacman PKGBUILD
PATCH 1/1 kbuild: add resolve_btfids to pacman PKGBUILD
If the config is using DEBUG_INFO_BTF, it is required to, package resolve_btfids with.
Compiling dkms modules will fail otherwise.
Add a check, if resolve_btfids is present and then package it, if required.
--- scripts/package/PKGBUILD | 5 +++++ 1 file changed, 5 insertions(+)
scripts/package/PKGBUILD +5 -0
@@ -91,6 +91,11 @@ _package-headers() { "${srctree}/scripts/package/install-extmod-build" "${builddir}" fi + # required when DEBUG_INFO_BTF_MODULES is enabled + if [ -f tools/bpf/resolve_btfids/resolve_btfids ]; then + install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids + fi + echo "Installing System.map and config..." mkdir -p "${builddir}" cp System.map "${builddir}/System.map"
Signature · 1 line
2.47.0
Thomas Weißschuh
maintainerQuoted 2 lines · Peter Jung
If the config is using
DEBUG_INFO_BTF, it is required to, packageresolve_btfidswith.
This sentence sounds weird.
Quoted 1 line
Compiling dkms modules will fail otherwise.
Maybe we should add it to scripts/package/install-extmod-build so it also works for all the other package types?
Quoted 12 lines
Add a check, if
resolve_btfidsis present and then package it, if required.Signed-off-by Peter Jung <[email protected]>--- scripts/package/PKGBUILD | 5 +++++ 1 file changed, 5 insertions(+)scripts/package/PKGBUILD +0
-0
scripts/package/PKGBUILD _package-headers() { · line 95
Quoted 5 lines
scripts/package/PKGBUILD +2
-0@@ -91,6 +91,11 @@ _package-headers() { "${srctree}/scripts/package/install-extmod-build" "${builddir}" fi + # required when DEBUG_INFO_BTF_MODULES is enabled + if [ -f tools/bpf/resolve_btfids/resolve_btfids ]; then
I would prefer to actually test for DEBUG_INFO_BTF_MODULES instead of file existence. This file may be stale when the option got disabled.
Quoted 9 lines
scripts/package/PKGBUILD +3
-0+ install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids + fi + echo "Installing System.map and config..." mkdir -p "${builddir}" cp System.map "${builddir}/System.map"Signature · 1 line
2.47.0
Quoted 17 lines · Peter Jung
If the config is using
DEBUG_INFO_BTF, it is required to, packageresolve_btfidswith.
Compiling dkms modules will fail otherwise.Add a check, if
resolve_btfidsis present and then package it, if required.Signed-off-by Peter Jung <[email protected]>--- scripts/package/PKGBUILD | 5 +++++ 1 file changed, 5 insertions(+)scripts/package/PKGBUILD +0
-0
scripts/package/PKGBUILD _package-headers() { · line 98
Quoted 8 lines
scripts/package/PKGBUILD +5
-0@@ -91,6 +91,11 @@ _package-headers() { "${srctree}/scripts/package/install-extmod-build" "${builddir}" fi + # required when DEBUG_INFO_BTF_MODULES is enabled + if [ -f tools/bpf/resolve_btfids/resolve_btfids ]; then + install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids + fi +
This is not the right place.
scripts/package/install-extmod-build is a script to set up the build environment to build external modules. It is shared by rpm-pkg, deb-pkg, and pacman-pkg.
https://github.com/torvalds/linux/blob/v6.12-rc5/scripts/package/install-extmod-build#L34
You will see how objtool is copied.
(Anyway, it depends on your urgency.
My hope is to support objtool and resolve_btfids in more generic ways.)
Signature · 2 lines
Best Regards Masahiro Yamada
Quoted 34 lines · Masahiro Yamada
Quoted 16 lines · Peter Jung
If the config is using
DEBUG_INFO_BTF, it is required to, packageresolve_btfidswith.
Compiling dkms modules will fail otherwise.Add a check, if
resolve_btfidsis present and then package it, if required.Signed-off-by Peter Jung<[email protected]>--- scripts/package/PKGBUILD | 5 +++++ 1 file changed, 5 insertions(+)scripts/package/PKGBUILD +0
-0scripts/package/PKGBUILD _package-headers() { · line 98
Quoted 8 lines
scripts/package/PKGBUILD +5
-0@@ -91,6 +91,11 @@ _package-headers() { "${srctree}/scripts/package/install-extmod-build" "${builddir}" fi + # required when DEBUG_INFO_BTF_MODULES is enabled + if [ -f tools/bpf/resolve_btfids/resolve_btfids ]; then + install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids + fi +This is not the right place.
scripts/package/install-extmod-buildis a script to set up the build environment to build external modules. It is shared by rpm-pkg, deb-pkg, and pacman-pkg.https://github.com/torvalds/linux/blob/v6.12-rc5/scripts/package/install-extmod-build#L34
Quoted 8 lines
You will see how objtool is copied.
(Anyway, it depends on your urgency.
My hope is to support objtool andresolve_btfidsin more generic ways.)
Thanks Masahiro for the suggestion. I will look into and likely bring a v2.
I did not know about other distribution/package managers, if this is also a problem at them.
At archlinux we have included this since a while already in the PKGBUILD, see here:
https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/blob/main/PKGBUILD?ref_type=heads#L151-152
I will also make the change to grep for DEBUG_INFO_BTF in the config with the is_enabled function, instead of checking the path
Regards,
Peter