Skip to content

Conversation

@mwilck
Copy link
Contributor

@mwilck mwilck commented Oct 1, 2021

No description provided.

The first call is supposed to check whether the kernel at hand
is in an inconsistent state before adding the KMP. But this is
a very rare situation; has_unresolved_symbols() is a slow operation (calling
depmod) and should thus not be called without good reason.

If adding the kmp failed and OPT_DEBUG=1, we carry out this operation
to provide a clue to users.
This test is bogus because remove_kmp() is called after the actual
package removal. The symlinks may still be present, but either
point to a different KMP, or be stale.
Rather than reading "_kernel_" from stdin, use a function argument.
With initrd in posttrans and incremental depmod, the logic for
depmod and initrd rebuilding will become different.
Like for KMPs, the information whether modules are present in the
initrd is also valuable for deciding if the intird must be rebuilt
for kernel subpackages.

For the time being, we always set the _kernel_ flag, forcing the
initrd to be rebuilt for these packages, too.
With this patch, if the $INITRD_IN_POSTTRANS environment variable
is set in weak-modules2's environment, it will postpone the rebuilding
of the initramfs to the %posttrans stage if possible. Also, for kernel
subpackages like -extra or -optional, the initrd rebuild will only
be triggered if it's necessary (i.e. if the current initrd contains
at least one of the modules in the package).
@mwilck
Copy link
Contributor Author

mwilck commented Oct 1, 2021

Closing in favor of #47

@mwilck mwilck closed this Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants