From 87f13e129e93e07de3d2b8759bd6f6a49ae92ad3 Mon Sep 17 00:00:00 2001 From: duhow Date: Thu, 19 Dec 2024 13:01:26 +0100 Subject: [PATCH] patch: disable adb by default to skip usb0 nic --- patches/28_disable_adb_custom.patch | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 patches/28_disable_adb_custom.patch diff --git a/patches/28_disable_adb_custom.patch b/patches/28_disable_adb_custom.patch new file mode 100644 index 0000000..60a8401 --- /dev/null +++ b/patches/28_disable_adb_custom.patch @@ -0,0 +1,50 @@ +# When starting adb, this creates a new NETWORK device +# named usb0 . +# This NIC every time has a new MAC address, +# and when starting service applications which look for MAC, +# the MAC reported will be different. +# This causes that Shairport-sync (AirPlay), Snapcast, Squeezelite +# will show different device entries each time the speaker +# is restarted. +# L09A would always use ADB. +# LX06 would use ADB if image is not "release" (custom). +# We set to disable ADB by default, except if file exists. +--- a/etc/init.d/adbd 2021-06-28 04:23:39.000000000 +0200 ++++ b/etc/init.d/adbd 2024-12-19 12:41:51.804563161 +0100 +@@ -61,10 +61,6 @@ + } + + start(){ +- channel=`/sbin/uci -q get /usr/share/mico/version.version.CHANNEL` +- if [ "$channel" = "release" ]; then +- return 0 +- fi + start_usbgadget & + } + +--- a/etc/init.d/adbd 2018-10-11 03:14:23.000000000 +0200 ++++ b/etc/init.d/adbd 2024-12-19 12:58:33.032478316 +0100 +@@ -9,11 +9,7 @@ + OOM_ADJ=-17 + + start_service() { +- channel=`/sbin/uci -q get /usr/share/mico/version.version.CHANNEL` +- if [ "$channel" = "release" ]; then +- return 0 +- fi +- ++ if [ ! -f "/data/adb_enable" ]; then return 0 ; fi + sn=`imiflash get sn | awk -F/ '{print $2}'` + adb_id=${sn:$((${#sn}-8))} + if [ "x$adb_id" == "x" ]; then + +--- a/etc/init.d/adbd 2021-06-28 04:23:39.000000000 +0200 ++++ b/etc/init.d/adbd 2024-12-19 12:48:34.205439525 +0100 +@@ -61,6 +61,7 @@ + } + + start(){ ++ if [ ! -f "/data/adb_enable" ]; then return 0 ; fi + start_usbgadget & + } +