Mailinglist Archive: opensuse-buildservice (66 mails)

< Previous Next >
Re: [opensuse-buildservice] Creating initrds with no good reason WAS: Questions about osc
On Fri, 2020-09-18 at 16:23 +0200, Hans-Peter Jansen wrote:
Am Freitag, 18. September 2020, 14:49:45 CEST schrieb Martin Wilck:

There is an easy way, and it's actually documented, albeit not very
prominently.

You can use the "-t template" option of the %kernel_module_package
macro. See section 6 of the kernel module packages manual.
(https://drivers.suse.com/doc/kmpm/Kmpm-code11.pdf)

Typically, you'd copy the default template /usr/lib/rpm/kernel-
module-
subpackage into your project as an additional source file, modify
it to
suit your needs, and feed it's path to the -t option.

Well, that's done for virtualbox already. Larry, during
investigation, I
noticed, that the spec yanks "^Provides: multiversion(kernel)" from
/usr/lib/rpm/kernel-module-subpackage, do you remember the reasoning?

multiversion(kernel) for KMPs used to cause all sorts of headaches and
subtle problems. IIRC these problems are solved with the kernel commit
"KMPs: provide and conflict a kernel version specific KMP name", which
avoids two different KMPs installed for the same kernel version, which
causes the KMPs to have these dependencies:

Provides: %{-n*}-kmp-%1-%_this_kmp_kernel_version
Conflicts: %{-n*}-kmp-%1-%_this_kmp_kernel_version

I still remember a case, where I tried to switch back to an older
kernel,
which resulted in a dysfunctional VB, since the kmp is *replaced*
with the
newest build for the latest kernel. The idea of this tag is to
support
multiple kmp builds for several kernels, and VB shouldn't be excluded
from
this.

Martin, if I read /usr/lib/rpm/kernel-module-subpackage (as of TW)
correctly,
it would suffice to supply "-b KMP_NEEDS_MKINITRD=0" to
%kernel_module_package
for suppressing the initrd regeneration. Am I right?

No, -b *forces* creation of the initrd, and KMP_NEEDS_MKINITRD=0 means
nothing (it's equivalent to KMP_NEEDS_MKINITRD not existing). If you
don't use this, and don't set KMP_NEEDS_MKINITRD=1, then weak-modules2
would look whether any modules from your KMP are contained in the
current initrd, and schedule a mkinitrd run only if that was the case.
Perhaps that's your problem? If not, it might make sense to debug what
weak-modules2 is doing, like this:

/usr/lib/module-init-tools/weak-modules2 --verbose --add-kmp
%{name}-%{version}-%{release}

Regards
Martin

--
Dr. Martin Wilck <mwilck@xxxxxxxx>, Tel. +49 (0)911 74053 2107
SUSE Software Solutions Germany GmbH
HRB 36809, AG N├╝rnberg GF: Felix
Imend├Ârffer
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >