summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-01-31 02:15:52 +0100
committerThomas Bächler <thomas@archlinux.org>2011-01-31 21:44:31 +0100
commit19989173595b854ccd745f932864cf891606613c (patch)
tree9f100afb97d9a5e718aca88494648ffae75687e1
parent65a523302462e738bd3c813bdae4d0a8a62990ac (diff)
downloadmkinitcpio-19989173595b854ccd745f932864cf891606613c.tar.gz
mkinitcpio-19989173595b854ccd745f932864cf891606613c.tar.xz
Use new get_module_name function
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--functions11
1 files changed, 4 insertions, 7 deletions
diff --git a/functions b/functions
index f2515de..a06434c 100644
--- a/functions
+++ b/functions
@@ -51,9 +51,8 @@ checked_modules ()
{
if [ -e "${MODULE_FILE}" ]; then
for mod in $(all_modules $@); do
- modname=${mod%.gz}
- modname="$(basename ${modname%.ko} | tr '-' '_')"
- if grep "^${modname}$" "${MODULE_FILE}" >/dev/null 2>&1; then
+ modname=$(get_module_name "${mod}")
+ if grep -q "^${modname}$" "${MODULE_FILE}"; then
echo ${modname}
fi
done
@@ -168,11 +167,9 @@ HAS_MODULES="n"
add_module ()
{
local m fil path fw mod deps
- #cleanup - remove .ko, replace - with _
- m=${1%.gz}
- m=$(basename "${m%.ko}" | tr '-' '_')
+ m=$(get_module_name "${1}")
#find pattern - replace _ with [-_] to match either
- fil=$(echo "$m" | sed 's|_|\[-_\]|g')
+ fil="${m//_/[-_]}"
found=0
for path in $(find "${MODULEDIR}" -type f -name "${fil}.ko" -or -name "${fil}.ko.gz"); do