Home Home > GIT Browse > linux-next
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2019-08-09 13:33:49 +0200
committerMichal Kubecek <mkubecek@suse.cz>2019-08-09 13:33:49 +0200
commit18fcdff43a009c0ff19c43c8c13c97d12d37e687 (patch)
tree7fb324159856ca6e48ab6754db01885eeb2b1417
parentcda92f9e1dbe5e84e03fe42a07796cb494a22904 (diff)
rpm: support compressed modules
Some of our scripts and scriptlets in rpm/ do not expect module files not ending with ".ko" which currently leads to failure in preuninstall scriptlet of cluster-md-kmp-default (and probably also other subpackages). Let those which could be run on compressed module files recognize ".ko.xz" in addition to ".ko".
-rwxr-xr-xrpm/check-module-license2
-rw-r--r--rpm/kernel-module-subpackage2
-rwxr-xr-xrpm/mergedep2
-rwxr-xr-xrpm/modflist8
-rw-r--r--rpm/preun.sh2
-rwxr-xr-xrpm/split-modules6
6 files changed, 13 insertions, 9 deletions
diff --git a/rpm/check-module-license b/rpm/check-module-license
index 9910deec18..b5f67fce99 100755
--- a/rpm/check-module-license
+++ b/rpm/check-module-license
@@ -1,7 +1,7 @@
#!/bin/sh
rc=0
-for file in $(find "$@" -name '*.ko'); do
+for file in $(find "$@" -name '*.ko' -o -name '*.ko.xz'); do
l=$(/sbin/modinfo -F license "$file")
if [ -z "$l" ]; then
echo "ERROR: No license is included for module ${file##*/lib/modules/}"
diff --git a/rpm/kernel-module-subpackage b/rpm/kernel-module-subpackage
index cc5b552ad1..325f352821 100644
--- a/rpm/kernel-module-subpackage
+++ b/rpm/kernel-module-subpackage
@@ -79,7 +79,7 @@ fi
%{?regenerate_initrd_posttrans}
%preun -n %{-n*}-kmp-%1
nvr=%{-n*}-kmp-%1-%_this_kmp_version-%{-r*}
-rpm -ql $nvr | sed -n '/\.ko$/p' > /var/run/rpm-$nvr-modules
+rpm -ql $nvr | sed -n '/\.ko\(\.xz\)\?$/p' > /var/run/rpm-$nvr-modules
%postun -n %{-n*}-kmp-%1
nvr=%{-n*}-kmp-%1-%_this_kmp_version-%{-r*}
modules=( $(cat /var/run/rpm-$nvr-modules) )
diff --git a/rpm/mergedep b/rpm/mergedep
index f1e7994d0a..c0ca85a829 100755
--- a/rpm/mergedep
+++ b/rpm/mergedep
@@ -7,10 +7,12 @@ cat /lib/modules/$KREL/modules.softdep | grep : | sed -e 's/^softdep //' -e 's/
| \
while read l ; do
MOD=$(echo "$l" | sed -e 's/:.*//')
+ MOD=$(basename $MOD .xz)
MOD=$(basename $MOD .ko)
DEPS="$(echo "$l" | sed -e 's/.*://')"
moddeps=""
for dep in $DEPS ; do
+ dep=$(basename $dep .xz)
dep=$(basename $dep .ko)
moddeps="$moddeps $dep"
done
diff --git a/rpm/modflist b/rpm/modflist
index 476b541c67..14071040c9 100755
--- a/rpm/modflist
+++ b/rpm/modflist
@@ -5,6 +5,8 @@ output=$3
mod_builtin=$4
while read MOD ; do
- [ -n "$MOD" ] || continue
- cat $flist | grep /$MOD[.]ko\$ >> $output || { grep -q /$MOD[.]ko\$ $mod_builtin && echo Module $MOD built-in ;} || echo Module $MOD missing
-done < $modules
+ [ -n "$MOD" ] || continue
+ grep "/${MOD}\.ko\(\.xz\)\?\$" "$flist" >> "$output" \
+ || { grep -q "/${MOD}\.ko\(\.xz\)\?\$" $mod_builtin && echo "Module $MOD built-in"; } \
+ || echo Module "$MOD" missing
+done < "$modules"
diff --git a/rpm/preun.sh b/rpm/preun.sh
index 7d1a2708c5..005cb95b74 100644
--- a/rpm/preun.sh
+++ b/rpm/preun.sh
@@ -1,4 +1,4 @@
if [ @BASE_PACKAGE@ = 0 ]; then
nvr=@SUBPACKAGE@-@RPM_VERSION_RELEASE@
- rpm -ql $nvr | grep '\.ko$' > /var/run/rpm-$nvr-modules
+ rpm -ql $nvr | grep '\.ko\(\.xz\)\?$' > /var/run/rpm-$nvr-modules
fi
diff --git a/rpm/split-modules b/rpm/split-modules
index ecb967e921..329b110342 100755
--- a/rpm/split-modules
+++ b/rpm/split-modules
@@ -59,8 +59,8 @@ trap 'rm -rf "$tmp"' EXIT
tmp=$(mktemp -d)
mkdir "$tmp/empty"
-find "$opt_dir" -type f -name '*.ko' -printf '/%P\n' | \
- awk -F/ '{ n=$NF; gsub(/-/, "_", n); sub(/\.ko$/, "", n); print n " " $0; }' | \
+find "$opt_dir" -type f \( -name '*.ko' -o -name '*.ko.xz' \) -printf '/%P\n' | \
+ awk -F/ '{ n=$NF; gsub(/-/, "_", n); sub(/\.ko(\.xz)?$/, "", n); print n " " $0; }' | \
sort >"$tmp/all"
err=false
@@ -101,7 +101,7 @@ ifdef EXPLAIN
@for dep in $^; do echo "$$dep needed by $@"; done >> $(EXPLAIN)
endif
'
- sed -r 's:[^ ]*/([^/]*)\.ko\>:\1:g; y/-/_/' "$modules_dep"
+ sed -r 's:[^ ]*/([^/]*)\.ko(.xz)?\>:\1:g; y/-/_/' "$modules_dep"
) >"$tmp/dep"
add_dependent_modules()