【RK3288 Android6 T2pro 支持移远和有方4G模块切换】

文章目录

【RK3288 Android6 T2pro 支持移远和有方4G模块切换】

需求

原来的UI板只支持 移远的4G模块,现在需要兼容移远和有方的4G模块

方案

通过修改user_services.sh,通过识别4G模块,来加载不同的ril 库文件

patch

device_rk3288

bash 复制代码
From 40caa97a2e0eff89ada4953cf71864f4d21e84d0 Mon Sep 17 00:00:00 2001
From: wugt <wugt@keenon.com>
Date: Thu, 14 Sep 2023 11:17:57 +0800
Subject: [PATCH 07/17] feat: compitible for lte module of EC20 and Neoway

Change-Id: I336733348476422bd167fd676a48a9ebba468567
Signed-off-by: wugt <wugt@keenon.com>
---
 init.rc                    |   2 +-
 init.t5pro.rc              |   2 +-
 neoway/libreference-ril.so | Bin 0 -> 198764 bytes
 rk3288.mk                  |   2 ++
 scripts/startup_rild.sh    |  51 +++++++++++++++++++++++++++++++++++++++++++++
 scripts/user_service.sh    |   2 +-
 6 files changed, 56 insertions(+), 3 deletions(-)
 create mode 100644 neoway/libreference-ril.so
 create mode 100644 scripts/startup_rild.sh

diff --git a/init.rc b/init.rc
index e5863b5..0833b57 100644
--- a/init.rc
+++ b/init.rc
@@ -604,7 +604,7 @@ service debuggerd /system/bin/debuggerd
 service debuggerd64 /system/bin/debuggerd64
     class main
 
-service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so
+service ril-daemon /system/bin/rild
     class main
     socket rild stream 660 root radio
     socket rild-debug stream 660 radio system
diff --git a/init.t5pro.rc b/init.t5pro.rc
index 762b184..7a79ca7 100644
--- a/init.t5pro.rc
+++ b/init.t5pro.rc
@@ -610,7 +610,7 @@ service debuggerd /system/bin/debuggerd
 service debuggerd64 /system/bin/debuggerd64
     class main
 
-service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so
+service ril-daemon /system/bin/rild
     class main
     socket rild stream 660 root radio
     socket rild-debug stream 660 radio system
diff --git a/neoway/libreference-ril.so b/neoway/libreference-ril.so
new file mode 100644
index 0000000000000000000000000000000000000000..12d29763dacd3bd4fcd3c4b730dde64de492293f
GIT binary patch

diff --git a/rk3288.mk b/rk3288.mk
index 332f255..a9e8b25 100644
--- a/rk3288.mk
+++ b/rk3288.mk
@@ -33,10 +33,12 @@ PRODUCT_COPY_FILES += device/rockchip/rk3288/scripts/common.sh:system/bin/common
 PRODUCT_COPY_FILES += device/rockchip/rk3288/scripts/save_log.sh:system/bin/save_log.sh
 PRODUCT_COPY_FILES += device/rockchip/rk3288/scripts/save_kmsg.sh:system/bin/save_kmsg.sh
 PRODUCT_COPY_FILES += device/rockchip/rk3288/scripts/network_debug_tool.sh:system/bin/network_debug_tool.sh
+PRODUCT_COPY_FILES += device/rockchip/rk3288/scripts/startup_rild.sh:system/bin/startup_rild.sh
 PRODUCT_COPY_FILES += device/rockchip/rk3288/EC20/libreference-ril.so:system/lib/libreference-ril.so
 PRODUCT_COPY_FILES += device/rockchip/rk3288/EC20/ip-down:system/etc/ppp/ip-down
 PRODUCT_COPY_FILES += device/rockchip/rk3288/EC20/ip-up:system/etc/ppp/ip-up
 PRODUCT_COPY_FILES += device/rockchip/rk3288/EC20/chat:system/bin/chat
