public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] kernel-install.eclass: run depmod after compressing modules
@ 2024-08-09 15:49 Andrew Ammerlaan
  2024-08-09 16:11 ` Michał Górny
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Ammerlaan @ 2024-08-09 15:49 UTC (permalink / raw
  To: gentoo-dev; +Cc: Andrew Ammerlaan

(de)compressing modules changes the path of the module files so we need to
run depmod to ensure that tools such as modprobe/modinfo work.

Note that depmod is often, but *not* always, run by sys-kernel/installkernel.
Systemd installs a hook to do this, but there is no equivalent on openrc
systems. So instead just ensure that the tree of modules we install is
consistent here in the eclass.

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
---
 eclass/kernel-install.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 496e258815d2..930640188c26 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -796,6 +796,9 @@ kernel-install_compress_modules() {
 		find "${ED}/lib/modules/${KV_FULL}" -name '*.ko' -print0 |
 			xargs -0 -P "$(makeopts_jobs)" -n 128 "${compress[@]}"
 		assert "Compressing kernel modules failed"
+
+		# Module paths have changed, run depmod
+		depmod --all --basedir "${ED}" ${KV_FULL} || die
 	fi
 }
 
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-09 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-09 15:49 [gentoo-dev] [PATCH] kernel-install.eclass: run depmod after compressing modules Andrew Ammerlaan
2024-08-09 16:11 ` Michał Górny
2024-08-09 16:50   ` Andrew Nowa Ammerlaan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox