]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
kernel-install: do not mix || and &&
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Jul 2025 02:10:00 +0000 (11:10 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Jul 2025 08:32:02 +0000 (17:32 +0900)
This also slightly updates log message, and make it shown only when
verbose mode is enabled.

Follow-up for b6d499768394297b1d313cdc72dab0720dc315f6.

src/kernel-install/50-depmod.install

index aa2bb31a513fe2129d5d0868b85aa357fb68af23..3ce8046e6acf89e1f5e752316d8a2612614cd22b 100755 (executable)
@@ -33,11 +33,12 @@ case "$COMMAND" in
         exec depmod -a "$KERNEL_VERSION"
         ;;
     remove)
-        [ "$KERNEL_INSTALL_BOOT_ENTRY_TYPE" = "type2" ] || \
-        [ "$KERNEL_INSTALL_BOOT_ENTRY_TYPE" = "type1" ] && \
-        [ -d "/lib/modules/$KERNEL_VERSION/kernel" ] && \
-            echo "Multiple entry types exist, not removing modules.dep or associated files." && \
+        if [ -n "$KERNEL_INSTALL_BOOT_ENTRY_TYPE" ] && [ -d "/lib/modules/$KERNEL_VERSION/kernel" ]; then
+            [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
+                echo "Multiple entry types may exist, not removing modules.dep or associated files."
             exit 0
+        fi
+
         [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
             echo "Removing /lib/modules/${KERNEL_VERSION}/modules.dep and associated files"
         exec rm -f \