+PRODUCT_COPY_FILES += device/rockchip/rk3288/neoway/libreference-ril.so:system/lib/libreference-ril-neoway.so
 
 # Get the long list of APNs
 PRODUCT_COPY_FILES += vendor/rockchip/common/phone/etc/apns-full-conf.xml:system/etc/apns-conf.xml
diff --git a/scripts/startup_rild.sh b/scripts/startup_rild.sh
new file mode 100644
index 0000000..7fb44be
--- /dev/null
+++ b/scripts/startup_rild.sh
@@ -0,0 +1,51 @@
+#!/system/bin/sh
+
+printlog() {
+    echo [`date`] "$@" >> /mnt/user_service.log
+}
+
+MODULE_EC20=EC20
+MODULE_NEOWAY=NEOWAY
+MODULE_DEFAULT=$MODULE_EC20
+NEOWAY_ID=2949:8700
+
+start() {
+    # check Neoway LTE module vid:pid
+    module_type=$MODULE_DEFAULT
+    lsusb |grep "${NEOWAY_ID}"
+    [ $? -eq 0 ] && module_type=$MODULE_NEOWAY
+
+    libpath_old=`getprop rild.libpath`
+    if [ "$module_type" = "$MODULE_NEOWAY" ]; then
+        libpath_new=/system/lib/libreference-ril-neoway.so
+        libargs="-d /dev/ttyACM1"
+    else
+        libpath_new=/system/lib/libreference-ril.so
+        libargs="-d /dev/ttyUSB2"
+    fi
+
+    printlog "libpath old:${libpath_old} new:${libpath_new}"
+    printlog "libargs:${libargs}"
+
+    path_changed=0
+    if [ "x${libpath_old}" != "x${libpath_new}" ]; then
+        setprop rild.libpath ${libpath_new}
+        setprop rild.libargs "${libargs}"
+        path_changed=1
+    fi
+
+    if [ "x$(pidof /system/bin/rild)" != "x" ]; then
+        if [ ${path_changed} -eq 0 ]; then
+            printlog "rild already started."
+            exit 0
+        fi
+        printlog "stop ril-daemon"
+        setprop ctl.stop ril-daemon
+        sleep 1
+    fi
+    printlog "start ril-daemon"
+    setprop ctl.start ril-daemon
+}
+
+start
+
diff --git a/scripts/user_service.sh b/scripts/user_service.sh
index 834f591..b02c1eb 100644
--- a/scripts/user_service.sh
+++ b/scripts/user_service.sh
@@ -1,6 +1,6 @@
 #!/system/bin/sh
 
