【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
相关推荐
智慧化智能化数字化方案14 分钟前
华为IPD流程管理体系L1至L5最佳实践-解读
大数据·华为
PersistJiao1 小时前
在 Spark RDD 中,sortBy 和 top 算子的各自适用场景
大数据·spark·top·sortby
2301_811274312 小时前
大数据基于Spring Boot的化妆品推荐系统的设计与实现
大数据·spring boot·后端
Yz98762 小时前
hive的存储格式
大数据·数据库·数据仓库·hive·hadoop·数据库开发
青云交2 小时前
大数据新视界 -- 大数据大厂之 Hive 数据导入:多源数据集成的策略与实战(上)(3/ 30)
大数据·数据清洗·电商数据·数据整合·hive 数据导入·多源数据·影视娱乐数据
武子康2 小时前
大数据-230 离线数仓 - ODS层的构建 Hive处理 UDF 与 SerDe 处理 与 当前总结
java·大数据·数据仓库·hive·hadoop·sql·hdfs
武子康2 小时前
大数据-231 离线数仓 - DWS 层、ADS 层的创建 Hive 执行脚本
java·大数据·数据仓库·hive·hadoop·mysql
时差9532 小时前
Flink Standalone集群模式安装部署
大数据·分布式·flink·部署
锵锵锵锵~蒋2 小时前
实时数据开发 | 怎么通俗理解Flink容错机制,提到的checkpoint、barrier、Savepoint、sink都是什么
大数据·数据仓库·flink·实时数据开发
二进制_博客2 小时前
Flink学习连载文章4-flink中的各种转换操作
大数据·学习·flink