2024-01-06 01:27:45 +01:00
|
|
|
# openmamba kernel specfile for embedded kernels
|
2024-01-06 01:27:47 +01:00
|
|
|
# Copyright (C) 2011-2021 by Silvan Calarco
|
2024-01-06 01:27:45 +01:00
|
|
|
#
|
|
|
|
# To build a specific target:
|
|
|
|
#
|
|
|
|
# rpmbuild -ba --define="KERNEL_TARGET <target>" kernel.spec
|
|
|
|
#
|
|
|
|
# To cross-compile:
|
2024-01-06 01:27:45 +01:00
|
|
|
# rpmbuild -ba kernel-rpi2.spec --target arm --define="cross_target_cpu arm"
|
2024-01-06 01:27:45 +01:00
|
|
|
#
|
|
|
|
# To cross-compile using an alternative compiler:
|
2024-01-06 01:27:45 +01:00
|
|
|
# rpmbuild -ba kernel-rpi2.spec --target arm --define="cross_target_cpu arm" \
|
2024-01-06 01:27:45 +01:00
|
|
|
# --define="_target_platform arm-openmamba-linux-gnueabi"
|
|
|
|
#
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
#% define kernel_ver %(echo %version | cut -d. -f1-3)
|
2024-01-06 01:27:45 +01:00
|
|
|
%define kernel_ver %(echo %version | cut -d. -f1-3)
|
2024-01-06 01:27:45 +01:00
|
|
|
%define kernel_majver %(echo %version | cut -d. -f1-2)
|
2024-01-06 01:27:45 +01:00
|
|
|
%define gitdirver 1.%(echo %version | cut -d. -f4)
|
2024-01-06 01:27:45 +01:00
|
|
|
|
2024-01-06 01:27:47 +01:00
|
|
|
%ifarch aarch64
|
|
|
|
%define KERNEL_TARGET rpi-v8
|
|
|
|
%else
|
2024-01-06 01:27:46 +01:00
|
|
|
%if "%{?KERNEL_TARGET}" == ""
|
2024-01-06 01:27:47 +01:00
|
|
|
%define KERNEL_TARGET rpi-v7l
|
|
|
|
%endif
|
2024-01-06 01:27:46 +01:00
|
|
|
%endif
|
2024-01-06 01:27:45 +01:00
|
|
|
|
|
|
|
%if "%{_target_cpu}" == "arm"
|
|
|
|
%define KIMAGE arch/arm/boot/zImage
|
2024-01-06 01:27:46 +01:00
|
|
|
%define KIMAGE_DEST kernel
|
2024-01-06 01:27:45 +01:00
|
|
|
%define DEPMOD /sbin/depmod
|
|
|
|
%define target_cpu %{_target_cpu}
|
|
|
|
%endif
|
|
|
|
|
2024-01-06 01:27:47 +01:00
|
|
|
%if "%{_target_cpu}" == "aarch64"
|
|
|
|
%define KIMAGE arch/arm64/boot/Image
|
|
|
|
%define KIMAGE_DEST kernel
|
|
|
|
%define DEPMOD /sbin/depmod
|
|
|
|
%define target_cpu arm64
|
|
|
|
%endif
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
# disable internal dependency generator for scriptlets
|
|
|
|
%define _use_internal_dependency_generator 1
|
|
|
|
|
|
|
|
Name: kernel-rpi
|
2024-01-06 01:27:46 +01:00
|
|
|
Version: 5.4.51.20200902
|
2024-01-06 01:27:47 +01:00
|
|
|
Release: 2mamba
|
2024-01-06 01:27:45 +01:00
|
|
|
Summary: The Linux Kernel, the operating system core itself for the RaspberryPI
|
|
|
|
Group: System/Kernel and Hardware
|
|
|
|
Vendor: openmamba
|
|
|
|
Distribution: openmamba
|
|
|
|
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
|
|
|
|
URL: https://github.com/raspberrypi/linux
|
2024-01-06 01:27:45 +01:00
|
|
|
Source0: git://github.com/raspberrypi/linux.git/raspberrypi-kernel_%{gitdirver}-1/linux-%{version}.tar.bz2
|
|
|
|
Source20: kernel-rpi-logo.png
|
2024-01-06 01:27:46 +01:00
|
|
|
Source100: %{name}-v7-%{kernel_majver}-arm-config
|
|
|
|
Source101: %{name}-%{kernel_majver}-arm-config
|
|
|
|
Source102: kernel-rpi-v7l-%{kernel_majver}-arm-config
|
2024-01-06 01:27:47 +01:00
|
|
|
Source103: kernel-rpi-v8-%{kernel_majver}-aarch64-config
|
2024-01-06 01:27:45 +01:00
|
|
|
License: GPL
|
2024-01-06 01:27:45 +01:00
|
|
|
## AUTOBUILDREQ-BEGIN
|
|
|
|
BuildRequires: glibc-devel
|
|
|
|
BuildRequires: libperl
|
|
|
|
BuildRequires: perl-devel
|
|
|
|
## AUTOBUILDREQ-END
|
2024-01-06 01:27:47 +01:00
|
|
|
BuildRequires: /bin/bash
|
|
|
|
BuildRequires: /bin/sh
|
|
|
|
BuildRequires: /usr/bin/perl
|
2024-01-06 01:27:45 +01:00
|
|
|
BuildRequires: kmod
|
2024-01-06 01:27:47 +01:00
|
|
|
Provides: kernel-%{KERNEL_TARGET}-modules
|
|
|
|
Obsoletes: kernel-%{KERNEL_TARGET}-modules
|
2024-01-06 01:27:45 +01:00
|
|
|
Provides: kernel
|
2024-01-06 01:27:47 +01:00
|
|
|
Provides: kernelmodules
|
2024-01-06 01:27:45 +01:00
|
|
|
Requires(post): dracut
|
2024-01-06 01:27:45 +01:00
|
|
|
Requires: linux_firmware
|
2024-01-06 01:27:45 +01:00
|
|
|
Requires: raspberrypi-firmware
|
2024-01-06 01:27:45 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-build
|
|
|
|
|
|
|
|
%description
|
|
|
|
The Linux Kernel, the operating system core itself for the Raspberry PI.
|
|
|
|
The kernel package contains the Linux kernel (%{KIMAGE_DEST}), the operating system core itself.
|
|
|
|
The kernel handles the basic functions of the operating system: memory allocation, process allocation, device input and output, etc.
|
|
|
|
This is the source package used to build kernel for different architectures and targets.
|
|
|
|
|
|
|
|
This kernel was build for %{_target_cpu} architecture and the following target: %{?KERNEL_TARGET}.
|
|
|
|
|
2024-01-06 01:27:46 +01:00
|
|
|
%if "%{KERNEL_TARGET}" != "rpi"
|
2024-01-06 01:27:45 +01:00
|
|
|
%package -n kernel-%{KERNEL_TARGET}
|
|
|
|
Group: Development/Kernel
|
|
|
|
Summary: The Linux Kernel, the operating system core itself for the RaspberryPI (%{KERNEL_TARGET})
|
2024-01-06 01:27:47 +01:00
|
|
|
Provides: kernel-%{KERNEL_TARGET}-modules
|
|
|
|
Obsoletes: kernel-%{KERNEL_TARGET}-modules
|
2024-01-06 01:27:45 +01:00
|
|
|
%if "%{KERNEL_TARGET}" == "rpi-v7"
|
|
|
|
Provides: kernel-rpi2
|
|
|
|
Obsoletes: kernel-rpi2
|
2024-01-06 01:27:47 +01:00
|
|
|
Provides: kernel-rpi2-modules
|
|
|
|
Obsoletes: kernel-rpi2-modules
|
|
|
|
%endif
|
2024-01-06 01:27:46 +01:00
|
|
|
Provides: kernel
|
2024-01-06 01:27:47 +01:00
|
|
|
Provides: kernelmodules
|
2024-01-06 01:27:46 +01:00
|
|
|
Requires(post): dracut
|
|
|
|
Requires: linux_firmware
|
|
|
|
Requires: raspberrypi-firmware
|
2024-01-06 01:27:45 +01:00
|
|
|
|
|
|
|
%description -n kernel-%{KERNEL_TARGET}
|
|
|
|
The Linux Kernel, the operating system core itself for the Raspberry PI.
|
|
|
|
The kernel package contains the Linux kernel (%{KIMAGE_DEST}), the operating system core itself.
|
|
|
|
The kernel handles the basic functions of the operating system: memory allocation, process allocation, device input and output, etc.
|
|
|
|
This is the source package used to build kernel for different architectures and targets.
|
|
|
|
|
|
|
|
This kernel was build for %{_target_cpu} architecture and the following target: %{?KERNEL_TARGET}.
|
2024-01-06 01:27:46 +01:00
|
|
|
%endif
|
2024-01-06 01:27:45 +01:00
|
|
|
|
|
|
|
%package -n kernel-%{KERNEL_TARGET}-source
|
2024-01-06 01:27:45 +01:00
|
|
|
Group: Development/Kernel
|
|
|
|
Summary: The source code for the Linux kernel
|
|
|
|
Requires: kernel-%{KERNEL_TARGET}-headers == %{version}-%{release}
|
|
|
|
Provides: kernelsource
|
2024-01-06 01:27:45 +01:00
|
|
|
%if "%{KERNEL_TARGET}" == "rpi-v7"
|
|
|
|
Provides: kernel-rpi2-source
|
|
|
|
Obsoletes: kernel-rpi2-source
|
|
|
|
%endif
|
2024-01-06 01:27:45 +01:00
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%description -n kernel-%{KERNEL_TARGET}-source
|
2024-01-06 01:27:45 +01:00
|
|
|
The kernel-source package contains the source code files for the Linux kernel.
|
|
|
|
The source files can be used to build a custom kernel that is better tuned to your particular hardware, if you are so inclined (and you know what you're doing).
|
|
|
|
This kernel sources are configured for %{TARGET_CPU} architecture and the following target: %{?KERNEL_TARGET}.
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%package -n kernel-%{KERNEL_TARGET}-headers
|
2024-01-06 01:27:45 +01:00
|
|
|
Group: Development/Kernel
|
|
|
|
Summary: Headers, scripts, configuration and Makefile for the linux kernel
|
|
|
|
Provides: kernelheaders
|
2024-01-06 01:27:45 +01:00
|
|
|
%if "%{KERNEL_TARGET}" == "rpi-v7"
|
|
|
|
Provides: kernel-rpi2-headers
|
|
|
|
Obsoletes: kernel-rpi2-headers
|
|
|
|
%endif
|
2024-01-06 01:27:45 +01:00
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%description -n kernel-%{KERNEL_TARGET}-headers
|
2024-01-06 01:27:45 +01:00
|
|
|
The kernel-headers package contains the headers, scripts, configuration and Makefile to develop with the linux kernel
|
|
|
|
The kernel-headers can be used to build modules for the kernel.
|
|
|
|
This kernel headers are configured for %{TARGET_CPU} architecture and the following target: %{?KERNEL_TARGET}.
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%package -n kernel-%{KERNEL_TARGET}-headers-sanitised
|
2024-01-06 01:27:45 +01:00
|
|
|
Group: Development/Kernel
|
|
|
|
Summary: Sanitised kernel headers used for glibc build
|
|
|
|
Provides: kernelsanitisedheaders
|
2024-01-06 01:27:45 +01:00
|
|
|
%if "%{KERNEL_TARGET}" == "rpi-v7"
|
|
|
|
Provides: kernel-rpi2-headers-sanitised
|
|
|
|
Obsoletes: kernel-rpi2-headers-sanitised
|
|
|
|
%endif
|
2024-01-06 01:27:45 +01:00
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%description -n kernel-%{KERNEL_TARGET}-headers-sanitised
|
2024-01-06 01:27:45 +01:00
|
|
|
Sanitised kernel headers used for glibc build.
|
|
|
|
This kernel sanitised headers are configured for %{TARGET_CPU} architecture and the following target: %{?KERNEL_TARGET}.
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%package -n kernel-%{KERNEL_TARGET}-firmware
|
2024-01-06 01:27:45 +01:00
|
|
|
Group: System/Kernel and Hardware
|
|
|
|
Summary: Firmware files used by %{name}
|
|
|
|
Requires: kernel-%{KERNEL_TARGET} == %{version}-%{release}
|
|
|
|
Provides: kernelfirmware = %{version}
|
|
|
|
Provides: linux_firmware
|
2024-01-06 01:27:45 +01:00
|
|
|
%if "%{KERNEL_TARGET}" == "rpi-v7"
|
|
|
|
Provides: kernel-rpi2-firmware
|
|
|
|
Obsoletes: kernel-rpi2-firmware
|
|
|
|
%endif
|
2024-01-06 01:27:45 +01:00
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%description -n kernel-%{KERNEL_TARGET}-firmware
|
2024-01-06 01:27:45 +01:00
|
|
|
Firmware files used by the Linux Kernel.
|
|
|
|
|
2024-01-06 01:27:47 +01:00
|
|
|
%package -n kernel-%{KERNEL_TARGET}-dtbs
|
|
|
|
Group: System/Kernel and Hardware
|
|
|
|
Summary: Device Tree blobs provided with %{name}
|
|
|
|
Requires: kernel-%{KERNEL_TARGET} == %{version}-%{release}
|
|
|
|
|
|
|
|
%description -n kernel-%{KERNEL_TARGET}-dtbs
|
|
|
|
Device Tree blobs provided with %{name}.
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%prep
|
|
|
|
%setup -q -n linux-%{version}
|
|
|
|
#-D -T
|
2024-01-06 01:27:46 +01:00
|
|
|
#:<< _EOF
|
2024-01-06 01:27:45 +01:00
|
|
|
%if "%{?KERNEL_TARGET}" == ""
|
|
|
|
echo "No target specified, aborting."
|
|
|
|
exit 1
|
|
|
|
%else
|
|
|
|
echo "I'm going to build a %{KERNEL_TARGET} kernel..."
|
|
|
|
%endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# patch and configure STANDARD kernel
|
|
|
|
#
|
2024-01-06 01:27:45 +01:00
|
|
|
#% patch0 -p1
|
|
|
|
#% patch1 -p1
|
2024-01-06 01:27:45 +01:00
|
|
|
make mrproper
|
|
|
|
|
|
|
|
# create build dirs for each kernel
|
|
|
|
# and copy proper configuration
|
|
|
|
%if %{_target_cpu} == arm
|
|
|
|
case %{?KERNEL_TARGET} in
|
2024-01-06 01:27:45 +01:00
|
|
|
rpi) kernel_cfg=%{SOURCE101} ;;
|
2024-01-06 01:27:47 +01:00
|
|
|
rpi-v7) kernel_cfg=%{SOURCE100} ;;
|
|
|
|
rpi-v7l) kernel_cfg=%{SOURCE102} ;;
|
|
|
|
esac
|
|
|
|
%endif
|
|
|
|
%if %{_target_cpu} == aarch64
|
|
|
|
case %{?KERNEL_TARGET} in
|
|
|
|
rpi-v8) kernel_cfg=%{SOURCE103} ;;
|
2024-01-06 01:27:45 +01:00
|
|
|
esac
|
|
|
|
%endif
|
|
|
|
cp $kernel_cfg ./.config
|
|
|
|
|
|
|
|
cp Makefile Makefile.orig
|
|
|
|
sed -i "s/\(EXTRAVERSION =.*\)/\1-%{?KERNEL_TARGET}/" Makefile
|
|
|
|
|
|
|
|
# add custom logo
|
|
|
|
pngtopnm %{SOURCE20} | ppmquant -plain 224 > drivers/video/logo/logo_linux_clut224.ppm
|
|
|
|
|
|
|
|
%build
|
2024-01-06 01:27:45 +01:00
|
|
|
#:<< _EOF
|
2024-01-06 01:27:45 +01:00
|
|
|
#
|
|
|
|
# build kernel for given target
|
|
|
|
#
|
|
|
|
ARCH=%{target_cpu} make oldconfig
|
|
|
|
ARCH=%{target_cpu} make CROSS_COMPILE=%{_target_platform}- %{?_smp_mflags}
|
2024-01-06 01:27:47 +01:00
|
|
|
ARCH=%{target_cpu} make CROSS_COMPILE=%{_target_platform}- %{?_smp_mflags} modules dtbs
|
2024-01-06 01:27:45 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
|
|
|
|
|
|
|
# create system dirs in install environment
|
|
|
|
install -d %{buildroot}{/usr/src/,/boot,%{_initrddir},/lib/modules,/lib/firmware}
|
|
|
|
|
|
|
|
ARCH=%{target_cpu} make \
|
|
|
|
modules_install INSTALL_MOD_PATH=%{buildroot} DEPMOD=%{DEPMOD}
|
|
|
|
|
|
|
|
install -m0644 modules.builtin %{buildroot}/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/
|
|
|
|
install -m0644 modules.order %{buildroot}/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/
|
|
|
|
|
|
|
|
(cd %{buildroot}/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}
|
|
|
|
rm -f build && ln -sf /usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET} build )
|
|
|
|
|
2024-01-06 01:27:46 +01:00
|
|
|
%if %{_target_cpu} == arm
|
|
|
|
case %{?KERNEL_TARGET} in
|
|
|
|
rpi) kimage_dest="kernel.img" ;;
|
|
|
|
rpi-v7) kimage_dest="kernel7.img" ;;
|
|
|
|
rpi-v7l) kimage_dest="kernel7l.img" ;;
|
|
|
|
esac
|
|
|
|
%endif
|
|
|
|
|
2024-01-06 01:27:47 +01:00
|
|
|
%if %{_target_cpu} == aarch64
|
|
|
|
case %{?KERNEL_TARGET} in
|
|
|
|
rpi-v8) kimage_dest="kernel8.img" ;;
|
|
|
|
esac
|
|
|
|
%endif
|
|
|
|
|
2024-01-06 01:27:46 +01:00
|
|
|
cp %{KIMAGE} %{buildroot}/boot/${kimage_dest}
|
2024-01-06 01:27:47 +01:00
|
|
|
cp System.map %{buildroot}/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/System.map
|
2024-01-06 01:27:45 +01:00
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
# install dtbs
|
2024-01-06 01:27:47 +01:00
|
|
|
install -d -m0755 %{buildroot}/boot/overlays/
|
|
|
|
#cp arch/%{target_cpu}/boot/dts/*.dtb %{buildroot}/boot/
|
|
|
|
cp arch/arm/boot/dts/overlays/*.dtb* %{buildroot}/boot/overlays/
|
2024-01-06 01:27:45 +01:00
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
# recreate kernel sources
|
|
|
|
[ -e kernel-headers.files ] && rm -f kernel-headers.files
|
|
|
|
[ -e kernel-source.files ] && rm -f kernel-source.files
|
|
|
|
cp -R %{_builddir}/linux-%{version} %{buildroot}/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}
|
|
|
|
|
|
|
|
cd %{buildroot}/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}
|
|
|
|
ARCH=%{target_cpu} make mrproper
|
|
|
|
%if %{_target_cpu} == arm
|
|
|
|
case %{?KERNEL_TARGET} in
|
2024-01-06 01:27:45 +01:00
|
|
|
rpi) kernel_cfg=%{SOURCE101} ;;
|
|
|
|
rpi-v7) kernel_cfg=%{SOURCE100} ;;
|
2024-01-06 01:27:46 +01:00
|
|
|
rpi-v7l) kernel_cfg=%{SOURCE102} ;;
|
2024-01-06 01:27:45 +01:00
|
|
|
esac
|
|
|
|
%endif
|
|
|
|
|
2024-01-06 01:27:47 +01:00
|
|
|
%if %{_target_cpu} == aarch64
|
|
|
|
case %{?KERNEL_TARGET} in
|
|
|
|
rpi-v8) kernel_cfg=%{SOURCE103} ;;
|
|
|
|
esac
|
|
|
|
%endif
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
cp $kernel_cfg %{buildroot}/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/.config
|
|
|
|
cp %{_builddir}/linux-%{version}/Module.symvers %{buildroot}/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}
|
|
|
|
ARCH=%{target_cpu} make oldconfig
|
|
|
|
#cp Makefile Makefile.orig
|
|
|
|
#sed -i "s/\(EXTRAVERSION =.*\)/\1-%{?KERNEL_TARGET}/" Makefile
|
|
|
|
#%if "%{_target_platform}" == "%{_build}"
|
|
|
|
ARCH=%{target_cpu} make \
|
2024-01-06 01:27:45 +01:00
|
|
|
HOSTCC=%{_build}-gcc \
|
2024-01-06 01:27:45 +01:00
|
|
|
CROSS_COMPILE=%{_target_platform}- \
|
|
|
|
prepare scripts oldconfig
|
|
|
|
|
|
|
|
#%endif
|
|
|
|
rm .config.old
|
|
|
|
|
|
|
|
# clean modules files created by depmod
|
|
|
|
rm -f %{buildroot}/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.{alias,alias.bin,ccwmap,dep,dep.bin,devname,ieee1394map}
|
|
|
|
rm -f %{buildroot}/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.{inputmap,isapnpmap,ofmap,pcimap,seriomap,softdep}
|
|
|
|
rm -f %{buildroot}/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.{symbols,symbols.bin,usbmap}
|
|
|
|
|
|
|
|
# remove .tmp files if any
|
|
|
|
rm -f %{buildroot}%{_prefix}/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/.tmp* || true
|
|
|
|
|
|
|
|
# fix symlink pointing to sources
|
|
|
|
rm -f %{buildroot}/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/source
|
|
|
|
ln -s %{_prefix}/src/linux-%{kernel_ver}-%{?KERNEL_TARGET} %{buildroot}/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/source
|
|
|
|
|
|
|
|
#
|
|
|
|
# create kernel-source.files and kernel-headers.files
|
|
|
|
#
|
|
|
|
cd %{buildroot}%{_prefix}/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
splitdirs="block crypto drivers fs ipc kernel lib mm net security sound"
|
2024-01-06 01:27:45 +01:00
|
|
|
case %{_target_cpu} in
|
|
|
|
arm) headers_arch="arm" ;;
|
2024-01-06 01:27:47 +01:00
|
|
|
aarch64) headers_arch="arm64" ;;
|
2024-01-06 01:27:45 +01:00
|
|
|
esac
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
find $splitdirs -name *.h -exec \
|
2024-01-06 01:27:45 +01:00
|
|
|
echo "%{_prefix}/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/"{} >> \
|
|
|
|
%{_builddir}/linux-%{version}/kernel-headers.files \;
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%if "%{with_full_source}" == "1"
|
|
|
|
find $splitdirs -not -type d -a -not -name *.h -exec \
|
2024-01-06 01:27:45 +01:00
|
|
|
echo "%{_prefix}/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/"{} >> \
|
|
|
|
%{_builddir}/linux-%{version}/kernel-source.files \;
|
2024-01-06 01:27:45 +01:00
|
|
|
%else
|
|
|
|
touch %{_builddir}/linux-%{version}/kernel-source.files
|
|
|
|
find $splitdirs -not -type d -a -not -name *.h -exec rm -f {} \;
|
|
|
|
rm -rf firmware samples virt
|
|
|
|
%endif
|
2024-01-06 01:27:45 +01:00
|
|
|
|
|
|
|
archs=" `ls %{buildroot}%{_prefix}/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/arch` "
|
|
|
|
|
|
|
|
for i in $archs; do
|
|
|
|
[ "$i" == "$headers_arch" ] || \
|
2024-01-06 01:27:45 +01:00
|
|
|
%if "%{with_full_source}" == "1"
|
2024-01-06 01:27:45 +01:00
|
|
|
echo "%{_prefix}/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/arch/$i" >> \
|
|
|
|
%{_builddir}/linux-%{version}/kernel-source.files
|
2024-01-06 01:27:45 +01:00
|
|
|
%else
|
|
|
|
rm -rf arch/$i
|
|
|
|
%endif
|
2024-01-06 01:27:45 +01:00
|
|
|
done
|
|
|
|
echo "%{_prefix}/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/arch/$headers_arch" >> \
|
|
|
|
%{_builddir}/linux-%{version}/kernel-headers.files
|
|
|
|
|
|
|
|
# install sanitised headers used by glibc
|
|
|
|
ARCH=%{target_cpu} make headers_install \
|
2024-01-06 01:27:45 +01:00
|
|
|
HOSTCC=%{_build}-gcc \
|
2024-01-06 01:27:45 +01:00
|
|
|
CROSS_COMPILE=%{_target_platform}- \
|
|
|
|
INSTALL_HDR_PATH=%{buildroot}%{_prefix}/src/linux-%{kernel_ver}-%{KERNEL_TARGET}/usr
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
# Do not package cross-platform host tools
|
|
|
|
if [ "%{_build}" != "%{_target_platform}" ]; then
|
|
|
|
for f in asn1_compiler conmakehash extract-cert kallsyms sortextable; do
|
|
|
|
rm -f %{buildroot}/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/scripts/$f
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
rm -f %{buildroot}%{_prefix}/src/linux-%{kernel_ver}-%{KERNEL_TARGET}/{.cocciconfig,.gitattributes}
|
|
|
|
rm -rf %{buildroot}%{_prefix}/src/linux-%{kernel_ver}-%{KERNEL_TARGET}/.github
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%clean
|
|
|
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%post -n kernel-%{KERNEL_TARGET}
|
2024-01-06 01:27:45 +01:00
|
|
|
# new install or upgrade
|
|
|
|
if [ $1 -ge 1 ]; then
|
2024-01-06 01:27:47 +01:00
|
|
|
/sbin/depmod -A -F /lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/System.map \
|
2024-01-06 01:27:45 +01:00
|
|
|
%{kernel_ver}-%{?KERNEL_TARGET} &>/dev/null
|
2024-01-06 01:27:47 +01:00
|
|
|
#mkinitrd -f /boot/initramfs-%{kernel_ver}-%{?KERNEL_TARGET}.img %{kernel_ver}-%{?KERNEL_TARGET}
|
2024-01-06 01:27:45 +01:00
|
|
|
fi
|
2024-01-06 01:27:47 +01:00
|
|
|
:
|
2024-01-06 01:27:45 +01:00
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%postun -n kernel-%{KERNEL_TARGET}
|
2024-01-06 01:27:45 +01:00
|
|
|
# erase this package
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
[ -f /boot/%{KIMAGE_DEST}-%{kernel_ver}-%{?KERNEL_TARGET} ] ||
|
|
|
|
rm -f /boot/initramfs-%{kernel_ver}-%{?KERNEL_TARGET}.img
|
|
|
|
fi
|
2024-01-06 01:27:47 +01:00
|
|
|
:
|
2024-01-06 01:27:45 +01:00
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%post -n kernel-%{KERNEL_TARGET}-headers
|
2024-01-06 01:27:45 +01:00
|
|
|
# touch file so it results up-to-date on make
|
|
|
|
touch %{_prefix}/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/include/config/MARKER
|
2024-01-06 01:27:47 +01:00
|
|
|
:
|
2024-01-06 01:27:45 +01:00
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%files -n kernel-%{KERNEL_TARGET}
|
2024-01-06 01:27:45 +01:00
|
|
|
%defattr (-, root, root)
|
2024-01-06 01:27:46 +01:00
|
|
|
/boot/kernel*.img
|
2024-01-06 01:27:47 +01:00
|
|
|
%dir /lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}
|
|
|
|
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/System.map
|
|
|
|
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.builtin
|
|
|
|
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.builtin.bin
|
|
|
|
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.builtin.alias.bin
|
|
|
|
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.builtin.modinfo
|
|
|
|
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.order
|
|
|
|
%dir /lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/kernel
|
|
|
|
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/kernel/*
|
2024-01-06 01:27:46 +01:00
|
|
|
|
2024-01-06 01:27:47 +01:00
|
|
|
%files -n kernel-%{KERNEL_TARGET}-dtbs
|
|
|
|
%defattr (-, root, root)
|
2024-01-06 01:27:45 +01:00
|
|
|
#/boot/*.dtb*
|
2024-01-06 01:27:47 +01:00
|
|
|
/boot/overlays/*.dtb*
|
2024-01-06 01:27:45 +01:00
|
|
|
|
2024-01-06 01:27:46 +01:00
|
|
|
%files -n kernel-%{KERNEL_TARGET}-source
|
|
|
|
#-f kernel-source.files
|
2024-01-06 01:27:45 +01:00
|
|
|
%defattr(-,root,root)
|
2024-01-06 01:27:46 +01:00
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/.clang-format
|
|
|
|
%dir /usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/LICENSES
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/LICENSES/*
|
2024-01-06 01:27:45 +01:00
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/arch/.gitignore
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/Documentation
|
2024-01-06 01:27:45 +01:00
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/certs
|
2024-01-06 01:27:45 +01:00
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/init
|
2024-01-06 01:27:46 +01:00
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/usr/gen_initramfs_list.sh
|
2024-01-06 01:27:45 +01:00
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/usr/gen_init_cpio.c
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/usr/initramfs_data*.S
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/usr/Kconfig
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/usr/Makefile
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/usr/.gitignore
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/tools
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/.missing-syscalls.d
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/.mailmap
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/Kconfig
|
2024-01-06 01:27:45 +01:00
|
|
|
%if "%{with_full_source}" == "1"
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/block
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/firmware
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/samples
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/virt
|
|
|
|
%endif
|
2024-01-06 01:27:45 +01:00
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%files -n kernel-%{KERNEL_TARGET}-headers-sanitised
|
2024-01-06 01:27:45 +01:00
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/usr/include
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
%files -n kernel-%{KERNEL_TARGET}-headers -f kernel-headers.files
|
2024-01-06 01:27:45 +01:00
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/COPYING
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/CREDITS
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/Kbuild
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/include
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/Makefile
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/Makefile.orig
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/Module.symvers
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/MAINTAINERS
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/README
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/scripts
|
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/.config
|
2024-01-06 01:27:45 +01:00
|
|
|
/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/.get_maintainer.ignore
|
2024-01-06 01:27:45 +01:00
|
|
|
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/build
|
|
|
|
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/source
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
#%files -n kernel-%{KERNEL_TARGET}-firmware
|
|
|
|
#%defattr (-, root, root)
|
|
|
|
#%dir /lib/firmware
|
|
|
|
#/lib/firmware/*
|
2024-01-06 01:27:45 +01:00
|
|
|
|
|
|
|
%changelog
|
2024-01-06 01:27:47 +01:00
|
|
|
* Sun Oct 04 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4.51.20200902-2mamba
|
|
|
|
- merge kernel-*-modules into main kernel package; fix depmod after moving System.map away from /boot
|
|
|
|
|
2024-01-06 01:27:46 +01:00
|
|
|
* Thu Oct 01 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4.51.20200902-1mamba
|
|
|
|
- update to 5.4.51.20200902
|
|
|
|
|
2024-01-06 01:27:46 +01:00
|
|
|
* Wed Sep 09 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4.51.20200819-1mamba
|
|
|
|
- update to 5.4.51.20200819
|
|
|
|
|
2024-01-06 01:27:46 +01:00
|
|
|
* Fri Apr 03 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 4.19.97.20200212-1mamba
|
|
|
|
- update to 4.19.113.20200212
|
|
|
|
|
2024-01-06 01:27:46 +01:00
|
|
|
* Mon Jan 27 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 4.19.93.20200114-1mamba
|
|
|
|
- update to 4.19.93.20200114
|
|
|
|
|
|
|
|
* Wed Jan 15 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 4.19.75.20190925-1mamba
|
|
|
|
- update to 4.19.75.20190925
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
* Mon Dec 10 2018 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.79.20181112-2mamba
|
|
|
|
- rebuilt after configuration fixes
|
|
|
|
|
|
|
|
* Sun Dec 09 2018 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.79.20181112-1mamba
|
|
|
|
- update to 4.14.79.20181112
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
* Fri Feb 17 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 4.4.38.20161215-1mamba
|
|
|
|
- update to 4.4.38.20161215
|
|
|
|
|
|
|
|
* Thu Feb 16 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 4.4.1.20161020-2mamba
|
|
|
|
- configs: enabled KEXEC and built-id IKCONFIG
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
* Thu Nov 10 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 4.4.1.20161020-1mamba
|
|
|
|
- update to 4.4.1.20161020
|
|
|
|
|
|
|
|
* Tue Jul 12 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 4.4.1.20160620-1mamba
|
|
|
|
- update to 4.4.1.20160620
|
|
|
|
|
|
|
|
* Fri Feb 27 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 3.18.7.20150227git-1mamba
|
|
|
|
- update to 3.18.7.20150227git
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
* Sun Dec 07 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.12.34.20141207git-1mamba
|
|
|
|
- update to 3.12.34.20141207git
|
|
|
|
|
|
|
|
* Sat Dec 06 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.14.6.20140831git-3mamba
|
|
|
|
- rebuilt with newer gcc to see if it works
|
|
|
|
|
|
|
|
* Sat Sep 06 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.14.6.20140831git-2mamba
|
|
|
|
- update configuration, sync with arch/arm/configs/bcmrpi_defconfig
|
|
|
|
|
|
|
|
* Sun Aug 31 2014 Automatic Build System <autodist@mambasoft.it> 3.14.6.20140831git-1mamba
|
|
|
|
- update to 3.14.6.20140831git
|
|
|
|
|
2024-01-06 01:27:45 +01:00
|
|
|
* Mon Sep 09 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 3.6.11.20130909git-1mamba
|
|
|
|
- package created from kernel-hannspad template
|