From: Zheng Zengkai zhengzengkai@huawei.com
https://gitee.com/openeuler/kernel/issues/I8HR0P
Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Signed-off-by: Jialin Zhang zhangjialin11@huawei.com --- check-kabi | 10 +++++----- kernel.spec | 12 ++++++++---- 2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/check-kabi b/check-kabi index 1dc05f2..db6c7e1 100644 --- a/check-kabi +++ b/check-kabi @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # # check-kabi - Red Hat kABI reference checking tool # @@ -41,7 +41,7 @@ def load_symvers(symvers,filename): break if in_line == "\n": continue - checksum,symbol,directory,type = in_line.split() + checksum,symbol,directory,type,namespace = in_line.split('\t')
symvers[symbol] = in_line[0:-1]
@@ -56,7 +56,7 @@ def load_kabi(kabi,filename): break if in_line == "\n": continue - checksum,symbol,directory,type = in_line.split() + checksum,symbol,directory,type,namespace = in_line.split('\t')
kabi[symbol] = in_line[0:-1]
@@ -71,9 +71,9 @@ def check_kabi(symvers,kabi): losted_symbols=[]
for symbol in kabi: - abi_hash,abi_sym,abi_dir,abi_type = kabi[symbol].split() + abi_hash,abi_sym,abi_dir,abi_type,abi_namespace = kabi[symbol].split('\t') if symbol in symvers: - sym_hash,sym_sym,sym_dir,sym_type = symvers[symbole].split() + sym_hash,sym_sym,sym_dir,sym_type,sym_namespace = symvers[symbol].split('\t') if abi_hash != sym_hash: fail=1 changed_symbols.append(symbol) diff --git a/kernel.spec b/kernel.spec index 12b2343..f265ef0 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1,5 +1,5 @@ %define with_signmodules 1 -%define with_kabichk 0 +%define with_kabichk 1
%define modsign_cmd %{SOURCE10}
@@ -64,6 +64,7 @@ Source15: process_pgp_certs.sh %if 0%{?with_kabichk} Source18: check-kabi Source20: Module.kabi_aarch64 +Source21: Module.kabi_x86_64 %endif
Source200: mkgrub-menu-aarch64.sh @@ -353,8 +354,7 @@ make ARCH=%{Arch} modules %{?_smp_mflags} %if 0%{?with_kabichk} chmod 0755 %{SOURCE18} if [ -e $RPM_SOURCE_DIR/Module.kabi_%{_target_cpu} ]; then - ##%{SOURCE18} -k $RPM_SOURCE_DIR/Module.kabi_%{_target_cpu} -s Module.symvers || exit 1 - echo "**** NOTE: now don't check Kabi. ****" + %{SOURCE18} -k $RPM_SOURCE_DIR/Module.kabi_%{_target_cpu} -s Module.symvers || exit 1 else echo "**** NOTE: Cannot find reference Module.kabi file. ****" fi @@ -485,7 +485,9 @@ popd install -m 644 .config $RPM_BUILD_ROOT/boot/config-%{KernelVer} install -m 644 System.map $RPM_BUILD_ROOT/boot/System.map-%{KernelVer}
-gzip -c9 < Module.symvers > $RPM_BUILD_ROOT/boot/symvers-%{KernelVer}.gz +%if 0%{?with_kabichk} + gzip -c9 < Module.symvers > $RPM_BUILD_ROOT/boot/symvers-%{KernelVer}.gz +%endif
mkdir -p $RPM_BUILD_ROOT%{_sbindir} install -m 755 %{SOURCE200} $RPM_BUILD_ROOT%{_sbindir}/mkgrub-menu-%{devel_release}.sh @@ -809,7 +811,9 @@ fi %ifarch aarch64 /boot/dtb-* %endif +%if 0%{?with_kabichk} /boot/symvers-* +%endif /boot/System.map-* /boot/vmlinuz-* %ghost /boot/initramfs-%{KernelVer}.img