X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=macros.kernel;h=8aa96bb4dfe10f290691caa791f79fe704446a06;hb=cf003b2dfbe72b28f3fb8108f24290b760365f24;hp=84d96b0b6518e976638a162b933ad83bc70d693b;hpb=b5115bb76a6795a89fadf5f4e7161f26203c7678;p=packages%2Frpm-tld-macros.git diff --git a/macros.kernel b/macros.kernel index 84d96b0..8aa96bb 100644 --- a/macros.kernel +++ b/macros.kernel @@ -1,7 +1,5 @@ # vim:ts=4 sw=4 noet ft=spec # Kernel specific macro definitions. -# To make use of these macros insert the following line into your spec file: -# %{load:%{_usrlibrpm}/macros.d/kernel} %__modinfo /sbin/modinfo @@ -85,7 +83,7 @@ done) %_kernel_version_code %( \\ Z=$(awk '/LINUX_VERSION_CODE/{print $3}' %{_kernelsrcdir}/include/linux/version.h 2>/dev/null); \\ - echo ${Z:-ERROR}; \\ + echo ${Z:-16777215}; \\ ) %_kernel_version_magic() %(echo $((%{1} * 65536 + %{2} * 256 + %{3}))) @@ -114,12 +112,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; \ @@ -166,6 +164,15 @@ 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 \\\ CC="%{__cc}" \\\ %endif \ %define MakeOpts HOSTCC="%{__cc}" SYSSRC=%{_kernelsrcdir} SYSOUT=$PWD/o \\\\\\\