-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The script will run inside the QM partition. And it won't be possible to access /lib/modules to load any module via modprobe. Jira-URL: https://issues.redhat.com/browse/VROOM-19336 Signed-off-by: weiwang <[email protected]>
- Loading branch information
1 parent
2e577bd
commit bb36431
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ RUN dnf install -y \ | |
npm \ | ||
rpm-build \ | ||
ruby \ | ||
ruby-devel \ | ||
sed \ | ||
vim-enhanced \ | ||
systemd-devel \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# What is modprobe_module? | ||
|
||
modprobe_module is a simple script that validates it won't be possible to access /lib/modules to load any module via modprobe inside the QM partition. | ||
|
||
# How to use it? | ||
|
||
It must be executed inside the QM partition to validate it won't be possible to modprobe any module under /lib/modules. | ||
|
||
Example: | ||
``` | ||
my-host# podman exec -it qm bash | ||
bash-5.1# ./modprobe_module | ||
modprobe: FATAL: Module ext4 not found in directory /lib/modules/5.14.0-447.400.el9iv.x86_64 | ||
ls: cannot access '/lib/modules/5.14.0-447.400.el9iv.x86_64': No such file or directory | ||
done | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -d /lib/modules ]; then | ||
echo "FATAL: /lib/modules: No such file or directory" | ||
exit 1 | ||
fi | ||
|
||
if [ -n "$(ls -A /lib/modules)" ]; then | ||
echo "This folder should be empty, any modules cannot load via modprobe" | ||
exit 1 | ||
fi | ||
|
||
# Modprobe module ext4 | ||
modprobe ext4 | ||
|
||
# Access module file | ||
ls $(modprobe ext4 2>&1 >/dev/null | cut -d ' ' -f 9) | ||
|
||
echo "done" |