From b6361a3836a50f9bbe06dba4bf5740c3bfb1af3d Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 7 Mar 2020 13:48:36 -0500 Subject: only add modules if the filename value looks like a path This is a defensive measure against the bug raised in FS#65725. While it does technically avoid the bug, it isn't IMO the proper fix. We'll address that in another patch. --- functions | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/functions b/functions index 1c72b56..bc9c528 100644 --- a/functions +++ b/functions @@ -376,11 +376,17 @@ add_module() { while IFS=':= ' read -r -d '' field value; do case "$field" in filename) - found=1 - module=${value##*/} module=${module%.ko*} - quiet "adding module: %s" "$module" - _modpaths["$value"]=1 - _addedmodules["${module//-/_}"]=1 + # Only add modules with filenames that look like paths (e.g. + # it might be reported as "(builtin)"). We'll defer actually + # checking whether or not the file exists -- any errors can be + # handled during module install time. + if [[ $value = /* ]]; then + found=1 + module=${value##*/} module=${module%.ko*} + quiet "adding module: %s (%s)" "$module" "$value" + _modpaths["$value"]=1 + _addedmodules["${module//-/_}"]=1 + fi ;; depends) IFS=',' read -r -a deps <<< "$value" -- cgit v1.2.3-24-g4f1b