Skip to contentSkip to conversation

package: add qrtr, rmtfs and tqftpserv for Qualcomm modems

PATCH In review Igor Opaniuk via buildroot 1 participant 6 messages Oct 20

lore
Share & tools
lore
#0 lore raw

cover package: add qrtr, rmtfs and tqftpserv for Qualcomm modems

On Qualcomm SoCs the modem cannot finish booting without two Linux
daemons: rmtfs, which serves its EFS partitions, and tqftpserv, which hands it the files it asks for over QRTR (on several SoCs the WLAN firmware runs on the modem and is loaded this way). Both are built on qrtr, the userspace library and tools for the Qualcomm IPC Router. All three live under github.com/linux-msm; this series adds them to Buildroot at their latest releases (qrtr 1.2, rmtfs 1.3, tqftpserv 1.3).

Notes:
- qrtr: the userspace name service (qrtr-ns) is not built, the kernel has had its own since Linux 5.7.
- rmtfs ships its QMI encoders pre-generated, so the qmic generator is not needed.
- rmtfs and tqftpserv get sysv init scripts; with systemd the upstream units (and the rmtfs udev rule) are installed instead.
- tqftpserv carries one patch, defining _GNU_SOURCE for asprintf() so it builds with uClibc-ng; it is pending upstream:
https://github.com/linux-msm/tqftpserv/pull/56

Tested on an Arduino UNO Q (Qualcomm QRB2210) with mainline Linux: the modem boots, its EFS is served from eMMC, it fetches its WLAN firmware through tqftpserv and the ath10k interface associates.

Build-tested with utils/test-pkg -a (qrtr, rmtfs, tqftpserv with xz and zstd): 26 toolchains OK, 6 skipped as expected (noMMU, static, no threads, kernel headers < 4.15), no failures.

---
Igor Opaniuk (3):
package/qrtr: new package
package/rmtfs: new package
package/tqftpserv: new package

 DEVELOPERS                                         |  5 ++
 package/Config.in                                  |  3 ++
 package/qrtr/Config.in                             | 16 ++++++
 package/qrtr/qrtr.hash                             |  4 ++
 package/qrtr/qrtr.mk                               | 14 ++++++
 package/rmtfs/Config.in                            | 17 +++++++
 package/rmtfs/S45rmtfs                             | 58 ++++++++++++++++++++++
 package/rmtfs/rmtfs.hash                           |  3 ++
 package/rmtfs/rmtfs.mk                             | 45 +++++++++++++++++
 ...translate-define-_GNU_SOURCE-for-asprintf.patch | 36 ++++++++++++++
 package/tqftpserv/Config.in                        | 14 ++++++
 package/tqftpserv/S44tqftpserv                     | 51 +++++++++++++++++++
 package/tqftpserv/tqftpserv.hash                   |  3 ++
 package/tqftpserv/tqftpserv.mk                     | 32 ++++++++++++
 14 files changed, 301 insertions(+)

---
base-commit: 4eeec84c3341715e0436e40f94b31379f227000f
change-id: 20261019-qcom-modem-userspace-940b9f49124a

Best regards,

Signature · 6 lines
Igor Opaniuk <[email protected]>

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/3 package/qrtr: new package

Userspace for the Qualcomm IPC Router (QRTR), the transport between Linux and the remote processors of Qualcomm SoCs: libqrtr plus the qrtr-cfg and qrtr-lookup tools. rmtfs and tqftpserv, which the modem needs to boot, are built on it.

The name service has been part of the kernel since Linux 5.7, so the userspace qrtr-ns daemon (and its systemd unit) is not built.

lib/qmi.c, built into libqrtr, carries its own BSD-3-Clause notice (The Linux Foundation, Linaro), so it is listed as a license file next to LICENSE. The GPL-2.0 SPDX tags in the tree are on CI scripts only.

Tested on an Arduino UNO Q (Qualcomm QRB2210): qrtr-lookup lists the modem's services after it boots.

Assisted-by Claude:claude-opus-5-5
---
 DEVELOPERS             |  3 +++
 package/Config.in      |  1 +
 package/qrtr/Config.in | 16 ++++++++++++++++
 package/qrtr/qrtr.hash |  4 ++++
 package/qrtr/qrtr.mk   | 14 ++++++++++++++
 5 files changed, 38 insertions(+)
DEVELOPERS +3 -0
index f46d09db5a..56c919d00d 100644
@@ -1494,6 +1494,9 @@ F:	package/gcc-bare-metal/
 F:	package/newlib-bare-metal/
 F:	toolchain/toolchain-bare-metal-buildroot/
 
+N:	Igor Opaniuk <[email protected]>
+F:	package/qrtr/
+
 N:	Ilias Apalodimas <[email protected]>
 F:	package/keepalived/
 
