mirror of
https://github.com/rosalinux/image-builder.git
synced 2025-02-23 10:22:50 +00:00
44 lines
1.1 KiB
Text
44 lines
1.1 KiB
Text
%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/dtbs
|
|
|
|
cp arch/arm64/boot/Image %{buildroot}/boot/vmlinuz-%{version}
|
|
|
|
%files
|
|
/boot/*
|
|
%{_modulesdir}/*
|