image-builder/utils/kernel.template

47 lines
1.2 KiB
Text
Raw Normal View History

%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
2024-11-14 15:57:24 +03:00
# This line will be conditionally included or removed
{Source1}
License: GPLv2
Provides: kernel = %{EVRD}
%description
2024-11-14 15:57:24 +03:00
kernel for {BOARD_NAME}
%prep
%autosetup -p1 -n kernel
2024-11-14 15:57:24 +03:00
# 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
2024-11-14 19:35:34 +03:00
{MAKE_DEFCONFIG}
%make_build 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
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/*
2024-11-15 20:47:06 +03:00
%{_modulesdir}/*