QUD-1773: smart Linux installer guide with preflight analyzer and known-good matrix#28
Open
hangzqcom wants to merge 3 commits intoqualcomm:mainfrom
Open
QUD-1773: smart Linux installer guide with preflight analyzer and known-good matrix#28hangzqcom wants to merge 3 commits intoqualcomm:mainfrom
hangzqcom wants to merge 3 commits intoqualcomm:mainfrom
Conversation
Add .deb package support using DKMS to handle install, uninstall, upgrade, and version control of Qualcomm USB kernel drivers on Debian/Ubuntu systems. New files: - debian/: Full Debian packaging (control, rules, changelog, maintainer scripts) - build-deb.sh: Build script that syncs version from version.h - dkms.conf: DKMS configuration for 4 kernel modules Features: - Builds qtiDevInf, qcom_usb, qcom_usbnet, qcom-serial via DKMS - Auto-rebuilds modules on kernel updates - Blacklists conflicting in-tree modules (qcserial, qmi_wwan, etc.) - Detects and removes conflicting userspace drivers (deb package, /opt/qcom/qcom_userspace, /opt/qcom/QUD, /opt/QTI/QUD, qcom-qud.service) - Cleans up pre-existing manual installs before installation - Installs udev rules for device permissions - Loads modules immediately after installation Updated: - README.md: Added deb package as recommended Linux install method - src/linux/README.md: Added deb package documentation - src/linux/version.h: Version 1.0.6.1 Signed-off-by: Hang Zhao <259427778+hangzqcom@users.noreply.github.com>
The Conflicts and Replaces fields referenced non-existent package names (qcom-usb-userspace-drivers, qcom-usb-userspace-drivers-dkms). Fixed to use the actual installed package name: qcom-usb-userspace-driver. This enables apt to automatically resolve the mutual exclusion between kernel-mode and userspace driver packages during cross-installation.
…wn-good matrix
Adds a self-analyzing preflight tool plus a human-readable install guide for
qcom-usb-drivers-dkms on Linux, addressing five install pain points:
1. Too many distro variants
2. Kernel update breakage
3. Secure Boot MOK hurdles
4. Missing build components
5. Immutable / OSTree systems
New files:
- scripts/check-install-env.sh - Bash preflight analyzer. Detects distro,
kernel, arch, Secure Boot state, kernel headers, DKMS/gcc/make toolchain,
immutable rootfs, and conflicting in-tree modules. Emits human or JSON
reports and exits 0/1/2/3/4 for pass/partial/fail/unknown/error.
- scripts/known-good-configs.json - Curated compatibility matrix with a
JSON Schema defined inline. Seeded with Ubuntu 22.04/24.04, Debian 11/12,
Linux Mint, Pop!_OS, Fedora, RHEL, CentOS Stream and Arch.
- scripts/match_known_good.py - Classifier that maps a detected
(distro, version, kernel, arch) tuple to a known-good entry and prints
status + notes + required packages for the bash driver to consume.
- docs/linux/install-guide.md - Companion user guide: quick start,
step-by-step install, finding-code troubleshooting matrix, distro notes,
Secure Boot MOK enrollment, immutable rootfs workarounds, and a
report-back workflow that invites users to submit PRs extending the
known-good matrix.
Integrations:
- build-deb.sh now runs the preflight automatically; hard failures abort
the build. Bypass with SKIP_PREFLIGHT=1.
- README.md and docs/linux/getting-started/README.md link to the new
install guide and advertise the preflight entry point.
All three scripts pass bash -n / python ast parse / python -m json.tool
validation on a clean Ubuntu 24.04 / 6.8 / x86_64 host, where the
preflight correctly classifies the system as pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements QUD-1773 — a self-analyzing Linux installer guide for
qcom-usb-drivers-dkms.Adds a preflight environment analyzer, a machine-readable known-good compatibility matrix, a Python classifier that maps the two together, and a user-facing install guide that ties everything into a concrete troubleshooting workflow.
build-deb.shnow runs the preflight automatically before building.Motivation
QUD-1773 calls out five persistent Linux install pain points:
make installbreaks on kernel upgrade.linux-headers,dkms,dh-dkms, orgccare missing./usr.The goal was an installer experience that auto-detects, validates, diagnoses, and learns from new configurations.
What's new
scripts/check-install-env.sh— preflight analyzerDetects distro, kernel, arch, Secure Boot state + MOK enrollment, kernel headers, DKMS, gcc, make, Debian build deps, immutable rootfs, and conflicting in-tree modules (
qcserial,qmi_wwan,cdc_wdm,option,usb_wwan). Cross-references the detected tuple with the known-good matrix and prints a human- or JSON-formatted report.Every finding carries a stable
CODE(e.g.MISSING_HEADERS,SECURE_BOOT_MOK,IMMUTABLE_ROOTFS,MATCH_FAIL) that the companion guide documents in a troubleshooting matrix.Exit codes:
0=pass · 1=partial · 2=fail · 3=unknown · 4=error.scripts/known-good-configs.json— living compatibility matrixJSON Schema is defined inline. Seeded with 12 entries covering Ubuntu 22.04/24.04, Debian 11/12, Linux Mint, Pop!_OS, Fedora 40/41 + Silverblue, RHEL 9, CentOS Stream 9 and Arch. Each entry captures
distro_id, version (glob),kernel_range(min..max), architectures,status ∈ {pass, partial, fail, untested},secure_boot,immutable_rootfs,required_packages,validated_by/on, and free-formnotes.This file is designed to grow via PRs — every user who validates an unlisted combination can append one entry, turning the file into a continuously-learning compatibility database.
scripts/match_known_good.py— classifierPure-stdlib Python. Maps
(distro_id, distro_version, kernel_major_minor, arch)to the most specific matching entry (prefers exact version over glob), treatsx86_64↔amd64andaarch64↔arm64as synonyms, and emits a single tab-separated line (status\tnotes\trequired_packages) that the bash driver parses.docs/linux/install-guide.md— companion user guideHuman-readable walkthrough (~200 lines):
rpm-ostree install,usroverlay, toolbox)Integrations
build-deb.shruns the preflight automatically; hard failures (exit 2) abort the build. Bypass withSKIP_PREFLIGHT=1.README.mdrepository structure + Debian install section now point at the preflight and the new guide.docs/linux/getting-started/README.mdlinks to the install guide.Test plan & live results
Live-tested on this machine (Ubuntu 24.04.2 LTS, kernel 6.8.0-106-generic, x86_64):
--jsonmode--report-filewrites valid JSON--strictmodepass,partial,untested,unknown,passrespectively--helpoutputpartialwith note,passrespectively--configs-fileNO_CONFIGS_FILEwarn, gracefulPARTIAL, exit 1SKIP_PREFLIGHT=1bypass inbuild-deb.shbuild-deb.shintegrationSample run on this host
Static checks
python3 -m json.tool scripts/known-good-configs.json→ validbash -n scripts/check-install-env.shandbuild-deb.sh→ cleanpython3 -c "import ast; ast.parse(...)"onmatch_known_good.py→ cleanFiles changed
Total: 7 files changed, +1135 / −4 lines.
Notes for reviewers
known-good-configs.jsonis embedded in the file itself under$defs, so a PR that edits entries also ships schema documentation. No extra file to maintain.match_known_good.pyuses only stdlib (json,fnmatch) so there are no new runtime dependencies beyondpython3(already required by DKMS on every supported distro)./etc/os-release,uname,mokutil,/sys/firmware/efi,lsmod, and checks for common binaries viacommand -v. Safe to run as non-root too — Secure Boot detection may be less precise withoutmokutil.scripts/check-install-env.sh --jsoninto a GitHub Actions matrix that runs the preflight (and eventually the build) on every distro/kernel combo, feeding results back intoknown-good-configs.jsonvia automated PRs.