# Define the target kernel version based on the installed kernel-devel package # This ensures we build against the headers present in the buildroot, not the running kernel. %global kversion %(rpm -q --qf "%{VERSION}-%{RELEASE}.%{ARCH}" kernel-devel | head -n 1) %global srcrev b67db205 %global debug_package %{nil} Name: downstream-dtbs Version: 1.0 Release: 1.git%{srcrev}%{?dist} Summary: Downstream device tree blobs License: GPLv2 URL: https://gitlab.com/CentOS/automotive/src/downstream-dtbs.git Source0: downstream-dtbs-%{srcrev}.tar.gz # BuildRequires logic updated to avoid uname-r dependency BuildRequires: kernel-devel BuildRequires: kernel-rpm-macros BuildRequires: make # As noted in changelog, restricting arch ExclusiveArch: aarch64 %description %{summary} %prep %setup -T -b 0 -q -n downstream-dtbs-%{srcrev} %build # Set kernel source to the path of the INSTALLED kernel-devel, not running kernel %global kernel_src /lib/modules/%{kversion}/build # Verify the directory exists before building if [ ! -d "%{kernel_src}" ]; then echo "Error: Kernel source not found at %{kernel_src}" exit 1 fi %make_build KERNEL_SRC=%{kernel_src} %install # Ensure directory structure exists mkdir -p %{buildroot}/lib/modules/%{kversion}/dtb/extra/qcom/ # Install DTBs install -DpZm 0644 qcom/*.dtb -t %{buildroot}/lib/modules/%{kversion}/dtb/extra/qcom/ %files # Own the specific directory and the files within it %dir /lib/modules/%{kversion}/dtb/extra %dir /lib/modules/%{kversion}/dtb/extra/qcom /lib/modules/%{kversion}/dtb/extra/qcom/*.dtb %changelog * Tue Feb 11 2025 Eric Chanudet 5.14.0-563.511.1-1 - Bump src version and target kernel version. - Set ExclusiveArch until device-tree on a different arch make it here. * Thu Jan 30 2025 Eric Chanudet 5.14.0-549.498.1-1 - Refactor specfile around a Makefile * Wed Apr 3 2024 Lucas Karpinski 0.1 - downstream-dtbs: initial packaging