package/Config.in +1 -0
index d041291bcb..9416c35458 100644
@@ -588,6 +588,7 @@ endmenu
 	source "package/pru-software-support/Config.in"
 	source "package/pulseview/Config.in"
 	source "package/qoriq-cadence-dp-firmware/Config.in"
+	source "package/qrtr/Config.in"
 	source "package/rasdaemon/Config.in"
 	source "package/raspi-gpio/Config.in"
 	source "package/rdma-core/Config.in"
package/qrtr/Config.in new file +16 -0
new file mode 100644
index 0000000000..9f7584f6e4
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_QRTR
+	bool "qrtr"
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15 # linux/qrtr.h control packets
+	help
+	  Userspace for the Qualcomm IPC Router (QRTR), the transport
+	  used to talk to the remote processors (modem, ADSP, ...) of
+	  Qualcomm SoCs: the libqrtr library and the qrtr-cfg and
+	  qrtr-lookup tools.
+
+	  The QRTR name service runs in the kernel since Linux 5.7,
+	  so the userspace qrtr-ns daemon is not installed.
+
+	  https://github.com/linux-msm/qrtr
+
+comment "qrtr needs a toolchain w/ headers >= 4.15"
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
package/qrtr/qrtr.hash new file +4 -0
new file mode 100644
index 0000000000..ee37272506
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  7a82bf80246fe71287b13c66c0466208822e8337fcd4aaf302eee6c5fcb48a52  qrtr-1.2.tar.gz
+sha256  e04f492e71bc5cfe131942eb127c7906d2627831ab910bb894402b476b5d7488  LICENSE
+sha256  dc5e608ed83348a1536b93877596a8bf4a32498e2b740d18f0f7b3a4951cf04b  lib/qmi.c
package/qrtr/qrtr.mk new file +14 -0
new file mode 100644
index 0000000000..7bf7a491bf
@@ -0,0 +1,14 @@
+################################################################################
+#
+# qrtr
+#
+################################################################################
+
+QRTR_VERSION = 1.2
+QRTR_SITE = $(call github,linux-msm,qrtr,v$(QRTR_VERSION))
+QRTR_LICENSE = BSD-3-Clause
+QRTR_LICENSE_FILES = LICENSE lib/qmi.c
+QRTR_INSTALL_STAGING = YES
+QRTR_CONF_OPTS = -Dqrtr-ns=disabled -Dsystemd-service=disabled
+
+$(eval $(meson-package))
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 1/3] package/qrtr: new package

package/qrtr/qrtr.mk line 10

Quoted 4 lines · Igor Opaniuk via buildroot
package/qrtr/qrtr.mk new file +4 -0
+QRTR_VERSION = 1.2
+QRTR_SITE = $(call github,linux-msm,qrtr,v$(QRTR_VERSION))
+QRTR_LICENSE = BSD-3-Clause
+QRTR_LICENSE_FILES = LICENSE lib/qmi.c

Both files carry the BSD-3-Clause license text, so I'm not sure why adding lib/qmi.c was useful. Also, using a source file that has a chance of being regularly modified for other reasons than the license terms is a bit annoying, as it means we have to update its hash in our hash file everytime there's a change to this file, even if not related to licensing term changes.

So I've dropped the usage of lib/qmi.c as a license file. Let me know if that is a problem.

package/qrtr/qrtr.mk line 12

Quoted 2 lines
package/qrtr/qrtr.mk new file +2 -0
+QRTR_INSTALL_STAGING = YES
+QRTR_CONF_OPTS = -Dqrtr-ns=disabled -Dsystemd-service=disabled

Curious: why isn't the systemd service enabled when BR2_INIT_SYSTEMD=y?

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH 2/3 package/rmtfs: new package

In reply to Igor Opaniuk via buildroot

rmtfs serves the EFS partitions of the modem of Qualcomm SoCs (modemst1, modemst2, fsg, fsc) over QRTR and the rmtfs shared memory; without it the modem firmware stalls during its boot.

The tarball ships the QMI encoders pre-generated, so the qmic code generator is not needed; the .c/.h files are touched before the build so make does not try to regenerate them. The sysv init script starts the daemon with -P (EFS partitions by GPT label) and skips when there is no rmtfs shared memory; RMTFS_ARGS can be overridden in /etc/default/rmtfs (e.g. -s to let rmtfs start the modem). With systemd the upstream unit and udev rule are installed.

Tested on an Arduino UNO Q (Qualcomm QRB2210): with sysv init the modem boots, its EFS is served from the modemst1/modemst2/fsg partitions and its WLAN firmware comes up.

