From: Denys Vlasenko dvlasenk@redhat.com
kernel.spec: remove "RPM_VMLINUX_H=$DevelDir/vmlinux.h" code chunk in %install
Remove this code block in %install: if [ -f $DevelDir/vmlinux.h ]; then RPM_VMLINUX_H=$DevelDir/vmlinux.h fi
It was added by commit b4cac22848f6cfdbd7e52bf5fd0a2e6381f7b552 kernel.spec: Add support to use vmlinux.h
The commit added two copies of it. The second instance, in %install, does not actually work: $DevelDir is not set, so (unless your root indeed has a /vmlinux.h file) RPM_VMLINUX_H is not set, but it would not be used in %install anyway.
Signed-off-by: Denys Vlasenko dvlasenk@redhat.com
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index blahblah..blahblah 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -2811,10 +2811,6 @@ rm -f %{buildroot}%{_bindir}/timerlat popd %endif
-if [ -f $DevelDir/vmlinux.h ]; then - RPM_VMLINUX_H=$DevelDir/vmlinux.h -fi - %if %{with_bpftool} pushd tools/bpf/bpftool %{bpftool_make} prefix=%{_prefix} bash_compdir=%{_sysconfdir}/bash_completion.d/ mandir=%{_mandir} install doc-install
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2458
From: Don Zickus on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2458#note_1375015...
DevelDir I believe is a CKI env var? @veruu @mh21 ?
From: Veronika Kabátová on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2458#note_1375154...
AFAIK it's rpm variable, whether in specfile or some internals.
But the part of the code is needed to keep CKI separate tools builds to work https://gitlab.com/cki-project/kernel- ark/-/commit/b4cac22848f6cfdbd7e52bf5fd0a2e6381f7b552 ; unless something about the builds changed in the past few months
From: Denys Vlasenko on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2458#note_1375234...
I'm 100% it's not set in %install. I see the following in the log:
+ '[' -f /vmlinux.h ']'
IOW: $DevelDir expanded to nothing.
If we do not remove that code, maybe it makes sense to code more defensively? A-la [ "$DevelDir" ] || { echo "DevelDir not set"; exit 1; } [ -d "$DevelDir" ] || { echo "Not a directory: '%DevelDir'"; exit 1; } if [ -f "$DevelDir/vmlinux.h" ] ...
From: Denys Vlasenko on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2458#note_1375245...
Veronika, it is set here in specfile:
``` %build ... InitBuildVars() { ... DevelDir=/usr/src/kernels/%{KVERREL}${Variant:++${Variant}} ... BuildKernel() { ... InitBuildVars $Variant``` ... cd linux-%{KVERREL} %if %{with_debug} BuildKernel %make_target %kernel_image %{_use_vdso} debug %endif ```
IOW: it's just an ordinary shell variable, set during %build. Of course shell variables are not surviving into %install
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2458#note_1376167...
RPM_VMLINUX_H is not used anywhere else, so dropping it from %install looks safe.
From: Patrick Talbert on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2458#note_1419649...
@dzickusrh are you okay to resolve this now?
From: Don Zickus on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2458#note_1423778...
Yes, thanks for the explaination @dvlasenk !
kernel@lists.fedoraproject.org