Accepting request 230736 from Base:System

- weak-modules2: Use lsinitrd to list the modules in an initrd, so
  that initrds with early microcode work (bnc#873209, bnc#873113). (forwarded request 230213 from michal-m)

OBS-URL: https://build.opensuse.org/request/show/230736
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/suse-module-tools?expand=0&rev=10
This commit is contained in:
Stephan Kulow 2014-04-22 14:59:56 +00:00 committed by Git OBS Bridge
commit 5ba9850f25
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Apr 15 14:32:55 UTC 2014 - mmarek@suse.cz
- weak-modules2: Use lsinitrd to list the modules in an initrd, so
that initrds with early microcode work (bnc#873209, bnc#873113).
-------------------------------------------------------------------
Fri Apr 4 14:32:48 UTC 2014 - mmarek@suse.cz

View File

@ -75,7 +75,7 @@ doit() {
}
filter_basenames() {
sed -rn 's:/?lib/modules/.*/([^/]*\.ko)$:\1:p'
sed -rn 's:.*\<lib/modules/.*/([^/]*\.ko)$:\1:p'
}
# Name of the symlink that makes a module available to a given kernel
@ -297,8 +297,7 @@ uncomp() {
xz -cd "$file"
}
# test if mkinitrd is needed for $krel. This should be decided by initrd itself
# actually
# test if mkinitrd is needed for $krel.
# stdin - list of changed modules ("_kernel_" for the whole kernel)
needs_mkinitrd() {
local krel=$1
@ -327,7 +326,7 @@ needs_mkinitrd() {
if [ ! -e /boot/initrd-$krel ]; then
return 0
fi
local initrd_basenames=($( (uncomp /boot/initrd-$krel | cpio -t --quiet | filter_basenames; INITRD_MODULES=; . /etc/sysconfig/kernel &>/dev/null; printf '%s.ko\n' $INITRD_MODULES) | sort -u))
local initrd_basenames=($( (lsinitrd /boot/initrd-$krel | filter_basenames; INITRD_MODULES=; . /etc/sysconfig/kernel &>/dev/null; printf '%s.ko\n' $INITRD_MODULES) | sort -u))
local i=($(join <(printf '%s\n' "${changed_basenames[@]}") \
<(printf '%s\n' "${initrd_basenames[@]}") ))
log "changed initrd modules for kernel $krel: ${i[@]-none}"