summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2020-03-07 19:48:36 +0100
committerDave Reisner <dreisner@archlinux.org>2020-03-12 23:39:17 +0100
commitb6361a3836a50f9bbe06dba4bf5740c3bfb1af3d (patch)
tree9fcba4c1b858152ac71c47f10ffe88993eeb50c9
parent024119a987f720101bc1af723772d608e84e8e2d (diff)
downloadmkinitcpio-b6361a3836a50f9bbe06dba4bf5740c3bfb1af3d.tar.gz
mkinitcpio-b6361a3836a50f9bbe06dba4bf5740c3bfb1af3d.tar.xz
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.
-rw-r--r--functions16
1 files 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"