-echo -e "AT+QCFG=\"dbgctl\",0\r\n" > /dev/ttyUSB2
+[ -f /dev/ttyUSB2 ] && echo -e "AT+QCFG=\"dbgctl\",0\r\n" > /dev/ttyUSB2
 lte_ifname="ppp0" # can be ppp0 or usb0
 
 printlog() {
-- 
2.7.4
bash 复制代码
From e1b48b3c282db724003457b33776d73e1bfcb834 Mon Sep 17 00:00:00 2001
From: wugt <wugt@keenon.com>
Date: Tue, 26 Sep 2023 10:32:54 +0800
Subject: [PATCH 08/17] update: update libreference-ril.so for neoway

Change-Id: Ifb83d0e9a18bf3906667365b62c17330ee56898c
Signed-off-by: wugt <wugt@keenon.com>
---
 neoway/libreference-ril.so | Bin 198764 -> 198764 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/neoway/libreference-ril.so b/neoway/libreference-ril.so
bash 复制代码
From 3f190d8546b8262a3d80f3c62cbb370e4e71a374 Mon Sep 17 00:00:00 2001
From: wugt <wugt@keenon.com>
Date: Mon, 9 Oct 2023 15:57:03 +0800
Subject: [PATCH 09/17] update: update for 4G

Change-Id: I82e34f9c95db0f1a07447cef4ecc9d059e2617dc
Signed-off-by: wugt <wugt@keenon.com>
---
 N720V5/libreference-ril.so | Bin 0 -> 198764 bytes
 neoway/libreference-ril.so | Bin 198764 -> 0 bytes
 rk3288.mk                  |   2 +-
 scripts/startup_rild.sh    |  79 +++++++++++++++++++++------------------------
 4 files changed, 38 insertions(+), 43 deletions(-)
 create mode 100644 N720V5/libreference-ril.so
 delete mode 100644 neoway/libreference-ril.so

diff --git a/N720V5/libreference-ril.so b/N720V5/libreference-ril.so
new file mode 100644

diff --git a/rk3288.mk b/rk3288.mk
index a9e8b25..55ee905 100644
--- a/rk3288.mk
+++ b/rk3288.mk
@@ -38,7 +38,7 @@ PRODUCT_COPY_FILES += device/rockchip/rk3288/EC20/libreference-ril.so:system/lib
 PRODUCT_COPY_FILES += device/rockchip/rk3288/EC20/ip-down:system/etc/ppp/ip-down
 PRODUCT_COPY_FILES += device/rockchip/rk3288/EC20/ip-up:system/etc/ppp/ip-up
 PRODUCT_COPY_FILES += device/rockchip/rk3288/EC20/chat:system/bin/chat
-PRODUCT_COPY_FILES += device/rockchip/rk3288/neoway/libreference-ril.so:system/lib/libreference-ril-neoway.so
+PRODUCT_COPY_FILES += device/rockchip/rk3288/N720V5/libreference-ril.so:system/lib/libreference-ril-N720V5.so
 
 # Get the long list of APNs
 PRODUCT_COPY_FILES += vendor/rockchip/common/phone/etc/apns-full-conf.xml:system/etc/apns-conf.xml
diff --git a/scripts/startup_rild.sh b/scripts/startup_rild.sh
index 7fb44be..5656b3f 100644
--- a/scripts/startup_rild.sh
+++ b/scripts/startup_rild.sh
@@ -5,47 +5,42 @@ printlog() {
 }
 
 MODULE_EC20=EC20
-MODULE_NEOWAY=NEOWAY
+MODULE_N720V5=N720V5
 MODULE_DEFAULT=$MODULE_EC20
-NEOWAY_ID=2949:8700
-
-start() {
-    # check Neoway LTE module vid:pid
-    module_type=$MODULE_DEFAULT
-    lsusb |grep "${NEOWAY_ID}"
-    [ $? -eq 0 ] && module_type=$MODULE_NEOWAY
-
-    libpath_old=`getprop rild.libpath`
-    if [ "$module_type" = "$MODULE_NEOWAY" ]; then
-        libpath_new=/system/lib/libreference-ril-neoway.so
-        libargs="-d /dev/ttyACM1"
-    else
-        libpath_new=/system/lib/libreference-ril.so
-        libargs="-d /dev/ttyUSB2"
-    fi
-
-    printlog "libpath old:${libpath_old} new:${libpath_new}"
-    printlog "libargs:${libargs}"
-
-    path_changed=0
-    if [ "x${libpath_old}" != "x${libpath_new}" ]; then
-        setprop rild.libpath ${libpath_new}
-        setprop rild.libargs "${libargs}"
-        path_changed=1
+N720V5_ID=2949:8700
+
+# check N720V5 LTE module vid:pid
+module_type=$MODULE_DEFAULT
+lsusb |grep "${N720V5_ID}"
+[ $? -eq 0 ] && module_type=$MODULE_N720V5
+
+libpath_old=`getprop rild.libpath`
+if [ "$module_type" = "$MODULE_N720V5" ]; then
+    libpath_new=/system/lib/libreference-ril-N720V5.so
+    libargs="-d /dev/ttyACM1"
+else
+    libpath_new=/system/lib/libreference-ril.so
+    libargs="-d /dev/ttyUSB2"
+fi
+
+printlog "libpath old:${libpath_old} new:${libpath_new}"
+printlog "libargs:${libargs}"
+
+path_changed=0
+if [ "x${libpath_old}" != "x${libpath_new}" ]; then
+    setprop rild.libpath ${libpath_new}
+    setprop rild.libargs "${libargs}"
+    path_changed=1
+fi
+
+if [ "x$(pidof /system/bin/rild)" != "x" ]; then
+    if [ ${path_changed} -eq 0 ]; then
+        printlog "rild already started."
+        exit 0
     fi
-
-    if [ "x$(pidof /system/bin/rild)" != "x" ]; then
-        if [ ${path_changed} -eq 0 ]; then
-            printlog "rild already started."
-            exit 0
-        fi
-        printlog "stop ril-daemon"
-        setprop ctl.stop ril-daemon
-        sleep 1
-    fi
-    printlog "start ril-daemon"
-    setprop ctl.start ril-daemon
-}
-
-start
-
+    printlog "stop ril-daemon"
+    setprop ctl.stop ril-daemon
+    sleep 1
+fi
+printlog "start ril-daemon"
+setprop ctl.start ril-daemon
-- 
2.7.4

kernel

这边主要是解决插上 有方的4G模块时不时的不生成usb设备的问题。

bash 复制代码
From ed119d032513136427d514ca566842d8c49da817 Mon Sep 17 00:00:00 2001
From: wugt <wugt@keenon.com>
Date: Mon, 9 Oct 2023 14:18:16 +0800
Subject: [PATCH] feat: disable usb ethernet created by neoway 4G module

Change-Id: I8dafacf1e21f042d3e5937e2c03ffe5a45d8aec9
Signed-off-by: wugt <wugt@keenon.com>
---
 arch/arm/configs/rockchip_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/configs/rockchip_defconfig b/arch/arm/configs/rockchip_defconfig
index 88c8c71..ebf14a0 100644
--- a/arch/arm/configs/rockchip_defconfig
+++ b/arch/arm/configs/rockchip_defconfig
@@ -286,7 +286,7 @@ CONFIG_USB_NET_SMSC95XX=y
 CONFIG_USB_NET_GL620A=y
 CONFIG_USB_NET_PLUSB=y
 CONFIG_USB_NET_MCS7830=y
-CONFIG_USB_NET_RNDIS_HOST=y
+# CONFIG_USB_NET_RNDIS_HOST is not set
 CONFIG_USB_ALI_M5632=y
 CONFIG_USB_AN2720=y
 CONFIG_USB_EPSON2888=y
-- 
2.7.4
相关推荐
武子康2 分钟前
大数据-212 数据挖掘 机器学习理论 - 无监督学习算法 KMeans 基本原理 簇内误差平方和
大数据·人工智能·学习·算法·机器学习·数据挖掘
lzhlizihang1 小时前
【Hive sql 面试题】求出各类型专利top 10申请人,以及对应的专利申请数(难)
大数据·hive·sql·面试题
Tianyanxiao1 小时前
如何利用探商宝精准营销,抓住行业机遇——以AI技术与大数据推动企业信息精准筛选
大数据·人工智能·科技·数据分析·深度优先·零售
大数据编程之光1 小时前
Hive 查询各类型专利 top10 申请人及专利申请数
大数据·数据仓库·hive·hadoop
GDDGHS_2 小时前
大数据工具 flume 的安装配置与使用 (详细版)
大数据·flume
Acrelhuang3 小时前
安科瑞5G基站直流叠光监控系统-安科瑞黄安南
大数据·数据库·数据仓库·物联网
皓7413 小时前
服饰电商行业知识管理的创新实践与知识中台的重要性
大数据·人工智能·科技·数据分析·零售
Mephisto.java3 小时前
【大数据学习 | kafka高级部分】kafka的kraft集群
大数据·sql·oracle·kafka·json·hbase
Mephisto.java3 小时前
【大数据学习 | kafka高级部分】kafka的文件存储原理
大数据·sql·oracle·kafka·json
筱源源3 小时前
Elasticsearch-linux环境部署
linux·elasticsearch