This commit is contained in:
Miguel Fuertes committed 2025-09-23 15:26:14 +02:00
1 parent 4fecfef0f3
commit ecb0633d1a
1 file changed
+7 -35
@@ -1,43 +1,15 @@
#!/bin/sh /etc/rc.common
# MSM8916 USB gadget service (procd)
START=95
USE_PROCD=1
START=98
STOP=10
PROG="/etc/msm8916-usb-gadget.sh"
EXTRA_COMMANDS="status reload"
EXTRA_HELP="status Show gadget status
reload Recreate gadget with new config"
start_service() {
local sh="/bin/bash"
[ -x "$sh" ] || sh="/bin/sh"
procd_open_instance
procd_set_param command "$sh" "$PROG" start
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param type oneshot
procd_set_param file /etc/msm8916-usb-gadget.conf
procd_close_instance
procd_open_instance
procd_set_param command /bin/sh /etc/msm8916-usb-gadget.sh start
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
stop_service() {
local sh="/bin/bash"
[ -x "$sh" ] || sh="/bin/sh"
"$sh" "$PROG" stop 2>/dev/null || true
}
reload_service() {
local sh="/bin/bash"
[ -x "$sh" ] || sh="/bin/sh"
"$sh" "$PROG" restart
}
status() {
local sh="/bin/bash"
[ -x "$sh" ] || sh="/bin/sh"
"$sh" "$PROG" status
/bin/sh /etc/msm8916-usb-gadget.sh stop 2>/dev/null || true
}