X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=macros.kernel;h=598ba8833373719250fc1a341983a17a88eae415;hb=HEAD;hp=40cb813e12ed928c2f3a73f0350ed417e5b7e24b;hpb=208adebc7b42418e7fea34d3a573e0e8b03e36bd;p=packages%2Frpm-tld-macros.git diff --git a/macros.kernel b/macros.kernel index 40cb813..598ba88 100644 --- a/macros.kernel +++ b/macros.kernel @@ -91,6 +91,18 @@ done) %_host_base_arch %{expand:%%global _host_base_arch %(echo %{_host_cpu} | sed 's/i.86/i386/;s/athlon/i386/;s/pentium./i386/;s/amd64/x86_64/;s/ia32e/x86_64/;s/x32/x86_64/;s/sparcv./sparc/;s/arm.*/arm/')}%_host_base_arch %_target_base_arch %{expand:%%global _target_base_arch %(echo %{_target_cpu} | sed 's/i.86/i386/;s/athlon/i386/;s/pentium./i386/;s/amd64/x86_64/;s/ia32e/x86_64/;s/x32/x86_64/;s/sparcv./sparc/;s/arm.*/arm/')}%_target_base_arch +%_kernel_arch \\\ +%ifarch aarch64\ +arm64\ +%endif\ +%ifarch ppc ppc64\ +powerpc\\\ +%endif\ +%ifnarch aarch64 ppc ppc64\ +%{_target_base_arch}\\\ +%endif\ +%{nil} + # Compression used for %__spec_install_post_compress_modules # Supported values: # - "gzip -9nf" (module-init-tools and kmod) @@ -112,12 +124,12 @@ done) if [ -d $RPM_BUILD_ROOT/lib/modules ]; then \ tool=$(%{kmod_compress_cmd} --version | head -n1); \ case "$tool" in gzip*) ext=gz;; xz*) ext=xz;; esac; \ - q=$(find $RPM_BUILD_ROOT/lib/modules -name '*o' -type f -print); \ + q=$(find $RPM_BUILD_ROOT/lib/modules -name '*.ko' -type f -print); \ if [ "$q" ]; then \ printf "Compress %d kernel modules..." $(echo "$q" | wc -l); \ echo "$q" | xargs -r %{kmod_compress_cmd}; \ echo "DONE"; \ - find $RPM_BUILD_ROOT/lib/modules -name '*o' -type l -printf "%p %l\n" | \ + find $RPM_BUILD_ROOT/lib/modules -name '*.ko' -type l -printf "%p %l\n" | \ while read a b; do ln -sf $b.$ext $a.$ext; rm -f $a; done; \ fi; \ fi; \ @@ -164,15 +176,7 @@ done) ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux- \\\ %endif \\\ %else \\\ - %ifarch aarch64 \\\ - ARCH=arm64 \\\ - %endif \\\ - %ifarch ppc ppc64 \\\ - ARCH=powerpc \\\ - %endif \\\ - %ifnarch aarch64 ppc ppc64 \\\ - ARCH=%{_target_base_arch} \\\ - %endif \\\ + ARCH=%_kernel_arch \\\\\\\ CC="%{__cc}" \\\ %endif \ %define MakeOpts HOSTCC="%{__cc}" SYSSRC=%{_kernelsrcdir} SYSOUT=$PWD/o \\\\\\\