[FILE-6398] Only perform test if we know if Linux kernel is monolithic/modular

This commit is contained in:
Michael Boelen 2024-09-30 10:00:55 +00:00
parent fb5b808944
commit 699ec384d2
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04
3 changed files with 33 additions and 26 deletions

View File

@ -172,6 +172,7 @@ ETC_PATHS="/etc /usr/local/etc"
MDATPBINARY=""
MIN_PASSWORD_LENGTH=-1
MONGODB_RUNNING=0
MONOLITHIC_KERNEL_TESTED=0
MOUNTBINARY=""
MTREEBINARY=""
MYSQLCLIENTBINARY=""

View File

@ -738,6 +738,8 @@
if [ ${SKIPTEST} -eq 0 ]; then
LogText "Test: Checking if JBD (Journal Block Device) driver is loaded"
NOTINUSE=0
# Only perform testing if we know that KRNL-5723 performed tests
if [ ${MONOLITHIC_KERNEL_TESTED} -eq 1 ]; then
# Cannot check if driver is loaded/present if kernel is monolithic
if [ ${MONOLITHIC_KERNEL} -eq 0 ]; then
JBD=$(${LSMODBINARY} | ${GREPBINARY} ^jbd)
@ -766,9 +768,12 @@
ReportSuggestion "${TEST_NO}" "The JBD (Journal Block Device) driver is not loaded." "Since boot-time, you have not been using any filesystems with journaling. Alternatively, reason could be driver is blacklisted."
fi
else
Display --indent 2 --text "- JBD driver: unable to check" --result "${STATUS_UNKNOWN}" --color YELLOW
LogText "Kernel is monolithic - cannot check if JBD driver is part of compiled kernel."
Report "Kernel is monolithic - cannot check if JBD driver is part of compiled kernel."
Display --indent 2 --text "- JBD driver: unable to check" --result "${STATUS_UNKNOWN}" --color RED
fi
else
Display --indent 2 --text "- JBD driver: test skipped" --result "${STATUS_UNKNOWN}" --color YELLOW
LogText "Test skipped as the kernel type (monolithic/modular) is unknown"
fi
fi
#

View File

@ -176,6 +176,7 @@
# Checking if any modules are loaded
FIND=$(${LSMODBINARY} | ${GREPBINARY} -v "^Module" | wc -l | ${TRBINARY} -s ' ' | ${TRBINARY} -d ' ')
Display --indent 2 --text "- Checking kernel type" --result "${STATUS_DONE}" --color GREEN
MONOLITHIC_KERNEL_TESTED=1
if [ "${FIND}" = "0" ]; then
LogText "Result: Found monolithic kernel"
Report "linux_kernel_type=monolithic"