kernel-install: do not mix || and &&

This also slightly updates log message, and make it shown only when
verbose mode is enabled.

Follow-up for b6d4997683.
This commit is contained in:
Yu Watanabe
2025-07-11 17:32:02 +09:00
parent d2e22fa6f5
commit 9026f17907
+5 -4
View File
@@ -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 \