From a0be3febef2aab84a3bc6abf49c337ee6e484118 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Mon, 15 Jul 2024 17:27:43 +0800
Subject: [PATCH] Yocto:IGKBoard-All: Add rtl8188fu and rtl8723du USB WiFi module driver

---
 yocto/meta-igkboard/images/yocto-image-full.bb            |    1 
 yocto/meta-igkboard/recipes-kernel/rtl8188fu/rtl8188fu.bb |   37 ++++++++++++++++++
 yocto/meta-igkboard/recipes-kernel/rtl8723du/rtl8723du.bb |   30 +++++++++++++++
 3 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/yocto/meta-igkboard/images/yocto-image-full.bb b/yocto/meta-igkboard/images/yocto-image-full.bb
index a437d61..0401590 100644
--- a/yocto/meta-igkboard/images/yocto-image-full.bb
+++ b/yocto/meta-igkboard/images/yocto-image-full.bb
@@ -45,6 +45,7 @@
 
 CORE_IMAGE_EXTRA_INSTALL_BASE += " \
     kernel-modules hello-app hello-mod \
+    rtl8188fu rtl8723du \
     firmwared linux-firmware \
     powertop tzdata ppp vim \
     xz lrzsz rsync dos2unix \
diff --git a/yocto/meta-igkboard/recipes-kernel/rtl8188fu/rtl8188fu.bb b/yocto/meta-igkboard/recipes-kernel/rtl8188fu/rtl8188fu.bb
new file mode 100644
index 0000000..68b731e
--- /dev/null
+++ b/yocto/meta-igkboard/recipes-kernel/rtl8188fu/rtl8188fu.bb
@@ -0,0 +1,37 @@
+DESCRIPTION = "Realtek RTL8188FU USB Wi-Fi driver"
+
+LICENSE = "GPL-2.0-or-later"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-or-later;md5=fed54355545ffd980b814dab4a3b312c"
+
+# Git repository and branch
+SRC_URI = "git://github.com/kelebek333/rtl8188fu.git;branch=master;protocol=https"
+SRCREV = "${AUTOREV}"
+
+# Specify where the source files will be fetched to
+S = "${WORKDIR}/git"
+
+# Inherit the module class to handle kernel module compilation
+inherit module
+
+do_configure() {
+    sed -i 's|^ARCH.*|ARCH ?= arm|' ${S}/Makefile
+    sed -i 's|^CROSS_COMPILE.*|CROSS_COMPILE ?= ${TARGET_PREFIX}|' ${S}/Makefile
+    sed -i 's|^KVER.*|KVER ?= ${KERNEL_VERSION}|' ${S}/Makefile
+    sed -i 's|^KSRC.*|KSRC ?= ${STAGING_KERNEL_DIR}|' ${S}/Makefile
+}
+
+# Define the compile task
+do_compile() {
+    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+    oe_runmake all
+}
+
+# Define where to install the kernel module
+do_install() {
+    install -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra/
+    install -m 0644 ${S}/rtl8188fu.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra/
+}
+
+# Add the driver to the kernel modules list
+KERNEL_MODULE_PROBECONF = "rtl8188fu"
+
diff --git a/yocto/meta-igkboard/recipes-kernel/rtl8723du/rtl8723du.bb b/yocto/meta-igkboard/recipes-kernel/rtl8723du/rtl8723du.bb
new file mode 100644
index 0000000..d1c843c
--- /dev/null
+++ b/yocto/meta-igkboard/recipes-kernel/rtl8723du/rtl8723du.bb
@@ -0,0 +1,30 @@
+DESCRIPTION = "Realtek RTL8723DU USB Wi-Fi/BT driver"
+
+LICENSE = "GPL-2.0-or-later"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-or-later;md5=fed54355545ffd980b814dab4a3b312c"
+
+# Git repository and branch
+SRC_URI = "git://github.com/lwfinger/rtw88.git;branch=master;protocol=https"
+SRCREV = "${AUTOREV}"
+
+# Specify where the source files will be fetched to
+S = "${WORKDIR}/git"
+
+# Inherit the module class to handle kernel module compilation
+inherit module
+
+# Define the compile task
+do_compile() {
+    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+    oe_runmake all
+}
+
+# Define where to install the kernel module
+do_install() {
+    install -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra/
+    install -m 0644 ${S}/*.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra/
+}
+
+# Add the driver to the kernel modules list
+KERNEL_MODULE_PROBECONF = "rtw_8723du"
+

--
Gitblit v1.9.1