%define debug_package %{nil} %define _modulesdir /usr/lib/modules Name: kernel-{BOARD_NAME} Version: {KERNEL_VERSION} Release: 1 Summary: kernel for {BOARD_NAME} devices Group: System/Kernel and hardware Source0: kernel.tar # This line will be conditionally included or removed {Source1} License: GPLv2 Provides: kernel = %{EVRD} %description kernel for {BOARD_NAME} %prep %autosetup -p1 -n kernel # If Source1 is defined, include this line {SOURCE1_COMMAND} grep -Irl /lib/modules | xargs sed -i -e 's,/lib/modules,%{_modulesdir},g' -e 's,/usr/usr/lib/modules,/usr/lib/modules,g' %build {MAKE_DEFCONFIG} %make_build -s CROSS_COMPILE=/usr/bin/{ARCH}-linux-gnu- ARCH={KERNEL_ARCH} %install # Install kernel modules, if any make V=1 modules_install ARCH={KERNEL_ARCH} \ INSTALL_MOD_PATH=%{buildroot} \ INSTALL_DTBS_PATH=%{buildroot}/boot/dtbs make dtbs_install ARCH={KERNEL_ARCH} \ INSTALL_MOD_PATH=%{buildroot} \ INSTALL_DTBS_PATH=%{buildroot}/boot cp arch/arm64/boot/Image %{buildroot}/boot/vmlinuz-%{version} find %{buildroot} -type f -name "*.ko" -exec %{_bindir}/{ARCH}-linux-gnu-strip {} \; %files /boot/* %{_modulesdir}/*