1
votes

I have created rpm package from our project. In this package there are only binaries and scripts, the binary is dependent on specific kernel version (3.10.0-327.el7). So I added this into rpm spec file:

Requires:       kernel = 3.10.0-327.el7

now it works fine most of the time, but if there is kernel-3.10.0-327.4.4.el7 (note the 4.4.el7) installed on the target machine and not kernel-3.10.0-327.el7 then yum does not install kernel-3.10.0-327.el7 but instead install kernel-debug-3.10.0-327.el7 and this essentially break my package.

Is there a way to specify in the rpm spec file that I don't want the kernel-devel but I want exactly the specific kernel installed as dependency?

Thanks a lot.

1
Why does that break your package? Isn't that just a normal kernel built with extra debugging information? What about it doesn't suit what your package needs exactly? Is it missing files? - Etan Reisner
I think that the package are only the debug symbols, but my package has a dependency to actual kernel package, so it won't start. Also if I want to remove my package then yum write several error about broken package. - Jan
The kernel-debug package claims to be the kernel with debugging turned on. You can see that for yourself yum info kernel-debug. I didn't ask what you think breaks it. I asked what does break it. Does your application fail to run? Does it throw an error? What "broken package" errors do you get when you remove it? What does rpm -qpi --provides $your_package.rpm output? - Etan Reisner
The application itself is fine, the main problem is with yum installing different dependency. I specifically added Requires: kernel = 3.10.0-327.el7 but yum somehow install kernel-debug package, which is not what I want. Now this occurs only in one case: There is kernel-3.10.0-327.4.4.el7 installed from updates, only then it install kernel-debug package, if on the target machine is not installed the kernel from update (there is only kernel-3.10.0-229.el7) then yum correctly install kernel-3.10.0-327.el7. With the updated kernel installed it cause problem when erasing package. - Jan
To specify the problem: I have intalled the package with yum and it installed also kernel-debug, then I can remove my package, but when I want to remove the kernel-debug and install just kernel afterward it fail on dependency. Also trying only to install kernel afterward result in yum saying nothing to do. - Jan

1 Answers

2
votes

I know this is old but I just stumbled on the same issue. Hope it can be helpful to someone else. I was able to format the line as follows to resolve the issue.

Requires:       kernel-%{_target_cpu} = 3.10.0-693.el7

(Different versions, same problem.) I found this solution in the template for the kmods v1 standard. It is documented here: https://rpmfusion.org/Packaging/KernelModules/Kmods1