dcavalca / rpms / systemd

Forked from rpms/systemd 4 months ago
Clone
2aacef
From d1abf107c5b4c661886001de996bf03587bb35c1 Mon Sep 17 00:00:00 2001
2aacef
From: Luca Boccassi <bluca@debian.org>
2aacef
Date: Mon, 7 Nov 2022 16:28:33 +0000
2aacef
Subject: [PATCH] kernel-install: skip 50-depmod if depmod is not available
2aacef
2aacef
Images might be built without any kernel module, and without
2aacef
installing depmod as it is not needed. Skip it.
2aacef
2aacef
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1023607
2aacef
(cherry picked from commit cda4d00dfcbcd075cef95341f8a466f0c4ee8e1d)
2aacef
2aacef
Related #2138081
2aacef
---
2aacef
 src/kernel-install/50-depmod.install | 1 +
2aacef
 1 file changed, 1 insertion(+)
2aacef
2aacef
diff --git a/src/kernel-install/50-depmod.install b/src/kernel-install/50-depmod.install
2aacef
index d4b991cfd6..43bd87c7ed 100755
2aacef
--- a/src/kernel-install/50-depmod.install
2aacef
+++ b/src/kernel-install/50-depmod.install
2aacef
@@ -26,6 +26,7 @@ KERNEL_VERSION="${2:?}"
2aacef
 case "$COMMAND" in
2aacef
     add)
2aacef
         [ -d "/lib/modules/$KERNEL_VERSION/kernel" ] || exit 0
2aacef
+        command -v depmod >/dev/null || exit 0
2aacef
         [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+depmod -a $KERNEL_VERSION"
2aacef
         exec depmod -a "$KERNEL_VERSION"
2aacef
         ;;