From 6acd1ee27bc13f26604bacb461d9c6faf45231f4 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Sun, 30 Aug 2026 10:47:46 +0200 Subject: [PATCH] Check for valid AUTOINSTALL values also in dkms_common.postinst.in --- dkms_common.postinst.in | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/dkms_common.postinst.in b/dkms_common.postinst.in index b764ac0f..df0634fc 100644 --- a/dkms_common.postinst.in +++ b/dkms_common.postinst.in @@ -157,10 +157,19 @@ fi dkms_conf="/var/lib/dkms/$NAME/$VERSION/source/dkms.conf" autoinstall=$(bash -c 'AUTOINSTALL=; . "'"$dkms_conf"'" >/dev/null 2>&1; echo $AUTOINSTALL') -if [ -z "$autoinstall" ]; then - echo "Not building the $NAME module which does not have AUTOINSTALL enabled." - exit 0 -fi +# Same check as in dkms.conf: only "yes" enables autoinstallation +case "$autoinstall" in + [Yy][Ee][Ss]) + ;; + ""|[Nn][Oo]) + echo "Not building the $NAME module which does not have AUTOINSTALL enabled." + exit 0 + ;; + *) + echo "dkms.conf: Error! Unsupported AUTOINSTALL value '$autoinstall'" >&2 + exit 1 + ;; +esac dkms_conf="/var/lib/dkms/$NAME/$VERSION/source/dkms.conf" autoinstall=$(bash -c 'AUTOINSTALL=; . "'"$dkms_conf"'" >/dev/null 2>&1; echo $AUTOINSTALL')