Files
omarchy-pkgs/pkgbuilds
9ea749835f Add safe Windows firmware extraction for Snapdragon laptops (#221)
* Add qcom-firmware-extract

Copy the vendor-signed Qualcomm firmware named by a Snapdragon laptop device tree from its Windows driver store into /usr/lib/firmware/updates.

* Select matching Qualcomm firmware variants

* Trim firmware extractor comments

* Keep firmware selection and initramfs updates safe on partial installs

* Run package regression suites in existing CI

* Match kernel firmware compression and search order

* Limit the CI change to the package test scripts

* Match firmware names exactly when updating the manifest

* Count compressed firmware only when the kernel can load it

* Scope the README's firmware claim to this package

* Find DSP device-tree images under their Windows names

The Surface Pro 11 device tree asks for adsp_dtb.mbn and cdsp_dtb.mbn,
but Windows ships them as adsp_dtbs.elf and cdsp_dtbs.elf, so
extraction left both DSP device-tree images missing. Look for the
Windows name when the device-tree name is not found. Exact names still
take precedence, and the existing companion matching still selects
between variants.

Validated with test.sh and on a Surface Pro 11 against its own Windows
driver store: 5 of 5 firmware files staged, up from 3, and the ADSP and
CDSP boot with the device-tree images taken from the .elf files.

* Let later firmware sources fill in what a stage lacks

Any stage manifest, even an empty one, made --stage exit as already
staged and made --install use only the stage, so Windows was never read
again. A --stage rerun now keeps the staged files and looks for the
rest, and --install scans Windows only for what the stage lacks. -d
still replaces both. A rerun without root, which cannot read Windows,
keeps the stage and succeeds as before. Each run reads the stage
manifest once.

Mount points honour QCOM_FW_ROOT so the tests can stub the partition
scan. Both root checks now take the user ID from QCOM_FW_TEST_EUID when
the tests set it, and the install-mode check no longer skips when
QCOM_FW_ROOT is set.

* Let board packages list firmware that must not come from Windows

Some device trees name firmware that should not be copied from Windows:
files a board package produces or holds back until they are tested, and
files the machine's boot firmware loads before Linux, which Windows
drivers do not carry.
On the Surface Laptop 8 these are its USB4 router image and SOCCP pair.

A board package can now list such names in
/usr/share/qcom-firmware-extract/provided.d/<compatible>.list. On a
machine with that compatible they are never searched for, installed or
reported by --list-missing, and the log names the list for each one. An
unreadable list or an entry containing a space is skipped with a
warning.

A copy an earlier --install made of a newly listed name stays in place:
the same bytes would not show that the file is still this tool's copy,
since a board's own tool may keep the same file there. The next
--install stops recording it and prints where it is, for the board
package or the user to remove.

Since --list-missing omits listed names, a board must not list firmware
that a hardware check relies on unless its package installs it before
the check runs.

* Find staged firmware by file name when its device-tree path changed

Since the stage became the first source, --install takes a staged file
only by its exact device-tree path. After a full-disk install the stage
is the only copy, so a device tree that files an image under another
path could no longer be served from it. After Windows, fall back to a
staged file with the same name that the stage manifest lists, but not
when Windows refused differing variants of it as ambiguous.

* Test that listed firmware never sends the extractor to the disks

With every name installed or listed, --list-missing prints nothing,
--stage and --install neither list nor mount partitions, and listed
names are not installed from Windows or the stage. A control run
without the list does scan. Listing the names again leaves the copies
it installed in place but stops recording them, and another missing
file still sends the extractor to Windows for that file alone.

* Read only internal disks from an installed system

--install mounts the Windows partitions whenever the stage lacks a
file, which after a full-disk install can be every later run, and it
mounted every NTFS partition, USB disks included. It now reads only
partitions on disks that lsblk reports as neither removable, hotplug
nor USB. --stage in the live session still reads all of them, internal
disks first, and -d takes a driver store from anywhere.

---------

Co-authored-by: Jimmy Van Veen <jimmy.van.veen@gmail.com>
Co-authored-by: Brandon Williams <turbine.bmw@gmail.com>
Co-authored-by: Jim Martin <jimmartin@gmail.com>
2026-10-09 10:13:34 -04:00
..
2026-09-15 01:26:53 +00:00
2026-09-27 15:09:14 +00:00
2026-10-07 11:26:45 -04:00
2026-09-28 05:36:36 +00:00
2026-09-03 16:33:12 +00:00
2026-09-07 14:36:02 -04:00
2026-09-15 01:26:53 +00:00
2026-10-06 18:31:01 +00:00
2026-08-04 10:42:32 -07:00
2026-08-07 03:03:18 -07:00
2026-05-08 01:04:51 -04:00
2026-09-04 12:29:12 +02:00
2026-09-15 17:10:15 +00:00
2026-10-06 18:31:01 +00:00
2026-09-06 20:32:10 +00:00
2026-05-08 01:07:21 -04:00
2026-10-04 01:23:03 +00:00