From b9c09308c0d5e70322c40b2e38ac408092d36911 Mon Sep 17 00:00:00 2001 From: Jason Dellaluce Date: Thu, 18 Nov 2021 14:16:35 +0000 Subject: [PATCH 1/2] fix(scripts): correctly remove loaded drivers Signed-off-by: Jason Dellaluce Co-authored-by: Leonardo Grasso --- scripts/falco-driver-loader | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/falco-driver-loader b/scripts/falco-driver-loader index 0cdff090aad..fa707369ee5 100755 --- a/scripts/falco-driver-loader +++ b/scripts/falco-driver-loader @@ -300,13 +300,13 @@ clean_kernel_module() { return fi - DRIVER_VERSIONS=$(dkms status -m "${DRIVER_NAME}" | cut -d',' -f2 | sed -e 's/^[[:space:]]*//') + DRIVER_VERSIONS=$(dkms status -m "${DRIVER_NAME}" | cut -d',' -f1 | sed -e 's/^[[:space:]]*//') if [ -z "${DRIVER_VERSIONS}" ]; then echo "* There is no ${DRIVER_NAME} module in dkms" return fi for CURRENT_VER in ${DRIVER_VERSIONS}; do - if dkms remove -m "${DRIVER_NAME}" -v "${CURRENT_VER}" --all 2>/dev/null; then + if dkms remove "${CURRENT_VER}" --all 2>/dev/null; then echo "* Removing ${DRIVER_NAME}/${CURRENT_VER} succeeded" else echo "* Removing ${DRIVER_NAME}/${CURRENT_VER} failed" From 7f1b56c87111925d78beccff1700a38d03ea323d Mon Sep 17 00:00:00 2001 From: Jason Dellaluce Date: Fri, 3 Dec 2021 11:26:51 +0000 Subject: [PATCH 2/2] chore(scripts): refine removal output messages Signed-off-by: Jason Dellaluce jasondellaluce@gmail.com Co-authored-by: Leonardo Grasso me@leonardograsso.com --- scripts/falco-driver-loader | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/falco-driver-loader b/scripts/falco-driver-loader index fa707369ee5..9494253a28c 100755 --- a/scripts/falco-driver-loader +++ b/scripts/falco-driver-loader @@ -307,9 +307,9 @@ clean_kernel_module() { fi for CURRENT_VER in ${DRIVER_VERSIONS}; do if dkms remove "${CURRENT_VER}" --all 2>/dev/null; then - echo "* Removing ${DRIVER_NAME}/${CURRENT_VER} succeeded" + echo "* Removing ${CURRENT_VER} succeeded" else - echo "* Removing ${DRIVER_NAME}/${CURRENT_VER} failed" + echo "* Removing ${CURRENT_VER} failed" exit 1 fi done