# Values of sp11.conf, rendered by scripts/30-build-support-rpm.sh, which also packs the sources. %global grub_font_file sp11-console.pf2 %global grub_font_size 32 %global grub_font_name SP11 Console %global audio_topology X1E80100-Microsoft-Surface-Pro-11-tplg.bin # The packages hold no binary: without this rpm stops at an empty list of debug sources. %global debug_package %{nil} Name: sp11-surface-support Version: 4.9 Release: 1%{?dist} Summary: Surface Pro 11 device support: firmware, audio, Bluetooth, boot policy License: GPL-3.0-or-later AND BSD-3-Clause AND LicenseRef-Fedora-Firmware AND Bitstream-Vera ExclusiveArch: aarch64 AutoReqProv: no # The payload's files, sp11.env and sp11-modem.env, and the font's build helper of scripts/. Source0: %{name}-%{version}.tar.gz # linux-firmware's Surface Pro 11 topology, for a system whose qcom-firmware predates it. Source1: %{audio_topology} # The GRUB console font is built from DejaVu Sans Mono; the topology is packed as linux-firmware's package packs it. BuildRequires: grub2-tools-extra BuildRequires: dejavu-sans-mono-fonts BuildRequires: python3 BuildRequires: xz Requires: bluez Requires: alsa-ucm # sp11-wifi-board copies the Wi-Fi board file out of this package's board-2.bin. Requires: atheros-firmware Requires: dracut # The dracut policy in 90-sp11.conf installs this package's Adreno microcode into the initramfs. Requires: qcom-firmware # The DSP firmware: sp11-firmware-extract.service runs Fedora's tool, which copies it from the Windows partition. A # weak dependency, as rpm alone (the pipeline's checks, the live root) installs no package from a repository. Recommends: qcom-firmware-extract Requires: systemd Requires: systemd-udev Requires: grub2-tools-minimal Requires: grub2-tools # sp11-grub-modules copies the `chain` module out of it, for a GRUB image without the chainloader command. Requires: grub2-efi-aa64-modules Requires: util-linux Requires: kmod Requires: iproute # sp11-secureboot-theme, sp11-bt-set-addr and sp11-wifi-board are Python; so is the GNSS feed of sp11-surface-modem. Requires: python3 %description Device support for the Microsoft Surface Pro 11 (X1E80100, OLED), the same package for every SKU; the model with 5G takes sp11-surface-modem as well. - DSP firmware: a unit that runs Fedora's qcom-firmware-extract, and links that give its files the names the Denali device tree requests - audio: the UCM profile for Fedora's topology with the amplifier gain held at mainline's limit, that topology for a system whose qcom-firmware predates it, the speakers' correction filter for PipeWire, a udev rule that holds the LPASS clock votes - Wi-Fi and Bluetooth: the helper that writes the WCN7850 board file from Fedora's firmware, and the addresses the firmware holds for both - boot: the kernel-install plugin (Denali DTB, GRUB mode and font, kernel arguments), dracut policy, scmi-cpufreq loading, the Windows Boot Manager entry, the first-boot finalizer - Secure Boot: the tool, plugin and GRUB block that start a kernel's signed boot image (the sp11-kernel-secureboot packages carry the images) - dnf: Fedora's stock kernel packages kept off the system, the SP11 kernel's Copr projects allowed to offer theirs Inputs: 1687443b4371ce3d22d9eb1e06657bdaff988d3334290747f980b13b8dca0502 %package -n sp11-surface-modem # The name stays clear of sp11-surface-support-*, which the pipeline's lookups match. Summary: Surface Pro 11 with 5G: the modem's device tree, ModemManager policy and GNSS feed License: GPL-3.0-or-later AutoReqProv: no # Installing this package brings sp11-surface-support along, and an upgrade moves both. Requires: sp11-surface-support = %{version}-%{release} # GeoClue reads the GNSS feed, semodule loads the feed's policy module. Requires: geoclue2 Requires: policycoreutils %description -n sp11-surface-modem For the Microsoft Surface Pro 11 with 5G only: the file that makes sp11-surface-support select the device tree with the modem, a udev rule that keeps the modem's QMI port from ModemManager, a GNSS feed that passes the modem's positions to GeoClue, and a drop-in that makes ModemManager keep the modem across a system sleep. Installing it installs sp11-surface-support as well. %prep %setup -q %build # The GRUB console font: gfxterm draws with a fixed-size PF2, and Fedora's stock unicode.pf2 (8x16 ASCII cell) is # unreadable on the 2880x1920 panel. gfxterm's cell is as high as the font's tallest glyph, with the baseline at # the font's ascent; grub2-mkfont takes ascent and descent from the whole face's extremes, which puts the baseline # below the cell's line box. The first run yields the cell, the second is built with the ascent and descent that # fit it; the check refuses a font whose menu glyphs leave the cell. DejaVu is Bitstream-Vera licensed: a derived # font must not carry "Bitstream" or "Vera" in its name. ttf=/usr/share/fonts/dejavu-sans-mono-fonts/DejaVuSansMono.ttf grub2-mkfont -s %{grub_font_size} -n "%{grub_font_name}" -o font-probe.pf2 $ttf metrics=$(python3 -I grub-font-cell.py metrics font-probe.pf2) set -- $metrics grub2-mkfont -s %{grub_font_size} -n "%{grub_font_name}" --asce "$1" --desc "$2" -o %{grub_font_file} $ttf python3 -I grub-font-cell.py check %{grub_font_file} # xz as Fedora's linux-firmware packs it (the kernel's decompressor takes CRC32 only), which gives the package's # file byte for byte. xz --check=crc32 -c %{SOURCE1} > %{audio_topology}.xz %install R=%{buildroot} # DSP firmware (docs/hardware.md, Firmware): Fedora's qcom-firmware-extract copies it from the Windows partition # into /usr/lib/firmware/updates/qcom/x1e80100/microsoft/Denali/, xz-compressed under Windows' names. The Denali # tree requests the DSPs' device-tree images as adsp_dtb.mbn and cdsp_dtb.mbn, so two links give them those names. # A unit runs the tool at a start while the firmware is missing. install -d $R/usr/lib/firmware/updates/qcom/x1e80100/microsoft/Denali $R/usr/lib/systemd/system/multi-user.target.wants ln -s adsp_dtbs.elf.xz $R/usr/lib/firmware/updates/qcom/x1e80100/microsoft/Denali/adsp_dtb.mbn.xz ln -s cdsp_dtbs.elf.xz $R/usr/lib/firmware/updates/qcom/x1e80100/microsoft/Denali/cdsp_dtb.mbn.xz install -m 0644 sp11-firmware-extract.service $R/usr/lib/systemd/system/sp11-firmware-extract.service ln -s ../sp11-firmware-extract.service $R/usr/lib/systemd/system/multi-user.target.wants/sp11-firmware-extract.service # Audio (docs/hardware.md, Audio): the UCM profile, the matcher and the topology sp11-ucm-apply installs, the # speakers' correction filter and the rule that holds the LPASS clock votes. for f in SP11 SP11-HiFi SP11-SpeakerSeq SP11-DefaultEnableSeq; do install -D -m 0644 sp11-ucm-$f.conf $R/usr/share/alsa/ucm2/Qualcomm/x1e80100/$f.conf done install -D -m 0644 sp11-ucm-matcher.conf $R/usr/share/sp11/ucm/x1e80100.conf install -D -m 0644 %{audio_topology}.xz $R/usr/share/sp11/audio/%{audio_topology}.xz install -D -m 0644 sp11-wireplumber-speakers.conf $R/usr/share/wireplumber/wireplumber.conf.d/51-sp11-speakers.conf install -D -m 0644 78-sp11-speakers.rules $R/usr/lib/udev/rules.d/78-sp11-speakers.rules # Wi-Fi (docs/hardware.md, Wi-Fi): the helper that writes the board file, which the trigger below runs, and the # rule and helper that give the interface its address. install -D -m 0755 sp11-wifi-board $R/usr/libexec/sp11/sp11-wifi-board install -m 0755 sp11-wifi-apply $R/usr/libexec/sp11/sp11-wifi-apply install -D -m 0644 99-sp11-wifi-address.rules $R/usr/lib/udev/rules.d/99-sp11-wifi-address.rules # Bluetooth (docs/hardware.md, Bluetooth address): the helper that sets the public address, and the udev-triggered # service that calls it. install -m 0755 sp11-bt-set-addr sp11-bt-apply $R/usr/libexec/sp11/ install -D -m 0644 sp11-bluetooth-address@.service $R/usr/lib/systemd/system/sp11-bluetooth-address@.service install -D -m 0644 99-sp11-bluetooth-address.rules $R/usr/lib/udev/rules.d/99-sp11-bluetooth-address.rules # Boot policy (docs/fedora-media.md): the GRUB font and defaults, the kernel-install plugin, the first-boot # finalizer, the Windows entry with the helper that copies GRUB's `chain` module, the dracut policy; the dnf # overrides for the kernel packages; and the tools sp11-diag and sp11-bt-import-pairings. install -D -m 0644 %{grub_font_file} $R/usr/share/sp11/fonts/%{grub_font_file} install -m 0755 sp11-ucm-apply sp11-grub-modules sp11-grub-defaults sp11-first-boot sp11-bt-import-pairings sp11-diag \ $R/usr/libexec/sp11/ install -D -m 0644 90-sp11-kernel.repo $R/usr/share/dnf5/repos.override.d/90-sp11-kernel.repo install -D -m 0644 91-sp11-kernel-copr.repo $R/usr/share/dnf5/repos.override.d/91-sp11-kernel-copr.repo install -D -m 0755 29_sp11_windows $R/etc/grub.d/29_sp11_windows install -m 0644 sp11-first-boot.service $R/usr/lib/systemd/system/sp11-first-boot.service ln -s ../sp11-first-boot.service $R/usr/lib/systemd/system/multi-user.target.wants/sp11-first-boot.service install -D -m 0755 15-sp11-surface.install $R/usr/lib/kernel/install.d/15-sp11-surface.install install -D -m 0644 90-sp11.conf $R/usr/lib/dracut/dracut.conf.d/90-sp11.conf install -D -m 0644 sp11-scmi-cpufreq.conf $R/usr/lib/modules-load.d/sp11-scmi-cpufreq.conf install -D -m 0644 sp11.env $R/etc/sp11/sp11.env # Secure Boot (docs/secure-boot.md): the tool that keeps the signed boot images' copies and entries and the tool # that draws its menu, the kernel-install plugin and the unit that run it, the GRUB block that reads its entries. # Without a signed boot image none of it does anything. And three drop-ins for systemd's TPM units # (docs/hardware.md, TPM). install -m 0755 sp11-secureboot sp11-secureboot-theme $R/usr/libexec/sp11/ install -D -m 0755 96-sp11-secureboot.install $R/usr/lib/kernel/install.d/96-sp11-secureboot.install install -D -m 0755 09_sp11_secureboot $R/etc/grub.d/09_sp11_secureboot install -m 0644 sp11-secureboot.service $R/usr/lib/systemd/system/sp11-secureboot.service ln -s ../sp11-secureboot.service $R/usr/lib/systemd/system/multi-user.target.wants/sp11-secureboot.service install -D -m 0644 sp11-tpm2-setup-early.conf $R/usr/lib/systemd/system/systemd-tpm2-setup-early.service.d/sp11-initrd-only.conf install -D -m 0644 sp11-pcrphase-shutdown.conf $R/usr/lib/systemd/system/systemd-pcrphase.service.d/sp11-shutdown-measurement.conf install -D -m 0644 sp11-pcrphase-final.conf $R/usr/lib/systemd/system/systemd-pcrphase-sysinit.service.d/sp11-final-measurement.conf # sp11-surface-modem (docs/modem.md and docs/gnss.md): the file that selects the device tree with the modem, which # sp11-grub-defaults reads after sp11.env, the ModemManager rule and drop-in, and the GNSS feed with its socket, # sleep hook, GeoClue drop-in and policy module. install -m 0644 sp11-modem.env $R/etc/sp11/sp11-modem.env install -D -m 0644 77-sp11-modem.rules $R/usr/lib/udev/rules.d/77-sp11-modem.rules install -m 0755 sp11-gnss $R/usr/libexec/sp11/sp11-gnss install -m 0644 sp11-gnss.socket sp11-gnss.service $R/usr/lib/systemd/system/ install -D -m 0755 sp11-gnss-sleep $R/usr/lib/systemd/system-sleep/sp11-gnss install -D -m 0644 sp11-gnss-geoclue.conf $R/etc/geoclue/conf.d/90-sp11-gnss.conf install -D -m 0644 sp11-gnss.cil $R/usr/share/selinux/packages/sp11-gnss.cil install -D -m 0644 sp11-quick-suspend-resume.conf $R/usr/lib/systemd/system/ModemManager.service.d/sp11-quick-suspend-resume.conf %check # `bash -n A B C` parses only A (B and C become positional parameters): every script on its own. for f in 15-sp11-surface.install 96-sp11-secureboot.install sp11-first-boot sp11-grub-modules sp11-grub-defaults \ sp11-bt-import-pairings sp11-diag sp11-bt-apply sp11-wifi-apply sp11-ucm-apply sp11-secureboot sp11-gnss-sleep; do bash -n $f done for f in 29_sp11_windows 09_sp11_secureboot; do sh -n $f done for f in sp11-bt-set-addr sp11-secureboot-theme sp11-gnss sp11-wifi-board; do python3 -I -c 'import ast, sys; ast.parse(open(sys.argv[1]).read())' $f done # The GNSS feed's policy module (sp11-gnss.cil): the feed's own domain and GeoClue's access to its socket. rpm # labels the feed before the module is loaded, so it is relabelled here. The socket takes the feed's domain when it # starts listening, so it is restarted, but only while the feed is not running: the restart would close GeoClue's # connection, which GeoClue 2.8 does not survive (docs/gnss.md); a feed running now has its new socket after a boot. %post -n sp11-surface-modem if [ -d /etc/selinux/targeted ] && [ -x /usr/sbin/semodule ]; then /usr/sbin/semodule -i /usr/share/selinux/packages/sp11-gnss.cil >/dev/null 2>&1 || : /usr/sbin/restorecon /usr/libexec/sp11/sp11-gnss >/dev/null 2>&1 || : fi systemctl -q is-active sp11-gnss.service 2>/dev/null || systemctl try-restart sp11-gnss.socket >/dev/null 2>&1 || : %posttrans -n sp11-surface-modem # The device tree with the modem (sp11-modem.env): into /etc/default/grub and the boot entries of the kernels # already installed, on an installed system only, as sp11-surface-support applies its policy. if [ -f /boot/grub2/grub.cfg ]; then /usr/libexec/sp11/sp11-grub-defaults || : fi %postun -n sp11-surface-modem # On erase the policy module goes, and with sp11-modem.env gone the system returns to the device tree without the # modem. if [ $1 -eq 0 ]; then [ -x /usr/sbin/semodule ] && /usr/sbin/semodule -r sp11-gnss >/dev/null 2>&1 || : if [ -f /boot/grub2/grub.cfg ] && [ -x /usr/libexec/sp11/sp11-grub-defaults ]; then /usr/libexec/sp11/sp11-grub-defaults || : fi fi %posttrans # Apply the /etc/default/grub policy and regenerate the GRUB menu on an installed system (the live root has # no grub.cfg), so an upgrade that changes the policy takes effect without a reboot. Without the helper an # upgrade would regenerate the menu from the previous policy: on an installed system nothing else runs it # (the kernel-install plugin only on a kernel install, sp11-first-boot only once). if [ -f /boot/grub2/grub.cfg ]; then /usr/libexec/sp11/sp11-grub-defaults || : /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg >/dev/null 2>&1 || : fi # The signed boot images' copies on the ESP and their GRUB entries, after the menu: grub2-mkconfig rewrites the # options of every boot entry, and the signed entries take theirs from there. Nothing to do, and nothing done, # without an sp11-kernel-secureboot package. /usr/libexec/sp11/sp11-secureboot sync >/dev/null 2>&1 || : # The DSP firmware comes from Fedora's qcom-firmware-extract, which copies it from the Windows partition. Without it # the DSPs (audio, battery, USB-C data) stay off once an initramfs is built. if [ ! -e /usr/lib/firmware/updates/qcom/x1e80100/microsoft/Denali/qcadsp8380.mbn.xz ]; then echo "sp11-surface-support: no DSP firmware yet; sp11-firmware-extract.service copies it from Windows at the next start" >&2 fi # The model with 5G (the firmware's SKU, as SP11_SKU_5G_REGEX of sp11.conf reads it) takes sp11-surface-modem. if [ ! -e /etc/sp11/sp11-modem.env ]; then case "$(cat /sys/class/dmi/id/product_sku 2>/dev/null)" in Surface_Pro_with_5G_11th_Edition*) echo "sp11-surface-support: this is the model with 5G; 'dnf install sp11-surface-modem' sets up its modem" >&2 ;; esac # Up to 4.4 the package built for the 5G SKU carried the modem's files and loaded their policy module. They are # sp11-surface-modem's now; without that package the module goes. if [ -x /usr/sbin/semodule ] && /usr/sbin/semodule -l 2>/dev/null | grep -qx sp11-gnss; then /usr/sbin/semodule -r sp11-gnss >/dev/null 2>&1 || : fi fi # On erase the copies on the ESP and the entries file go with the tool that keeps them. %preun if [ $1 -eq 0 ]; then /usr/libexec/sp11/sp11-secureboot remove >/dev/null 2>&1 || : fi # No scriptlet reloads units or udev rules: systemd's RPM file triggers do. A trigger below also runs when this # package is installed while its target is present. %triggerin -- alsa-ucm /usr/libexec/sp11/sp11-ucm-apply || : %triggerin -- grub2-efi-aa64-modules /usr/libexec/sp11/sp11-grub-modules || : # The Wi-Fi board file, when this package or Fedora's firmware package is installed or updated. %triggerin -- atheros-firmware /usr/libexec/sp11/sp11-wifi-board || : %files %defattr(-,root,root,-) /usr/lib/firmware/updates/qcom/x1e80100/microsoft/Denali/adsp_dtb.mbn.xz /usr/lib/firmware/updates/qcom/x1e80100/microsoft/Denali/cdsp_dtb.mbn.xz # Written by sp11-wifi-board: kept across an upgrade, removed with the package, its content not verified. %ghost %attr(0644,root,root) /usr/lib/firmware/ath12k/WCN7850/hw2.0/board.bin /usr/share/alsa/ucm2/Qualcomm/x1e80100/SP11.conf /usr/share/alsa/ucm2/Qualcomm/x1e80100/SP11-HiFi.conf /usr/share/alsa/ucm2/Qualcomm/x1e80100/SP11-SpeakerSeq.conf /usr/share/alsa/ucm2/Qualcomm/x1e80100/SP11-DefaultEnableSeq.conf /usr/share/wireplumber/wireplumber.conf.d/51-sp11-speakers.conf /usr/share/sp11/ /usr/libexec/sp11/ %exclude /usr/libexec/sp11/sp11-gnss /usr/lib/systemd/system/sp11-bluetooth-address@.service /usr/lib/systemd/system/sp11-first-boot.service /usr/lib/systemd/system/multi-user.target.wants/sp11-first-boot.service /usr/lib/systemd/system/sp11-firmware-extract.service /usr/lib/systemd/system/multi-user.target.wants/sp11-firmware-extract.service /usr/lib/systemd/system/sp11-secureboot.service /usr/lib/systemd/system/multi-user.target.wants/sp11-secureboot.service %dir /usr/lib/systemd/system/systemd-tpm2-setup-early.service.d /usr/lib/systemd/system/systemd-tpm2-setup-early.service.d/sp11-initrd-only.conf %dir /usr/lib/systemd/system/systemd-pcrphase.service.d /usr/lib/systemd/system/systemd-pcrphase.service.d/sp11-shutdown-measurement.conf %dir /usr/lib/systemd/system/systemd-pcrphase-sysinit.service.d /usr/lib/systemd/system/systemd-pcrphase-sysinit.service.d/sp11-final-measurement.conf /usr/lib/udev/rules.d/99-sp11-bluetooth-address.rules /usr/lib/udev/rules.d/99-sp11-wifi-address.rules /usr/lib/udev/rules.d/78-sp11-speakers.rules /usr/lib/kernel/install.d/15-sp11-surface.install /usr/lib/kernel/install.d/96-sp11-secureboot.install /etc/grub.d/29_sp11_windows /etc/grub.d/09_sp11_secureboot /usr/lib/dracut/dracut.conf.d/90-sp11.conf /usr/lib/modules-load.d/sp11-scmi-cpufreq.conf /usr/share/dnf5/repos.override.d/90-sp11-kernel.repo /usr/share/dnf5/repos.override.d/91-sp11-kernel-copr.repo %dir /etc/sp11 /etc/sp11/sp11.env %files -n sp11-surface-modem %defattr(-,root,root,-) /etc/sp11/sp11-modem.env /usr/lib/udev/rules.d/77-sp11-modem.rules /usr/libexec/sp11/sp11-gnss /usr/lib/systemd/system/sp11-gnss.socket /usr/lib/systemd/system/sp11-gnss.service /usr/lib/systemd/system-sleep/sp11-gnss /etc/geoclue/conf.d/90-sp11-gnss.conf /usr/share/selinux/packages/sp11-gnss.cil %dir /usr/lib/systemd/system/ModemManager.service.d /usr/lib/systemd/system/ModemManager.service.d/sp11-quick-suspend-resume.conf %changelog * Sun Sep 13 2026 SP11 build - 4.9-1 - Surface Pro 11 support payload