# SPDX-License-Identifier: GPL-2.0-or-later # # Kernel SRPM for the AYANEO Pocket DS (Snapdragon 8 Gen 2 / SM8550 / qcs8550). # # Aggressively trimmed from upstream Fedora's multi-arch / multi-variant # kernel.spec: this build is aarch64-only, single-variant (stock), single # device (Pocket DS), and uses one config (rocknix-linux.aarch64.conf). # # Boot artefact: /boot/Image — the raw arm64 kernel produced at # arch/arm64/boot/Image. The ROCKNIX-signed Qualcomm ABL boots that file # directly off the FAT ROCKNIX partition (\boot\Image), so the spec # deliberately does NOT produce a UKI, vmlinuz.efi, or boot.img wrapper. # # DTBs: built from the in-tree arch/arm64/boot/dts/qcom/qcs8550-*.dts files # already present on the linux-pocketds:pocketds/v7.0 branch (the rocknix # patches are upstream of that branch — no patch application needed here). %global package_name kernel %global tarfile_release 7.0 # Don't generate kernel-debuginfo / kernel-debugsource subpackages. The kernel # is built with -g but we ship it as-is in /boot/Image; producing debuginfo # RPMs requires a -debuginfo subpackage definition with %files, which we # deliberately don't carry. Without these stubs rpmbuild's auto-debugsource # step fails with "Empty %files file debugsourcefiles.list". %global debug_package %{nil} %global _enable_debug_packages 0 %global _build_id_links none Name: %{package_name} Version: 7.0.0 Release: 62%{?dist} Summary: Linux kernel for the AYANEO Pocket DS (SM8550) License: GPL-2.0-only WITH Linux-syscall-note URL: https://gitlab.com/linux-pocketds/linux ExclusiveArch: aarch64 ExclusiveOS: Linux # Pre-patched kernel tree (rocknix patches + qcs8550-*.dts files already in tree) Source0: https://gitlab.com/linux-pocketds/linux/-/archive/pocketds/v%{tarfile_release}/linux-pocketds-v%{tarfile_release}.tar.gz#/linux-%{tarfile_release}.tar.gz Source1: rocknix-linux.aarch64.conf BuildRequires: bash bc bison binutils diffutils elfutils-devel findutils flex BuildRequires: gawk gcc gcc-c++ gettext-devel git-core hostname kmod make BuildRequires: ncurses-devel net-tools openssl openssl-devel patch perl-interpreter BuildRequires: python3-devel rsync tar which xz zlib-devel BuildRequires: dtc Requires: coreutils Requires: systemd >= 203 Requires: linux-firmware Provides: kernel-uname-r = %{version}-%{release}.%{_arch} Provides: kernel-modules = %{version}-%{release} Provides: kernel-modules-core = %{version}-%{release} Provides: kernel-modules-extra = %{version}-%{release} Provides: kernel-core = %{version}-%{release} Provides: installonlypkg(kernel) %define KernelVer %{version}-%{release}.%{_arch} %define image_install_path boot %define hdrarch arm64 %define asmarch arm64 %description The Linux kernel built for the AYANEO Pocket DS handheld. Single-variant, aarch64-only, configured from rocknix-linux.aarch64.conf. Installs the raw arm64 boot image at /boot/Image; the ROCKNIX-signed ABL chain-loads that directly off the FAT ROCKNIX partition. %package devel Summary: Development files for building modules against the Pocket DS kernel Provides: kernel-devel = %{version}-%{release} Provides: kernel-devel-uname-r = %{KernelVer} Requires: kernel-uname-r = %{KernelVer} %description devel Headers, Makefiles, and scripts for building external modules against the Pocket DS kernel. # ---------------------------------------------------------------- prep ---- %prep %setup -q -n linux-pocketds-v%{tarfile_release} # Drop the .config in place cp %{SOURCE1} .config # Substitute ROCKNIX build-system placeholders that their image-builder # normally fills in via sed: # @INITRAMFS_SOURCE@ — path to a cpio source for an embedded initramfs. # We don't ship one (raw /boot/Image boot, no initrd # in the kernel image), so blank it out. # @DEVICENAME@ — the device hostname baked into the kernel. sed -i \ -e 's|"@INITRAMFS_SOURCE@"|""|' \ -e 's|"@DEVICENAME@"|"pocketds"|' \ .config # Fix Makefile typo in upstream linux-pocketds tree: `dtb-y` entries must # reference the *compiled* .dtb name, not the .dts source. With `.dts` the # build invokes dtc but `dtbs_install` copies the source instead of the # compiled blob. sed -i 's|qcs8550-ayaneo-pocketds\.dts$|qcs8550-ayaneo-pocketds.dtb|' \ arch/arm64/boot/dts/qcom/Makefile # Make sure setlocalversion can't append a +/-dirty suffix. touch .scmversion rm -f localversion-next localversion-rt # --------------------------------------------------------------- build ---- %build make ARCH=%{asmarch} olddefconfig # Pin the build salt so module signatures and modules.builtin reference KernelVer perl -p -i -e "s/^CONFIG_BUILD_SALT.*/CONFIG_BUILD_SALT=\"%{KernelVer}\"/" .config make %{?_smp_mflags} ARCH=%{asmarch} \ KCFLAGS="$KCFLAGS" \ KERNELRELEASE=%{KernelVer} \ Image modules dtbs # ------------------------------------------------------------- install ---- %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/boot mkdir -p $RPM_BUILD_ROOT/lib/modules/%{KernelVer} # Raw arm64 kernel — the bootable artefact. ABL loads this directly. # We deliberately ship only the unsuffixed /boot/Image (no Image-) # because the FAT ROCKNIX partition is 512 MiB and a 40 MB duplicate # would be wasted bytes; /lib/modules//Image is the kver-keyed copy # kernel-install / dracut can find when it needs to know which kernel # matches a module tree. install -m 0644 arch/arm64/boot/Image $RPM_BUILD_ROOT/boot/Image install -m 0644 arch/arm64/boot/Image $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/Image # Config + System.map — diagnostic + module dep resolution install -m 0644 .config $RPM_BUILD_ROOT/boot/config-%{KernelVer} install -m 0644 .config $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/config install -m 0644 System.map $RPM_BUILD_ROOT/boot/System.map-%{KernelVer} install -m 0644 System.map $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/System.map # DTBs — install ALL DTBs the kernel built, then prune to keep only the # Pocket DS one. The rocknix .config has CONFIG_ARCH_QCOM=y which makes # Kbuild compile every Qualcomm DTB (~700 of them, ~30MB) — we only need # qcs8550-ayaneo-pocketds.dtb on the FAT ROCKNIX partition. Mirror the # trimmed tree under /lib/modules//dtb/ for any consumer that # walks the modules dir. mkdir -p $RPM_BUILD_ROOT/boot/dtb-%{KernelVer} make ARCH=%{asmarch} INSTALL_DTBS_PATH=$RPM_BUILD_ROOT/boot/dtb-%{KernelVer} dtbs_install find $RPM_BUILD_ROOT/boot/dtb-%{KernelVer} -type f \ ! -name 'qcs8550-ayaneo-pocketds.dtb' -delete find $RPM_BUILD_ROOT/boot/dtb-%{KernelVer} -type d -empty -delete mkdir -p $RPM_BUILD_ROOT/boot/dtb-%{KernelVer}/qcom cp -r $RPM_BUILD_ROOT/boot/dtb-%{KernelVer} $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/dtb # Kernel modules make %{?_smp_mflags} ARCH=%{asmarch} \ INSTALL_MOD_PATH=$RPM_BUILD_ROOT \ KERNELRELEASE=%{KernelVer} \ modules_install mod-fw= # Drop module symlinks pointing at the build root (rebuilt by kernel-devel) rm -f $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build rm -f $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/source # kernel-devel: headers + Makefile / Kconfig / scripts to build out-of-tree mkdir -p $RPM_BUILD_ROOT/usr/src/kernels/%{KernelVer} DEVEL=$RPM_BUILD_ROOT/usr/src/kernels/%{KernelVer} cp --parents $(find -type f \( -name "Makefile*" -o -name "Kconfig*" \)) $DEVEL/ cp Module.symvers $DEVEL/ cp System.map $DEVEL/ cp .config $DEVEL/ cp -a include $DEVEL/ cp -a scripts $DEVEL/ mkdir -p $DEVEL/arch/arm64 cp -a arch/arm64/include $DEVEL/arch/arm64/ cp -a arch/arm64/Makefile $DEVEL/arch/arm64/ cp -a arch/arm64/Kconfig $DEVEL/arch/arm64/ 2>/dev/null || : # Symlink build/source -> kernel-devel tree ln -s /usr/src/kernels/%{KernelVer} $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build ln -s /usr/src/kernels/%{KernelVer} $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/source # Initramfs placeholder so dnf/rpm reserves boot space (~40 MiB) dd if=/dev/zero of=$RPM_BUILD_ROOT/boot/initramfs-%{KernelVer}.img bs=1M count=40 # Run depmod against the staged tree /sbin/depmod -aeF $RPM_BUILD_ROOT/boot/System.map-%{KernelVer} \ -b $RPM_BUILD_ROOT %{KernelVer} # ----------------------------------------------------------- post-scripts ---- %post if [ -x /usr/bin/kernel-install ]; then /usr/bin/kernel-install add %{KernelVer} /lib/modules/%{KernelVer}/Image || : fi %postun if [ -x /usr/bin/kernel-install ]; then /usr/bin/kernel-install remove %{KernelVer} || : fi # --------------------------------------------------------------- files ---- %files %defattr(-,root,root) /boot/Image /boot/config-%{KernelVer} /boot/System.map-%{KernelVer} /boot/dtb-%{KernelVer} %ghost /boot/initramfs-%{KernelVer}.img /lib/modules/%{KernelVer} %files devel %defattr(-,root,root) /usr/src/kernels/%{KernelVer} %changelog * Fri May 01 2026 Pocket DS Maintainers - 7.0.0-62 - Rebase on upstream Fedora kernel 7.0.0-62 source tree - Slim spec to single-arch (aarch64) / single-variant / single-device build - Boot artefact is /boot/Image (raw arm64 Image), no UKI / vmlinuz.efi - Config: rocknix-linux.aarch64.conf