Assisted-by Claude:claude-opus-5-5
---
 DEVELOPERS               |  1 +
 package/Config.in        |  1 +
 package/rmtfs/Config.in  | 17 ++++++++++++++
 package/rmtfs/S45rmtfs   | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
 package/rmtfs/rmtfs.hash |  3 +++
 package/rmtfs/rmtfs.mk   | 45 +++++++++++++++++++++++++++++++++++++
 6 files changed, 125 insertions(+)
DEVELOPERS +1 -0
index 56c919d00d..dc0c8f35eb 100644
@@ -1496,6 +1496,7 @@ F:	toolchain/toolchain-bare-metal-buildroot/
 
 N:	Igor Opaniuk <[email protected]>
 F:	package/qrtr/
+F:	package/rmtfs/
 
 N:	Ilias Apalodimas <[email protected]>
 F:	package/keepalived/
package/Config.in +1 -0
index 9416c35458..eb8cf851df 100644
@@ -593,6 +593,7 @@ endmenu
 	source "package/raspi-gpio/Config.in"
 	source "package/rdma-core/Config.in"
 	source "package/read-edid/Config.in"
+	source "package/rmtfs/Config.in"
 	source "package/rng-tools/Config.in"
 	source "package/rockchip-mali/Config.in"
 	source "package/rockchip-rkbin/Config.in"
package/rmtfs/Config.in new file +17 -0
new file mode 100644
index 0000000000..9a27f9c373
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_RMTFS
+	bool "rmtfs"
+	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15 # qrtr
+	select BR2_PACKAGE_QRTR
+	help
+	  Remote file system service for the modem of Qualcomm SoCs:
+	  serves the modem's EFS partitions (modemst1, modemst2, fsg,
+	  fsc) over QRTR and the rmtfs shared memory. Without it the
+	  modem firmware stalls at boot.
+
+	  https://github.com/linux-msm/rmtfs
+
+comment "rmtfs needs udev /dev management and a toolchain w/ threads, headers >= 4.15"
+	depends on !BR2_PACKAGE_HAS_UDEV || !BR2_TOOLCHAIN_HAS_THREADS || \
+		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
package/rmtfs/S45rmtfs new file +58 -0

58 lines not on this page · raw message

package/rmtfs/rmtfs.hash new file +3 -0
new file mode 100644
index 0000000000..680926947f
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  4b6c398806a1046e2256a685d592833de0f37b7245b8adc4797e1791f0e117ee  rmtfs-1.3.tar.gz
+sha256  1e1e2972bd05841b6a009bd6f7aef9d847f9a2b721d1a308340e642faa2482cd  LICENSE
package/rmtfs/rmtfs.mk new file +45 -0

45 lines not on this page · raw message

Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

PATCH 3/3 package/tqftpserv: new package

In reply to Igor Opaniuk via buildroot

tqftpserv is a TFTP server over QRTR: the modem of Qualcomm SoCs fetches files from Linux through it, e.g. the WLAN firmware (wlanmdsp.mbn) on SoCs whose WLAN firmware runs on the modem. Files are looked up next to the remoteproc firmware under /lib/firmware; xz and zstd compressed files are handled when those libraries are enabled.

The systemd units are installed only with systemd as init; a sysv init script is provided otherwise.

The patch defines _GNU_SOURCE in translate.c, which calls asprintf():
uClibc-ng declares it only then, so the build failed there (test-pkg, bootlin-armv5-uclibc). Submitted upstream as well.

Tested on an Arduino UNO Q (Qualcomm QRB2210): the modem fetches wlanmdsp.mbn through it and the ath10k WLAN interface comes up.

Assisted-by Claude:claude-opus-5-5
---
 DEVELOPERS                                         |  1 +
 package/Config.in                                  |  1 +
 ...translate-define-_GNU_SOURCE-for-asprintf.patch | 36 +++++++++++++++
 package/tqftpserv/Config.in                        | 14 ++++++
 package/tqftpserv/S44tqftpserv                     | 51 ++++++++++++++++++++++
 package/tqftpserv/tqftpserv.hash                   |  3 ++
 package/tqftpserv/tqftpserv.mk                     | 32 ++++++++++++++
 7 files changed, 138 insertions(+)
DEVELOPERS +1 -0
index dc0c8f35eb..2d3e525f20 100644
@@ -1497,6 +1497,7 @@ F:	toolchain/toolchain-bare-metal-buildroot/
 N:	Igor Opaniuk <[email protected]>
 F:	package/qrtr/
 F:	package/rmtfs/
+F:	package/tqftpserv/
 
 N:	Ilias Apalodimas <[email protected]>
 F:	package/keepalived/
package/Config.in +1 -0
index eb8cf851df..4b90333bf7 100644
@@ -638,6 +638,7 @@ endmenu
 	source "package/ti-uim/Config.in"
 	source "package/ti-utils/Config.in"
 	source "package/tio/Config.in"
+	source "package/tqftpserv/Config.in"
 	source "package/triggerhappy/Config.in"
 	source "package/uboot-bootcount/Config.in"
 	source "package/uboot-tools/Config.in"
package/tqftpserv/0001-translate-define-_GNU_SOURCE-for-asprintf.patch new file +36 -0
new file mode 100644
index 0000000000..06829ed9be
@@ -0,0 +1,36 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Igor Opaniuk <[email protected]>
+Date: Mon, 19 Oct 2026 22:02:59 +0200
+Subject: [PATCH] translate: define _GNU_SOURCE for asprintf()
+
+asprintf() is a GNU extension. glibc and musl declare it in their
+default mode, uClibc-ng only with _GNU_SOURCE, so with uClibc-ng
+translate.c fails to build (an error with GCC 14 and later):
+
+  translate.c:298:15: error: implicit declaration of function 'asprintf'
+
+Define _GNU_SOURCE before the includes, as xz-decompress.c and
+zstd-decompress.c already do.
+
+Assisted-by: Claude:claude-opus-5-5
+Signed-off-by: Igor Opaniuk <[email protected]>
+Upstream: https://github.com/linux-msm/tqftpserv/pull/56
+---
+ translate.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/translate.c b/translate.c
+index 246b82d..19fdd48 100644
+--- a/translate.c
++++ b/translate.c
+@@ -2,6 +2,7 @@
+ /*
+  * Copyright (c) 2019, Linaro Ltd.
+  */
++#define _GNU_SOURCE /* asprintf() */
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <dirent.h>
+-- 
+2.53.0
+
package/tqftpserv/Config.in new file +14 -0
new file mode 100644
index 0000000000..e1acb03225
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_TQFTPSERV
+	bool "tqftpserv"
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15 # qrtr
+	select BR2_PACKAGE_QRTR
+	help
+	  TFTP server over QRTR for the remote processors of Qualcomm
+	  SoCs: hands the modem the files it asks for, e.g. the WLAN
+	  firmware, from /lib/firmware. Serves xz or zstd compressed
+	  files when xz or zstd is enabled.
+
+	  https://github.com/linux-msm/tqftpserv
+
+comment "tqftpserv needs a toolchain w/ headers >= 4.15"
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
package/tqftpserv/S44tqftpserv new file +51 -0

51 lines not on this page · raw message

package/tqftpserv/tqftpserv.hash new file +3 -0
new file mode 100644
index 0000000000..d7660df608
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  87a3845e8f47b42f31d8aaad04c5e0707e391b3954d096aeff6f0a03467dc33f  tqftpserv-1.3.tar.gz
+sha256  a6d7cc7891d16f9c74c9a9c2514805e59bb8758db7690bb7ae065c79cec9515a  LICENSE
package/tqftpserv/tqftpserv.mk new file +32 -0
new file mode 100644
index 0000000000..a8a6220bb0
@@ -0,0 +1,32 @@
+################################################################################
+#
+# tqftpserv
+#
+################################################################################
+
+TQFTPSERV_VERSION = 1.3
+TQFTPSERV_SITE = $(call github,linux-msm,tqftpserv,v$(TQFTPSERV_VERSION))
+TQFTPSERV_LICENSE = BSD-3-Clause
+TQFTPSERV_LICENSE_FILES = LICENSE
+TQFTPSERV_DEPENDENCIES = qrtr
+
+ifeq ($(BR2_PACKAGE_XZ),y)
+TQFTPSERV_DEPENDENCIES += xz
+endif
+
+ifeq ($(BR2_PACKAGE_ZSTD),y)
+TQFTPSERV_DEPENDENCIES += zstd
+endif
+
+ifeq ($(BR2_INIT_SYSTEMD),y)
+TQFTPSERV_CONF_OPTS += -Dsystemd-unit-prefix=/usr/lib/systemd/system
+else
+TQFTPSERV_CONF_OPTS += -Dsystemd-unit-prefix=
+endif
+
+define TQFTPSERV_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 $(TQFTPSERV_PKGDIR)/S44tqftpserv \
+		$(TARGET_DIR)/etc/init.d/S44tqftpserv
+endef
+
+$(eval $(meson-package))
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw
In reply to Igor Opaniuk via buildroot
Quoted 4 lines · Igor Opaniuk via buildroot

Igor Opaniuk (3):
package/qrtr: new package
package/rmtfs: new package
package/tqftpserv: new package

Thanks, looked super clean, so all applied. I just did one small change on PATCH 1/3, so I'll reply to this one specifically.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot