Edge2 - Wifi, USB Not Working

Hi

When building Android 13 ‘user’ firmware with
BOARD_SELINUX_ENFORCING := true and removing root, su
then the USB ports and wifi doesn’t work.
Wifi can see the networks but can’t connect.
I also removed the kernel and system SELInux always open commits.

Anyway to solve it and build a secure ‘user’ firmware?

I sent a DM with firmware.

@goenjoy @xiong.zhang

Hi @mo123 Is it normal to use the userdebug version?
The user version needs to modify the Te file and add relevant selinux permissions.

@william.lin
Hi, if you can perhaps find a solution for Selinux USB & Wifi, it might be the better option. User firmware provides better compatibility for apps and certain apps also check userdebug or root and then don’t run. User also has better security than userdebug. If possible also test Android 14 ‘user’ firmware, I want to move to it when available instead of building Android 13.

I plan to release custom, optimized firmware on the forum.

@mo123
Okay, we will test this issue on Android 14.

@william.lin

Please also test mp4 bootvideo on Android 14 ‘user’ instead of ‘userdebug’ firmware. Bootvideo doesn’t work on Android 13 ‘user’ firmware, also some selinux problem.

@william.lin Is this perhaps fixed in Android 14?

@william.lin
The USB and Wifi is still not working on Android 14 ‘user’ firmware.
Can the SELinux changes be added to fix it?

@xiong.zhang ,
Please follow up.

@mo123 @xiong.zhang When compiling the user version, the following submission did not take effect, resulting in the USB-HOST 5V not being activated. Causing USB and WiFi to malfunction.

    A10-3588: enable vcc5v0_host

--- a/rootdir/init.rk30board.rc
+++ b/rootdir/init.rk30board.rc
@@ -19,6 +19,7 @@ on post-fs-data
 
 on init
     # set temperature control policy as normal mode
+       write /sys/kernel/debug/regulator/vcc5v0_host/enable 1
     write /sys/module/rockchip_pm/parameters/policy 1

For now, provide a temporary and effective solution. Simply submit and restore it below.

kernel-5.10$ git log -p 

    USB3.0: fix USB3.0 U-disk cannot work at USB3.0 for plug in and start up [1/2]
 
diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts b/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
index 1a9b0cc6fb7b..609046b2adcf 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
@@ -88,8 +88,6 @@
        vcc5v0_host: vcc5v0-host {
                compatible = "regulator-fixed";
                regulator-name = "vcc5v0_host";
-               regulator-boot-on;
-               regulator-always-on;
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
                enable-active-high;
@@ -711,13 +709,7 @@
        rockchip,typec-vbus-det;
 };
 
-&u2phy2_host {
-       phy-supply = <&vcc5v0_host>;
-};
 
-&u2phy3_host {
-       phy-supply = <&vcc5v0_host>;
-};

@goenjoy I will try.

Do you know how to set a different default screensaver in ‘user’ firmware?
frameworks/base/core/res/res/values/config.xml
com.android.dreams.basic/com.android.dreams.basic.Colors

It works on A14 ‘userdebug’ firmware but on ‘user’ firmware it has no effect and sets no default screensaver.

@mo123 Compiling the user version did not generate the /sys/kernel/debug node, resulting in the inability to turn on 5V.
Restoring the previous modifications, the following is the final effective solution:

--- a/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
 
+&u2phy3_host {
+       phy-supply = <&vcc5v0_host>;
+};

 &uart9 {
        status = "okay";

It is working, thanks.