summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2016-06-26 15:26:03 +0200
committerDave Reisner <dreisner@archlinux.org>2016-06-27 14:27:52 +0200
commit97ac4d37aae084a050be512f6d8f4489054668ad (patch)
treebd10ce5190419cb87810500a357a3f0ae6865ca5
parent730bf42e4ce461c654598effcc04b7bde4367de7 (diff)
downloadmkinitcpio-97ac4d37aae084a050be512f6d8f4489054668ad.tar.gz
mkinitcpio-97ac4d37aae084a050be512f6d8f4489054668ad.tar.xz
Handle softdeps in modules
modinfo outputs softdeps which we can add if they exist (failing quietly on not-found). this obviates the need for some of our own module quirks. The output of modinfo can take many forms, as it's nearly freeform text in the .modinfo section of the kernel module. The basic form is: softdep: pre: foo But it might also be: softdep: pre: foo bar post: baz Or: softdep: pre: foo softdep: post: bar So just parse the entire line, discarding anything that ends with a ':'.
-rw-r--r--functions16
1 files changed, 11 insertions, 5 deletions
diff --git a/functions b/functions
index 362d07b..0d998a3 100644
--- a/functions
+++ b/functions
@@ -348,7 +348,7 @@ add_module() {
# discovered and added.
# $1: module name
- local module= path= deps= field= value= firmware=()
+ local module= path= softdeps= deps= field= value= firmware=()
local ign_errors=0
[[ $KERNELVERSION == none ]] && return 0
@@ -375,6 +375,13 @@ add_module() {
firmware)
firmware+=("$value")
;;
+ softdep)
+ read -ra softdeps <<<"$value"
+ for module in "${softdeps[@]}"; do
+ [[ $module == *: ]] && continue
+ add_module "$module?"
+ done
+ ;;
esac
done < <(modinfo -b "$_optmoduleroot" -k "$KERNELVERSION" -0 "$module" 2>/dev/null)
@@ -403,9 +410,8 @@ add_module() {
ocfs2)
add_module "configfs?"
;;
- btrfs|libcrc32c)
- add_module "crc32c_intel?"
- add_module "crc32c?"
+ btrfs)
+ add_module "libcrc32c?"
;;
esac
}
@@ -780,7 +786,7 @@ install_modules() {
depmod -b "$BUILDROOT" "$KERNELVERSION"
# remove all non-binary module.* files (except devname for on-demand module loading)
- rm "$moduledest"/modules.!(*.bin|devname)
+ rm "$moduledest"/modules.!(*.bin|devname|softdep)
}
# vim: set ft=sh ts=4 sw=4 et: