Hello everyone, I have been trying to compile the qmi-wwan-q driver from Quectel since we are having some issues with the generic driver on a private 5G network.
We are using a RPi4 with the 22.03 version. I have downloaded the SDK and placed the source files in the folder /package/qmi_wwan_q including a Makefile I created based on some examples I found. The contents of the makefile are as following
include $(TOPDIR)/rules.mk
PKG_NAME:=qmi_wwan_q
PKG_VERSION:=1.2.2
PKG_RELEASE:=1
# Custom variable
SOURCE_DIR:=/home/crave/Documents/mypackages/qmi_wwan_q
PKG_MAINTAINER:=Quectel
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/qmi_wwan_q
SUBMENU:=Network
TITLE:=Quectel qmi_wwan driver
DEPENDS:= \
+kmod-mii \
+kmod-usb-core \
+kmod-usb-net-cdc-ether \
+kmod-usb-net \
+kmod-usb-net-qmi-wwan \
FILES:=$(PKG_BUILD_DIR)/qmi_wwan_q.ko
#AUTOLOAD:=$(call AutoLoad,50,qmi_wwan_q)
endef
define KernelPackage/qmi_wwan_q/description
qmi_wwan driver by Quectel
endef
EXTRA_CFLAGS:= \
$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
MAKE_OPTS:= \
ARCH="$(LINUX_KARCH)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
SUBDIRS="$(PKG_BUILD_DIR)" \
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
$(EXTRA_KCONFIG)
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) $(SOURCE_DIR)/* $(PKG_BUILD_DIR)/
$(Build/Patch)
endef
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \
$(MAKE_OPTS) \
modules
endef
$(eval $(call KernelPackage,qmi_wwan_q))
In the folder, in addition to the Makefile I put qmi_wwan_q.c and rmnet_nss.c.
I do make menuconfig
and select the module. Then I save the configuration and do make -1j V=sc
and the process fails with the following errors:
make[4]: Entering directory '/home/crave/Documents/openWrt/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.10.146'
HOSTCC scripts/basic/fixdep
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
HOSTCC scripts/dtc/dtc-lexer.lex.o
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/dtc/dtc
HOSTCC scripts/sorttable
scripts/sorttable.c:34:10: fatal error: tools/be_byteshift.h: No such file or directory
34 | #include <tools/be_byteshift.h>
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[5]: *** [scripts/Makefile.host:95: scripts/sorttable] Error 1
make[4]: *** [Makefile:1209: scripts] Error 2
make[4]: Leaving directory '/home/crave/Documents/openWrt/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.10.146'
make[3]: *** [Makefile:53: /home/crave/Documents/openWrt/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/qmi_wwan_q-1.2.2/.built] Error 2
make[3]: Leaving directory '/home/crave/Documents/openWrt/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/package/qmi_wwan_q'
time: package/qmi_wwan_q/compile#2.43#0.35#2.78
ERROR: package/qmi_wwan_q failed to build.
Do I need to include this header somehow? Is there anything else I need to do?
I appreciate any help