# kmods carry no debug info of their own %global debug_package %{nil} # Build an akmod (rebuilt on the user's machine per kernel). For a one-off # kmod against the build kernel instead, set this to 'current' or 'newest'. %define buildforkernels akmod %define kmod_name imx477 Name: %{kmod_name}-kmod Version: 0.1 Release: 1%{?dist} Summary: Sony IMX477 (Raspberry Pi HQ Camera) sensor kernel module for Fedora aarch64 License: GPL-2.0-only URL: https://github.com/raspberrypi/linux Source0: %{kmod_name}-%{version}.tar.xz # imx477 is a downstream-only Raspberry Pi driver; this is aarch64 (Pi) only. ExclusiveArch: aarch64 BuildRequires: gcc make BuildRequires: kmodtool BuildRequires: kernel-rpm-macros BuildRequires: elfutils-libelf-devel # In akmod mode leave %%{kernels} unset so kmodtool emits the akmod-imx477 # package (built on the user's machine). For a fixed-kernel kmod instead, set # buildforkernels to current/newest and pass --define "kernels ". # kmodtool emits the akmod-imx477 (+ imx477-kmod-common) subpackages. %{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null)} %description Out-of-tree build of the Raspberry Pi downstream IMX477 image-sensor driver, ported to build against mainline-based Fedora aarch64 kernels (e.g. the pbrobinson/a64-kernel COPR), so the Raspberry Pi High Quality Camera works on Fedora. Used by the OpenFlexure microscope port. Pair with "dtoverlay=imx477" and FirmwareDT=True to enable the camera. # Shared, kernel-independent files that the kmod- subpackages require. %package -n %{name}-common Summary: Common files for %{name} BuildArch: noarch %description -n %{name}-common Documentation and licensing for the imx477 out-of-tree kernel module. %files -n %{name}-common %license imx477-%{version}/LICENSE %doc imx477-%{version}/README.md %prep %{?kmodtool_check} %setup -q -c -T -a 0 for k in %{?kernel_versions}; do cp -a %{kmod_name}-%{version} _kmod_build_"${k%%%%___*}" done %build for k in %{?kernel_versions}; do make -C "${k##*___}" M="$PWD"/_kmod_build_"${k%%%%___*}" modules done %install for k in %{?kernel_versions}; do install -D -m0755 _kmod_build_"${k%%%%___*}"/%{kmod_name}.ko \ "%{buildroot}%{kmodinstdir_prefix}${k%%%%___*}%{kmodinstdir_postfix}/%{kmod_name}.ko" done %{?akmod_install} %changelog * Sun Jun 28 2026 Morgan Hough - 0.1-1 - Initial akmod package: imx477 ported from rpi-6.12.y with the MEDIA_BUS_FMT_SENSOR_DATA (0x7002) compat shim for mainline kernels.