From 19989173595b854ccd745f932864cf891606613c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 30 Jan 2011 19:15:52 -0600 Subject: Use new get_module_name function Signed-off-by: Dan McGee --- functions | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'functions') 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 -- cgit v1.2.3-24-g4f1b