Scroll to navigation

QCOM-FIRMWARE-EXTRACT(8) System Administration QCOM-FIRMWARE-EXTRACT(8)

NAME

qcom-firmware-extract - extract Qualcomm Snapdragon X firmware from a local Windows install and package it for Debian/Ubuntu

SYNOPSIS

qcom-firmware-extract [-d PATH]

DESCRIPTION

qcom-firmware-extract mounts a Windows system partition (BitLocker or plain NTFS), locates Qualcomm DSP firmware files under Windows/System32/DriverStore/FileRepository and builds a Debian package that installs those files into /lib/firmware/updates/qcom/<device> . It then installs the package and updates the initramfs so the firmware is available on next boot.

Device selection is automatic: the script reads /proc/device-tree/model and maps known device models to the appropriate firmware directory.

Unless -d is supplied, the script searches NVMe devices, decrypts a BitLocker volume (read-only) via dislocker when needed, or mounts the first plain NTFS partition it finds, also read-only.

The generated package is named:

qcom-x1e-firmware-extracted-<device>_<YYYYMMDD>_arm64.deb

and declares Breaks/Replaces/Conflicts against qcom-x1e-firmware-extracted to avoid file collisions.

Upon successful creation, the script installs the package with apt-get and runs:

update-initramfs -kall -u

Finally, it prints a message reminding you to reboot.

OPTIONS

Use an explicit search path instead of mounting a Windows partition. This should point at the Windows DriverStore FileRepository directory that contains the firmware files, e.g.: /mnt/Windows/System32/DriverStore/FileRepository

SUPPORTED DEVICES

The following models are recognized (by exact or prefix match of /proc/device-tree/model as shown):

If your device is not listed, the script aborts with an error. Extend the case statement to add support.

RUNTIME BEHAVIOUR

  • Creates a temporary workspace under /tmp/fwfetch.* and ensures cleanup on exit.
  • Mounts BitLocker volumes read-only using dislocker(1) to a loopback file, then mounts via ntfs-3g read-only; plain NTFS partitions are mounted read-only directly.
  • Copies the newest matching firmware files among:
adsp_dtbs.elf, adspr.jsn, adsps.jsn, adspua.jsn, battmgr.jsn, cdsp_dtbs.elf, cdspr.jsn, qcadsp8380.mbn, qccdsp8380.mbn, qcdxkmsuc8380.mbn, qcdxkmsucpurwa.mbn
  • Installs to /lib/firmware/updates/qcom/<device_path> with mode 0644.
  • Builds a Debian package using dpkg-deb and installs it with apt-get (noninteractive, reinstall, fix dependencies).
  • Runs update-initramfs -kall -u to include firmware in all installed kernels.

REQUIREMENTS

The following tools must be available (typically from Debian/Ubuntu repositories):

dislocker (for BitLocker volumes), ntfs-3g (for NTFS), dpkg-deb , apt-get , coreutils , findutils , mount , update-initramfs (from initramfs-tools).
Root privileges are required for mounting, package installation, and updating initramfs.

EXIT STATUS

Returns 0 on success. Non-zero on error. Because the script uses set -e , unexpected command failures cause immediate exit; on failure it prints the log from its temporary directory.

FILES

/proc/device-tree/model
Used to detect the current device model.
Default search root on the Windows partition for firmware files.
/lib/firmware/updates/qcom/<device>
Destination for installed firmware files.
/tmp/fwfetch.XXXXXXX/LOG
Build and install log captured during execution.

EXAMPLES

Extract and package firmware by automatically locating and mounting the Windows partition:

sudo qcom-firmware-extract

Use a pre-mounted or copied DriverStore directory:

sudo qcom-firmware-extract -d /mnt/Windows/System32/DriverStore/FileRepository

SECURITY

The script mounts any discovered Windows partition read-only and decrypts BitLocker volumes via dislocker in read-only mode. Verify you are extracting firmware from a trusted Windows installation.

LIMITATIONS

  • Only searches NVMe devices (e.g. nvme0n1). Systems using SATA/eMMC are not scanned automatically; use -d.
  • Only the listed devices are supported out of the box.
  • Assumes an arm64 Debian/Ubuntu target with initramfs-tools present.

SEE ALSO

dislocker(1), mount.ntfs(8), dpkg-deb(1), update-initramfs(8)

AUTHORS

Script: Tobias Heider and contributors. Manpage: generated for operational use by administrators.

COPYRIGHT

This script packages firmware extracted from a local Windows installation. Respect the firmware's license terms and your local laws/policies before redistribution.

2025-08-24 qcom-firmware-extract