diff --git a/weak-modules b/weak-modules index db1839c..dd163cc 100644 --- a/weak-modules +++ b/weak-modules @@ -468,7 +468,7 @@ prepare_sandbox() { #config echo "search external extra built-in weak-updates" >"$conf" - echo "external $krel $dir" >>"$conf" + echo "external * $dir" >>"$conf" depmod="$depmod_orig -C $conf" } @@ -966,6 +966,7 @@ add_kernel() { local krel=${1:-$(uname -r)} local tmp local no_force_update="" + local num tmp=$(mktemp -p $tmpdir) @@ -983,9 +984,28 @@ add_kernel() { # reuse tmp + # optimization, check independent modules in one run. + # first try groups with one element in each. + # it means independent modules, so we can safely remove + # incompatible links + # some cut and paste here + + echo > $tmp for g in "${groups[@]}"; do + num="$(echo "$g" | wc -w)" + [ "$num" -gt 1 ] && continue + + printf '%s\n' $g >> $tmp + done + # to avoid subshell, see the read_modules_list comment + read_modules_list < $tmp + update_modules_for_krel $krel add_weak_links force_update + + for g in "${groups[@]}"; do + num="$(echo "$g" | wc -w)" + [ "$num" -eq 1 ] && continue + printf '%s\n' $g > $tmp - # to avoid subshell, see the read_modules_list comment read_modules_list < $tmp update_modules_for_krel $krel add_weak_links $no_force_update done