%global patchset_commit 57e018a398248d7e5e4d798610df79a557c0629f %global kver %{version}-%{release} Name: kernel-msr1 Version: 6.19.10 Release: 300.fc44.msr1 Summary: Linux kernel for the MINISFORUM MS-R1 (CIX Sky1) License: GPL-2.0-only URL: https://github.com/TheCreateGM/ms-r1-f44 Source0: https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-%{version}.tar.xz Source1: https://codeload.github.com/Sky1-Linux/linux-sky1/tar.gz/%{patchset_commit} Source2: msr1-kernel.fragment # Declared as a source rather than as Patch0 because %prep drives the whole # Sky1-Linux series by hand (see below), so the fixup is applied by patch(1) # from %prep instead of by the spec's patch macros. Source3: 0001-ASoC-realtek-add-missing-CIX-Phecda-fixup-entries.patch Source4: Ssdt-MsR1-NpuCoreHid.asl ExclusiveArch: aarch64 BuildRequires: gcc BuildRequires: make BuildRequires: patch BuildRequires: perl BuildRequires: bc BuildRequires: bison BuildRequires: flex BuildRequires: elfutils-libelf-devel BuildRequires: openssl-devel # the openssl(1) binary generates the throw-away module signing key that # certs/Makefile creates for CONFIG_MODULE_SIG_ALL=y BuildRequires: openssl # pahole, for CONFIG_DEBUG_INFO_BTF and CONFIG_DEBUG_INFO_BTF_MODULES BuildRequires: dwarves BuildRequires: python3 BuildRequires: xz BuildRequires: rsync BuildRequires: kmod BuildRequires: redhat-rpm-config # iasl, from acpica-tools (acpisrc is the ACPICA *headers* package and does # not contain the compiler) BuildRequires: acpica-tools # Fedora's own arm64 kernel configuration is the base of our config; the # chroot's kernel-core package supplies it at /usr/lib/modules/*/config. BuildRequires: kernel-core Requires: dracut >= 059 Requires: coreutils Requires: kmod Provides: kernel-modules = %{kver} Provides: kernel-msr1 = %{kver} %global debug_package %{nil} %description Upstream Linux %{version} with the Sky1-Linux patch set, built with Fedora's arm64 kernel configuration for the MINISFORUM MS-R1 (CIX CP8180 "P1" / Sky1 SoC). The MS-R1 is an ACPI-only board and upstream Linux 6.19 carries no driver for most of its peripherals. The Sky1-Linux patch set adds them: the Cadence PCIe host controller for the SoC itself, ACPI glue for every peripheral, the CIX display driver with panthor GPU support, CIX audio, the CIX USB and PHY controllers, networking, and the ArmChina Zhouyi V3 NPU driver. With Fedora's stock arm64 kernel the MS-R1 has no working PCIe (so no NVMe and no 10 GbE), no GPU and no NPU. This package installs the kernel image, its configuration, its module tree and the ACPI SSDT override that adds the NPU compute-core _HIDs, so that a system installed from the MS-R1 live image boots with a working GPU, network and NPU. %prep %setup -q -n linux-%{version} # Sky1-Linux patch set: applied in series order. Every patch applies cleanly # against upstream %{version} with one known exception (see below); any other # failure aborts the build so the kernel is never silently built from a partial # patch set. mkdir -p %{_builddir}/sky1 tar -xf %{SOURCE1} -C %{_builddir}/sky1 --strip-components=1 n=0 failed="" for p in %{_builddir}/sky1/patches-latest/*.patch ; do if patch -d . -p1 -i "$p" --forward --batch -s 2>>%{_builddir}/sky1-rejects ; then n=$((n+1)) else failed="$failed $(basename "$p")" fi done echo "applied $n of $(ls %{_builddir}/sky1/patches-latest/*.patch | wc -l) Sky1-Linux patches" echo "ragged:$failed" rm -f $(find . -name '*.orig' -o -name '*.rej') # 0056-ASoC-ALSA-CIX-Sky1-audio-fixes.patch was written against an older # mainline tree and rejects two hunks in 6.19.10; %{SOURCE3} re-anchors them. # Any ragged patch other than that one is a hard error. set -- $failed if [ $# -gt 1 ] ; then echo "more than one Sky1-Linux patch is ragged: $failed" >&2 exit 1 fi if [ $# -eq 1 ] && [ "$1" != "0056-ASoC-ALSA-CIX-Sky1-audio-fixes.patch" ] ; then echo "unexpected ragged Sky1-Linux patch: $1" >&2 exit 1 fi # Re-anchor the Phecda fixup registration dropped by 0056. Applied with plain # patch(1) rather than rpm's patch macros, because this section already drives # the rest of the patch series by hand. patch -d . -p1 -i %{SOURCE3} --forward --batch \ || { echo "the Phecda fixup patch does not apply" >&2 ; exit 1 ; } # The fixup only makes sense on top of a 0056 that contributed the helper. grep -q 'static void alc_fixup_cix_phecda' sound/hda/codecs/realtek/alc269.c \ || { echo "0056 did not provide alc_fixup_cix_phecda()" >&2 ; exit 1 ; } rm -f $(find . -name '*.orig' -o -name '*.rej') # --- kernel configuration ------------------------------------------------ # 1. Fedora's own arm64 config, so the module set stays a superset of stock. cp $(ls -1 /usr/lib/modules/*/config | head -1) .config-fedora # 2. the Sky1-Linux config for this release cp %{_builddir}/sky1/config/config.sky1-latest .config-sky1 # 3. this project's MS-R1 fragment cp %{SOURCE2} .config-msr1 ./scripts/kconfig/merge_config.sh -m -O . .config-fedora .config-sky1 ./scripts/kconfig/merge_config.sh -m -O . .config .config-msr1 # Fedora's config names an absolute firmware directory that only exists inside # the RPM build root; building outside it makes kbuild fail. sed -i -e '/^CONFIG_EXTRA_FIRMWARE=/d' -e '/^CONFIG_EXTRA_FIRMWARE_DIR=/d' .config # Nothing in the Sky1-Linux patch set is written in Rust, and the build chroot # has no rustc, so drop it explicitly instead of leaving the result to depend on # whether rustc happens to be installed. ./scripts/config --disable RUST # Fedora's shipped config selects the xz compression algorithm but leaves # MODULE_COMPRESS_ALL off, so "make modules" would emit uncompressed .ko and # "make modules_install" would ship them that way. Turn it on so the module # tree is xz-compressed exactly like Fedora's own, instead of being repacked # by hand afterwards. ./scripts/config --set-val MODULE_COMPRESS y \ --enable MODULE_COMPRESS_XZ \ --enable MODULE_DECOMPRESS \ --enable MODULE_COMPRESS_ALL make -s ARCH=arm64 olddefconfig # Fail loudly if the intended configuration did not survive olddefconfig. for sym in CONFIG_LOCALVERSION CONFIG_PCI_SKY1 CONFIG_ARMCHINA_NPU CONFIG_ARCH_CIX ; do grep -q "^$sym" .config || { echo "$sym missing from the merged config" >&2 ; exit 1 ; } done grep -q '^CONFIG_LOCALVERSION="-300.fc44.msr1"$' .config \ || { echo "CONFIG_LOCALVERSION did not take" >&2 ; exit 1 ; } # Record the effective config so a rebuild is reproducible even if the # chroot's kernel-core moves on. cp .config .config-effective-%{kver} %build make -s ARCH=arm64 %{?_smp_mflags} Image modules %install rm -rf %{buildroot} mkdir -p %{buildroot}/boot %{buildroot}/usr/share/ms-r1/dtb/acpi install -m 0644 arch/arm64/boot/Image %{buildroot}/boot/vmlinuz-%{kver} install -m 0644 .config-effective-%{kver} %{buildroot}/boot/config-%{kver} test -s System.map || { echo "the build produced no System.map" >&2 ; exit 1 ; } install -m 0644 System.map %{buildroot}/boot/System.map-%{kver} make -s ARCH=arm64 INSTALL_MOD_PATH=%{buildroot} DEPMOD=/bin/true modules_install # The ACPI SSDT that gives the ArmChina Zhouyi NPU compute cores their # _HID/_UID. The board firmware does not declare them, and without them the # driver cannot bind a power domain per core. rm -rf %{_builddir}/sky1/acpi mkdir -p %{_builddir}/sky1/acpi ( cd %{_builddir}/sky1/acpi && iasl -p ssdt-msr1-npu-core-hid %{SOURCE4} ) install -m 0644 %{_builddir}/sky1/acpi/ssdt-msr1-npu-core-hid.aml \ %{buildroot}/usr/share/ms-r1/dtb/acpi/ # Sanity checks: the artefacts other packages and the bootloader rely on. test -s %{buildroot}/boot/vmlinuz-%{kver} || { echo "no kernel image" >&2 ; exit 1 ; } test -s %{buildroot}/lib/modules/%{kver}/modules.order \ || { echo "no modules.order" >&2 ; exit 1 ; } test -s %{buildroot}/lib/modules/%{kver}/modules.builtin \ || { echo "no modules.builtin" >&2 ; exit 1 ; } test -s %{buildroot}/usr/share/ms-r1/dtb/acpi/ssdt-msr1-npu-core-hid.aml \ || { echo "no ACPI SSDT" >&2 ; exit 1 ; } # head -c4 is the SSDT signature check the kernel's early-cpio scanner relies on test "$(head -c4 %{buildroot}/usr/share/ms-r1/dtb/acpi/ssdt-msr1-npu-core-hid.aml)" = SSDT \ || { echo "ACPI SSDT has a bad signature" >&2 ; exit 1 ; } %post depmod -a %{kver} %postun if [ $1 -eq 0 ]; then for f in /boot/loader/entries/*.conf ; do [ -e "$f" ] || continue grep -q "^version %{kver}$" "$f" 2>/dev/null && rm -f "$f" done fi %posttrans depmod -a %{kver} %files %license COPYING /boot/vmlinuz-%{kver} /boot/config-%{kver} /boot/System.map-%{kver} /lib/modules/%{kver} /usr/share/ms-r1 %changelog * Sat Oct 03 2026 axogm - 300.fc44.msr1 - Upstream Linux 6.19.10 with Sky1-Linux patches @57e018a - Built for the MINISFORUM MS-R1 (CIX Sky1), aarch64 - Initial COPR build of the MS-R1 kernel used by the Fedora-Workstation-Live-44-1.7-MS-R1 live image