#2 Add BuildRequires for gcc to build kmod modules for fc29
Merged 5 years ago by nvieville. Opened 5 years ago by nvieville.
rpms/ nvieville/kmodtool buildrequires-gcc  into  master

file modified
+1
@@ -217,6 +217,7 @@ 

  %else

  Requires:         kernel-uname-r = ${kernel_uname_r}

  BuildRequires:    kernel-devel-uname-r = ${kernel_uname_r}

+ BuildRequires:    gcc

  %post          -n kmod-${kmodname}-${kernel_uname_r}

  %{?_prefix_usr}/sbin/depmod -aeF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} > /dev/null || :

  %postun        -n kmod-${kmodname}-${kernel_uname_r}

Signed-off-by: nvieville nicolas.vieville@uphf.fr

Since fc29 BuildRequires for gcc package is needed for C sources packages.
kmodtool needs to set this too in order to build third party kernel modules.

I don't understand this PR Is it really needed on end-users system using akmods ? or is it only needed for pre-built kmod ?

To me it seems like installing akmod-wireguard will install gcc as a dependency.

Hello Nicolas,

End-users using akmods will already have gcc installed as it is a dependency of akmods package. It seems that every akmod-module package have akmods as a dependency, so gcc will be an indirect dependency of any akmod-module package.

The problem I encountered was while re-building a module-kmod package using mock and the:

%global buildforkernels current

rpm macro in the corresponding spec file. The build failed because gcc was not found.
I know that this is not the way it is used while installing a akmod-module package.
This seems to be needed only for pre-build kmod (using mock or not). I'm sorry, but I thought it was the way to get the correct result. Maybe I missed another way.

Okay, I haven't tested it, but it might be accurate in this case.
It's just that you haven't mentioned the kmod rebuilt in mock case.

Please merge it for f29+ (only) for now.
Thx

As a side note, I don't recall why I've merged the while %if 0%{rhel} %else patching everwhere.
A good design would have been to use a correct variable where there is rhel or kabi changes and use the same code everywhere.

Thanks for your response. I will merge it once not behind a restrictive proxy (at work now).

About the %if 0%{rhel} %else patching everwhere, I suppose that one of the reasons was that correct name for kmod-module packages for RHEL are kmod-${kmodname}, and for Fedora kmod-${kmodname}-${kernel_uname_r}. Another reason maybe that weak-modules needs to be invoked while building for a rhel kernel, and for the moment, is the way to make this. I know that we should find a better way to do it even if "it should be possible to detect weak-modules support either or not the kernel is an EL kernel (RHEL/CentOS)". See your comment here: https://bugzilla.redhat.com/show_bug.cgi?id=1454824#c53
https://bugzilla.redhat.com/show_bug.cgi?id=1484041#c7
You decided to defer this better kabi checking, but I agree that it have to be done in the new/future akmods/kmodtool packages.

About the %if 0%{rhel} %else patching everwhere, I suppose that one of the reasons was that correct name for kmod-module packages for RHEL are kmod-${kmodname}, and for Fedora

So I exactly mean that: use _kmodname= $kmodname for rhel and _kmodname = $ kmodname-$kernel_uname_r for fedora once for good at the top.
And then use ${_kmodname} everywhere!

For kABI, there is a split the weak-modules with a (built time) condition, no need to conditionalize the whole section. so 0%{_with_kabi} should be enought.
Then use %if 0%{rhel} ; %global _with_kabi 1 ; %endif
It should be that simple.

Hello Nicolas,

Understood and working on it.

Re-reading your comment here (the part about weak-modules):

https://bugzilla.redhat.com/show_bug.cgi?id=1454824#c53

there stills one question (sorry): should the call to the weak-modules tool only be done when 0%{rhel} is defined (read 0%{_with_kabi} as you said in your previous message) or only when the target kernel of kmodtool is an el* kernel regardless the OS is RHEL or Fedora?

rebased onto 10a8eaf

5 years ago

Pull-Request has been merged by nvieville

5 years ago

Hello Nicolas,

Done.
Should I "fedpkg update" for f29?