The imx8qxpc0mek kernel version is 188.8.131.52.3.3，the yocto version is 2.5.2.We wanted to use ADB in Linux, so we integrated with bitbake android-tools.However, we found that after the client established a connection with the device through adb shell, it was abnormal to switch to root permission by su command, and operations such as chmod cannot be performed under root permission.
The following are the adb.service in use and the adb.sh that starts the ADB service,What changes should be made to resolve the root permission exception
Description=adb start service
ExecStop=/bin/kill -s TERM $MAINPID
groupadd -g 2000 test
useradd -u 2000 -g soft3 -G testtom
modprobe g_ffs idVendor=0x18d1 idProduct=0xd002 iSerialNumber="test"
mkdir -p /dev/usb-ffs/adb
mount -t functionfs adb /dev/usb-ffs/adb -o uid=2000,gid=2000
Thanks & Regards,