Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

framework: Adjust fs module checking #7176

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/functions/configuration/main-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -579,11 +579,11 @@ function set_git_build_repo_url_and_commit_vars() {

function check_filesystem_compatibility_on_host() {
if [[ -f "/proc/filesystems" ]]; then
# Check if the filesystem is listed in /proc/filesystems
if ! grep -q "\<$ROOTFS_TYPE\>" /proc/filesystems; then # ensure exact match with \<...\>
# Try modprobing the fs module since it doesn't show up in /proc/filesystems if it's an unloaded module versus built-in
if ! modprobe "$ROOTFS_TYPE"; then
exit_with_error "Filesystem type unsupported by build host:" "$ROOTFS_TYPE"
# Check if the filesystem available on the host
if ! modinfo "$ROOTFS_TYPE" >/dev/null; then
# Check if the required filesystem is loaded if not, ask the user to load it as there isn't any non-root way to load kernel modules especially on hardened kernels
if ! lsmod | grep "$ROOTFS_TYPE" >/dev/null; then
exit_with_error "Filesystem type '$ROOTFS_TYPE' is not loaded by build host, try following and restart the build: sudo modprobe $ROOTFS_TYPE"
else
display_alert "Sucessfully loaded kernel module for filesystem" "$ROOTFS_TYPE" ""
fi
Expand Down