Skip to content

Add Debian packaging (DKMS) for Linux kernel drivers#17

Open
hangzqcom wants to merge 2 commits intoqualcomm:mainfrom
hangzqcom:feature/deb-packaging
Open

Add Debian packaging (DKMS) for Linux kernel drivers#17
hangzqcom wants to merge 2 commits intoqualcomm:mainfrom
hangzqcom:feature/deb-packaging

Conversation

@hangzqcom
Copy link
Copy Markdown
Contributor

Summary

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

File Purpose
debian/ Full Debian packaging (control, rules, changelog, maintainer scripts)
build-deb.sh Build script that auto-syncs version from version.h
dkms.conf DKMS configuration for 4 kernel modules

Features

  • DKMS integration: Builds qtiDevInf, qcom_usb, qcom_usbnet, qcom-serial automatically
  • Auto-rebuild on kernel update: Modules are rebuilt when a new kernel is installed
  • Conflict resolution: Blacklists conflicting in-tree modules (qcserial, qmi_wwan, cdc_wdm, option, usb_wwan)
  • Userspace driver detection: Automatically detects and removes conflicting userspace drivers:
    • Deb packages matching qcom-usb-userspace*
    • Manual installs at /opt/qcom/qcom_userspace, /opt/qcom/QUD, /opt/QTI/QUD
    • qcom-qud.service systemd service
    • GobiNet/QdssDiag kernel modules
  • Clean install/uninstall: Handles pre-existing manual installs, udev rules, module loading
  • Version control: dpkg -s and dkms status for version queries; upgrades via dpkg -i

Usage

# Build
./build-deb.sh

# Install
sudo dpkg -i ../qcom-usb-drivers-dkms_1.0.6.1_all.deb

# Uninstall
sudo dpkg -r qcom-usb-drivers-dkms

# Check version
dpkg -s qcom-usb-drivers-dkms | grep Version

Testing

Tested on Ubuntu 24.04 (kernel 6.8.0-106-generic):

  • ✅ Fresh install — all 4 modules built and loaded
  • ✅ Uninstall — modules removed, DKMS cleaned, blacklist removed
  • ✅ Upgrade — old version removed, new version installed seamlessly
  • ✅ Userspace conflict detection — detects and cleans up all known userspace driver paths
  • ✅ Manual install cleanup — removes pre-existing make install modules

Updated Files

  • README.md: Added deb package as recommended Linux install method
  • src/linux/README.md: Added deb package documentation section
  • src/linux/version.h: Version 1.0.6.1

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>
@hangzqcom hangzqcom force-pushed the feature/deb-packaging branch from 0ffa493 to aa9d18b Compare April 9, 2026 06:32
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.

# QDSS diagnostic devices
SUBSYSTEM=="usb", DRIVERS=="QdssDiag", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", DRIVERS=="QdssMdm", MODE="0660", GROUP="plugdev" No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QdssMdm is not a driver.
Gobiserial is not in used. User can build it for internal use-case. we are not building it via QcDevDriver.sh script.
and currently we are not using QcDevDriver.sh script as well.

install option /bin/false
blacklist usb_wwan
install usb_wwan /bin/false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do not need modprobe file here. this content is already taken care by our qcom_driver.sh script.

rmmod "$mod" 2>/dev/null || true
fi
done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already handled by the qcom_driver.sh script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants