summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-05-08 15:04:22 +0200
committerDave Reisner <dreisner@archlinux.org>2012-05-16 23:55:54 +0200
commitfdc89d71aae5d8b7449281fd62a681bf9552b54f (patch)
treefc0d712d05316e1e4f2f7ac7d48928a9c96a6aec
parent79f6bb0dea639db6715ec178f3bbc85f41c4b92d (diff)
downloadmkinitcpio-fdc89d71aae5d8b7449281fd62a681bf9552b54f.tar.gz
mkinitcpio-fdc89d71aae5d8b7449281fd62a681bf9552b54f.tar.xz
functions: move --try logic into add_module
Allow add_module to detect trailing ? characters for ignoring errors rather than passing -t or --try to add_module. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r--functions29
1 files changed, 16 insertions, 13 deletions
diff --git a/functions b/functions
index 5d986da..052dced 100644
--- a/functions
+++ b/functions
@@ -232,11 +232,11 @@ add_module() {
# $1: module name
local module= path= dep= deps= field= value=
- local -i ign_errors=0
+ local ign_errors=0
- if [[ $1 = -@(t|-try) ]]; then
+ if [[ $1 = *\? ]]; then
ign_errors=1
- shift
+ set -- "${1%?}"
fi
module=${1%.ko*}
@@ -274,11 +274,18 @@ add_module() {
MODPATHS+=("$path")
ADDED_MODULES+=("${module//-/_}")
- # explicit module depends
- case "$module" in
- fat) add_module --try "nls_cp437" ;;
- ocfs2) add_module --try "configfs" ;;
- libcrc32c) add_module --try "crc32c"; add_module --try "crc32c_intel" ;;
+ # handle module quirks
+ case $module in
+ fat)
+ add_module "nls_cp437?"
+ ;;
+ ocfs2)
+ add_module "configfs?"
+ ;;
+ libcrc32c)
+ add_module "crc32c_intel?"
+ add_module "crc32c?"
+ ;;
esac
}
@@ -422,11 +429,7 @@ parse_hook() {
local item= script=
for item in $MODULES; do
- if [[ ${item:(-1)} = '?' ]]; then
- add_module --try "${item%\?}"
- else
- add_module "$item"
- fi
+ add_module "$item"
done
for item in $BINARIES; do