From b160fbb58eacfd9981d81812ecf10cae544ea2bf Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Sun, 24 May 2009 11:33:29 +0200 Subject: 'added firmware parsing to add_modules #14783' --- functions | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'functions') diff --git a/functions b/functions index 38bf6bf..502d1d9 100644 --- a/functions +++ b/functions @@ -145,12 +145,17 @@ HAS_MODULES="n" #modules are handled specially in order to enable autodetection add_module () { - local fil path mod deps + local fil path fw mod deps #cleanup - remove .ko, replace - and _ with [-_] to match either fil=$(basename "${1}" | sed -e "s|[-_]|\[-_\]|g" -e "s|\.ko$||g") found=0 for path in $(find "${MODULEDIR}" -type f -name "${fil}.ko"); do + #get needed firmware files + for fw in $(/sbin/modinfo -F firmware "${path}"); do + [ -f "/lib/firmware/$fw" ] && add_file "/lib/firmware/$fw" + done + #get module depends for mod in $(/sbin/modinfo -F depends "${path}" | tr ',' ' '); do if [ -n "${mod}" ]; then add_module "${mod}" -- cgit v1.2.3-24-g4f1b