weak-modules: Sync with RHEL

Signed-off-by: Laura Abbott <labbott@redhat.com>
This commit is contained in:
Laura Abbott 2019-11-01 09:22:38 -04:00
parent 2c61399a4a
commit b006530fb5

View File

@ -468,7 +468,7 @@ prepare_sandbox() {
#config #config
echo "search external extra built-in weak-updates" >"$conf" echo "search external extra built-in weak-updates" >"$conf"
echo "external $krel $dir" >>"$conf" echo "external * $dir" >>"$conf"
depmod="$depmod_orig -C $conf" depmod="$depmod_orig -C $conf"
} }
@ -966,6 +966,7 @@ add_kernel() {
local krel=${1:-$(uname -r)} local krel=${1:-$(uname -r)}
local tmp local tmp
local no_force_update="" local no_force_update=""
local num
tmp=$(mktemp -p $tmpdir) tmp=$(mktemp -p $tmpdir)
@ -983,9 +984,28 @@ add_kernel() {
# reuse tmp # 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 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 printf '%s\n' $g > $tmp
# to avoid subshell, see the read_modules_list comment
read_modules_list < $tmp read_modules_list < $tmp
update_modules_for_krel $krel add_weak_links $no_force_update update_modules_for_krel $krel add_weak_links $no_force_update
done done