update-kernel: Suggest user to not install if there aren't some external modules

Example of such module is zfs.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
This commit is contained in:
Виталий Чикунов 2022-04-10 08:35:38 +03:00
parent 4bde3fdaa1
commit 1a4c7b206f

View File

@ -405,6 +405,7 @@ ALLNAMES=$(echo -n "$ALLMODULES" | sed "s/-$kernel_flavour#.*//;s/kernel-modules
# - you cannot guess flavour from module package name;
# - perhaps this will overwhelm user;
# thus only two flavours should be checked - booted and the same as selected.
absent_modules=
check_external_modules() {
local word=$1 flavour=$2 MODINSTALLED LOSTMODS num
[ -n "$flavour" ] || return
@ -423,12 +424,16 @@ check_external_modules() {
echo >&2 "${RED}installed for your $word $flavour kernel:${NORM}"
# shellcheck disable=SC2086
echo >&2 " " $LOSTMODS
absent_modules=1
fi
}
check_external_modules "previous" "$kernel_flavour"
[ "$current_kernel_flavour" != "$kernel_flavour" ] && \
check_external_modules "BOOTED" "$current_kernel_flavour"
if [ -n "$absent_modules" ]; then
echo >&2 "${RED}Do not answer yes if these modules are important for your system.${NORM}"
fi
# user module selection interface
user_selected_modules=