]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
kernel-install: skip 50-depmod if depmod is not available
authorLuca Boccassi <bluca@debian.org>
Mon, 7 Nov 2022 16:28:33 +0000 (16:28 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 7 Nov 2022 21:30:07 +0000 (22:30 +0100)
Images might be built without any kernel module, and without
installing depmod as it is not needed. Skip it.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1023607

src/kernel-install/50-depmod.install

index d4b991cfd62626cb7b16ac5f31e81b095a571753..43bd87c7edaf5d7f9075238dced4d7b92c7a4d33 100755 (executable)
@@ -26,6 +26,7 @@ KERNEL_VERSION="${2:?}"
 case "$COMMAND" in
     add)
         [ -d "/lib/modules/$KERNEL_VERSION/kernel" ] || exit 0
+        command -v depmod >/dev/null || exit 0
         [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+depmod -a $KERNEL_VERSION"
         exec depmod -a "$KERNEL_VERSION"
         ;;