|
Harald Hoyer |
55891e |
From ceebd9ac769dcb869529d57fdb155cf7199251f8 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
55891e |
From: John Reiser <jreiser@BitWagon.com>
|
|
Harald Hoyer |
55891e |
Date: Sat, 27 Aug 2011 14:43:49 -0700
|
|
Harald Hoyer |
55891e |
Subject: [PATCH] filter_kernel_modules is a specialized
|
|
Harald Hoyer |
55891e |
filter_kernel_modules_by_path
|
|
Harald Hoyer |
55891e |
|
|
Harald Hoyer |
55891e |
---
|
|
Harald Hoyer |
55891e |
dracut-functions | 31 +++----------------------------
|
|
Harald Hoyer |
55891e |
1 files changed, 3 insertions(+), 28 deletions(-)
|
|
Harald Hoyer |
55891e |
|
|
Harald Hoyer |
55891e |
diff --git a/dracut-functions b/dracut-functions
|
|
Harald Hoyer |
55891e |
index f41fc7d..a72aa53 100755
|
|
Harald Hoyer |
55891e |
--- a/dracut-functions
|
|
Harald Hoyer |
55891e |
+++ b/dracut-functions
|
|
Harald Hoyer |
55891e |
@@ -863,34 +863,9 @@ filter_kernel_modules_by_path () (
|
|
Harald Hoyer |
55891e |
done
|
|
Harald Hoyer |
55891e |
)
|
|
Harald Hoyer |
55891e |
|
|
Harald Hoyer |
55891e |
-# filter kernel modules to install certain modules that meet specific
|
|
Harald Hoyer |
55891e |
-# requirements.
|
|
Harald Hoyer |
55891e |
-# $1 = function to call with module name to filter.
|
|
Harald Hoyer |
55891e |
-# This function will be passed the full path to the module to test.
|
|
Harald Hoyer |
55891e |
-# The behaviour of this function can vary depending on whether $hostonly is set.
|
|
Harald Hoyer |
55891e |
-# If it is, we will only look at modules that are already in memory.
|
|
Harald Hoyer |
55891e |
-# If it is not, we will look at all kernel modules
|
|
Harald Hoyer |
55891e |
-# This function returns the full filenames of modules that match $1
|
|
Harald Hoyer |
55891e |
-filter_kernel_modules () (
|
|
Harald Hoyer |
55891e |
- local _modname _filtercmd
|
|
Harald Hoyer |
55891e |
- if ! [[ $hostonly ]]; then
|
|
Harald Hoyer |
55891e |
- _filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra"'
|
|
Harald Hoyer |
55891e |
- _filtercmd+=' "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz"'
|
|
Harald Hoyer |
55891e |
- _filtercmd+=' 2>/dev/null'
|
|
Harald Hoyer |
55891e |
- else
|
|
Harald Hoyer |
55891e |
- _filtercmd='cut -d " " -f 1
|
|
Harald Hoyer |
55891e |
- _filtercmd+='-k $kernel 2>/dev/null'
|
|
Harald Hoyer |
55891e |
- fi
|
|
Harald Hoyer |
55891e |
- for _modname in $(eval $_filtercmd); do
|
|
Harald Hoyer |
55891e |
- case $_modname in
|
|
Harald Hoyer |
55891e |
- *.ko) "$1" "$_modname" && echo "$_modname";;
|
|
Harald Hoyer |
55891e |
- *.ko.gz) gzip -dc "$_modname" > $initdir/$$.ko
|
|
Harald Hoyer |
55891e |
- $1 $initdir/$$.ko && echo "$_modname"
|
|
Harald Hoyer |
55891e |
- rm -f $initdir/$$.ko
|
|
Harald Hoyer |
55891e |
- ;;
|
|
Harald Hoyer |
55891e |
- esac
|
|
Harald Hoyer |
55891e |
- done
|
|
Harald Hoyer |
55891e |
-)
|
|
Harald Hoyer |
55891e |
+filter_kernel_modules () {
|
|
Harald Hoyer |
55891e |
+ filter_kernel_modules_by_path drivers "$1"
|
|
Harald Hoyer |
55891e |
+}
|
|
Harald Hoyer |
55891e |
|
|
Harald Hoyer |
55891e |
# install kernel modules along with all their dependencies.
|
|
Harald Hoyer |
55891e |
instmods() {
|