Project

General

Profile

Actions

Bug #24376

open

Script to check if module is disabled is_kernel_module_disabled.sh fails if module needs 2 .ko

Added by Nicolas CHARLES about 2 months ago.

Status:
New
Priority:
N/A
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
No

Description

on an ubuntu20, installing cramfs needs mtd.ko and cramfs.ko

modprobe -n -v cramfs
insmod /lib/modules/5.4.0-107-generic/kernel/drivers/mtd/mtd.ko 
insmod /lib/modules/5.4.0-107-generic/kernel/fs/cramfs/cramfs.ko

so our script is_kernel_module_disabled.sh fails on it, as it expects only one entry

echo "${dry_run}" | grep -Pq -- '^\h*install \/bin\/(true|false)'

CIS does that by filtering to get only the ko matching the module name

 [ "$(wc -l <<< "$l_loadable")" -gt "1" ] && l_loadable="$(grep -P -- "(^\h*install|\b$l_mname)\b" <<< "$l_loadable")" 

and then it does the grep

 grep -Pq -- '^\h*install \/bin\/(true|false)' <<< "$l_loadable";

No data to display

Actions

Also available in: Atom PDF