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 9 months ago. Updated 5 months ago.

Status:
Pending release
Priority:
N/A
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
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";

Actions

Also available in: Atom PDF