tejado/android-usb-gadget

Add Function not working

wooilok123 opened this issue · 1 comments

Hi @tejado , I am currently using kernel version 4.4 on my device. Whenever I clicked on Keyboard and Mouse from 'Add Function to Gadget', there are nothing happened on my device. 'hid.panel' does not appeared after I added them, can you please check on this issue? thanks

ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS_ACTIVE=ncm.0
FUNCTIONS_ACTIVE=audio_source.0
FUNCTIONS_ACTIVE=accessory.0
FUNCTIONS_ACTIVE=midi.0
FUNCTIONS_ACTIVE=conn_gadget.0
FUNCTIONS_ACTIVE=dm.0
FUNCTIONS_ACTIVE=rndis.0
FUNCTIONS_ACTIVE=uts.0
FUNCTIONS_ACTIVE=acm.0
FUNCTIONS_ACTIVE=ptp.0
FUNCTIONS_ACTIVE=mtp.0
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: rm /config/usb_gadget/g1//configs/b.1//uts.0

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/ -name UDC -type f -exec sh -c 'echo "" > "$@"' _ {} ;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: rm /config/usb_gadget/g1//configs/b.1//rndis.0

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/ -name UDC -type f -exec sh -c 'echo "" > "$@"' _ {} ;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: rm /config/usb_gadget/g1//configs/b.1//ptp.0

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/ -name UDC -type f -exec sh -c 'echo "" > "$@"' _ {} ;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: rm /config/usb_gadget/g1//configs/b.1//ncm.0

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/ -name UDC -type f -exec sh -c 'echo "" > "$@"' _ {} ;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: rm /config/usb_gadget/g1//configs/b.1//midi.0

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/ -name UDC -type f -exec sh -c 'echo "" > "$@"' _ {} ;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: rm /config/usb_gadget/g1//configs/b.1//mtp.0

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/ -name UDC -type f -exec sh -c 'echo "" > "$@"' _ {} ;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: rm /config/usb_gadget/g1//configs/b.1//conn_gadget.0

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/ -name UDC -type f -exec sh -c 'echo "" > "$@"' _ {} ;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: rm /config/usb_gadget/g1//configs/b.1//audio_source.0

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/ -name UDC -type f -exec sh -c 'echo "" > "$@"' _ {} ;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: rm /config/usb_gadget/g1//configs/b.1//acm.0

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/ -name UDC -type f -exec sh -c 'echo "" > "$@"' _ {} ;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: rm /config/usb_gadget/g1//configs/b.1//accessory.0

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/ -name UDC -type f -exec sh -c 'echo "" > "$@"' _ {} ;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: rm /config/usb_gadget/g1//configs/b.1//dm.0

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/ -name UDC -type f -exec sh -c 'echo "" > "$@"' _ {} ;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) -
ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: #!/bin/sh

GADGET="keyboard"
GADGET_PATH="/config/usb_gadget/g1/"

cd $GADGET_PATH/configs/
CONFIG_PATH="$GADGET_PATH/configs/ls -1 | head -1/"
STRINGS_PATH="$GADGET_PATH/strings/0x409/"

mkdir -p $GADGET_PATH/functions/hid.keyboard
cd $GADGET_PATH/functions/hid.keyboard

HID protocol (according to USB spec: 1 for keyboard)

echo 1 > protocol

device subclass

echo 1 > subclass

number of bytes per record

echo 8 > report_length

writing report descriptor

echo -ne \x05\x01\x09\x06\xa1\x01\x05\x07\x19\xe0\x29\xe7\x15\x00\x25\x01\x75\x01\x95\x08\x81\x02\x95\x01\x75\x08\x81\x03\x95\x05\x75\x01\x05\x08\x19\x01\x29\x05\x91\x02\x95\x01\x75\x03\x91\x03\x95\x06\x75\x08\x15\x00\x25\x65\x05\x07\x19\x00\x29\x65\x81\x00\xc0 > report_desc

ln -s ${GADGET_PATH}/functions/hid.keyboard $CONFIG_PATH/hid.keyboard

ROOT (stdout) -
ROOT (stderr) - mkdir: '/config/usb_gadget/g1//functions/hid.keyboard': No such file or directory
: [12]: cd: /config/usb_gadget/g1/functions/hid.keyboard: No such file or directory
: [15]: can't create protocol: Permission denied
: [17]: can't create subclass: Permission denied
: [19]: can't create report_length: Permission denied
: [22]: can't create report_desc: Permission denied
ln: cannot create symbolic link from '/config/usb_gadget/g1//functions/hid.keyboard' to '/config/usb_gadget/g1//configs/b.1//hid.keyboard': No such file or directory
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: #!/bin/sh

GADGET="mouse"
GADGET_PATH="/config/usb_gadget/g1/"

cd $GADGET_PATH/configs/
CONFIG_PATH="$GADGET_PATH/configs/ls -1 | head -1/"
STRINGS_PATH="$GADGET_PATH/strings/0x409/"

mkdir -p $GADGET_PATH/functions/hid.mouse
cd $GADGET_PATH/functions/hid.mouse

HID protocol (according to USB spec: 2 for mouse)

echo 2 > protocol

device subclass

echo 1 > subclass

number of bytes per record

echo 4 > report_length

writing report descriptor

echo -ne \x05\x01\x09\x02\xa1\x01\x09\x01\xa1\x00\x05\x09\x19\x01\x29\x05\x15\x00\x25\x01\x95\x05\x75\x01\x81\x02\x95\x01\x75\x03\x81\x01\x05\x01\x09\x30\x09\x31\x09\x38\x15\x81\x25\x7F\x75\x08\x95\x03\x81\x06\xc0\xc0 > report_desc

ln -s ${GADGET_PATH}/functions/hid.mouse $CONFIG_PATH/hid.mouse

ROOT (stdout) -
ROOT (stderr) - mkdir: '/config/usb_gadget/g1//functions/hid.mouse': No such file or directory
: [12]: cd: /config/usb_gadget/g1/functions/hid.mouse: No such file or directory
: [15]: can't create protocol: Permission denied
: [17]: can't create subclass: Permission denied
: [19]: can't create report_length: Permission denied
: [22]: can't create report_desc: Permission denied
ln: cannot create symbolic link from '/config/usb_gadget/g1//functions/hid.mouse' to '/config/usb_gadget/g1//configs/b.1//hid.mouse': No such file or directory
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
ROOT - Execute command: echo KERNEL_VERSION=(uname -r |cut -d '-' -f1 ) && (gunzip -c /proc/config.gz | grep -i configfs | sed 's/# //; s/ is not set/=NOT_SET/')

ROOT (stdout) - KERNEL_VERSION=4.4.177
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_SERIAL=NOT_SET
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=NOT_SET
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=NOT_SET
CONFIG_USB_CONFIGFS_ECM_SUBSET=NOT_SET
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=NOT_SET
CONFIG_USB_CONFIGFS_PHONET=NOT_SET
CONFIG_USB_CONFIGFS_MASS_STORAGE=NOT_SET
CONFIG_USB_CONFIGFS_F_LB_SS=NOT_SET
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_DM=y
CONFIG_USB_CONFIGFS_F_ADB=y
CONFIG_USB_CONFIGFS_F_MTP=y
CONFIG_USB_CONFIGFS_F_PTP=y
CONFIG_USB_CONFIGFS_F_CONN_GADGET=y
CONFIG_USB_CONFIGFS_F_ACC=y
CONFIG_USB_CONFIGFS_F_AUDIO_SRC=y
CONFIG_USB_CONFIGFS_UEVENT=y
CONFIG_USB_CONFIGFS_F_UAC1=NOT_SET
CONFIG_USB_CONFIGFS_F_UAC2=NOT_SET
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_HID=NOT_SET
CONFIG_USB_CONFIGFS_F_UVC=NOT_SET
CONFIG_USB_CONFIGFS_F_PRINTER=NOT_SET
CONFIG_CONFIGFS_FS=y

ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: #!/bin/sh

GADGET="ccid"
GADGET_PATH="/config/usb_gadget/g1/"

cd $GADGET_PATH/configs/
CONFIG_PATH="$GADGET_PATH/configs/ls -1 | head -1/"
STRINGS_PATH="$GADGET_PATH/strings/0x409/"

mkdir -p $GADGET_PATH/functions/ccid.usb0
cd $GADGET_PATH/functions/ccid.usb0

ln -s ${GADGET_PATH}/functions/ccid.usb0 $CONFIG_PATH/ccid.usb0

ROOT (stdout) -
ROOT (stderr) - mkdir: '/config/usb_gadget/g1//functions/ccid.usb0': No such file or directory
: [12]: cd: /config/usb_gadget/g1/functions/ccid.usb0: No such file or directory
ln: cannot create symbolic link from '/config/usb_gadget/g1//functions/ccid.usb0' to '/config/usb_gadget/g1//configs/b.1//ccid.usb0': No such file or directory
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: #!/bin/sh

GADGET="keyboard"
GADGET_PATH="/config/usb_gadget/g1/"

cd $GADGET_PATH/configs/
CONFIG_PATH="$GADGET_PATH/configs/ls -1 | head -1/"
STRINGS_PATH="$GADGET_PATH/strings/0x409/"

mkdir -p $GADGET_PATH/functions/hid.keyboard
cd $GADGET_PATH/functions/hid.keyboard

HID protocol (according to USB spec: 1 for keyboard)

echo 1 > protocol

device subclass

echo 1 > subclass

number of bytes per record

echo 8 > report_length

writing report descriptor

echo -ne \x05\x01\x09\x06\xa1\x01\x05\x07\x19\xe0\x29\xe7\x15\x00\x25\x01\x75\x01\x95\x08\x81\x02\x95\x01\x75\x08\x81\x03\x95\x05\x75\x01\x05\x08\x19\x01\x29\x05\x91\x02\x95\x01\x75\x03\x91\x03\x95\x06\x75\x08\x15\x00\x25\x65\x05\x07\x19\x00\x29\x65\x81\x00\xc0 > report_desc

ln -s ${GADGET_PATH}/functions/hid.keyboard $CONFIG_PATH/hid.keyboard

ROOT (stdout) -
ROOT (stderr) - mkdir: '/config/usb_gadget/g1//functions/hid.keyboard': No such file or directory
: [12]: cd: /config/usb_gadget/g1/functions/hid.keyboard: No such file or directory
: [15]: can't create protocol: Permission denied
: [17]: can't create subclass: Permission denied
: [19]: can't create report_length: Permission denied
: [22]: can't create report_desc: Permission denied
ln: cannot create symbolic link from '/config/usb_gadget/g1//functions/hid.keyboard' to '/config/usb_gadget/g1//configs/b.1//hid.keyboard': No such file or directory
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
ROOT - Execute command: #!/bin/sh

CONFIGFS_DIR="/config"
GADGETS_PATH="${CONFIGFS_DIR}/usb_gadget"

GADGET="keyboard"
GADGET_PATH=${GADGETS_PATH}/${GADGET}

CONFIG_PATH="$GADGET_PATH/configs/c.1/"
STRINGS_PATH="$GADGET_PATH/strings/0x409/"

mkdir -p $CONFIG_PATH
mkdir -p $STRINGS_PATH

mkdir -p $GADGET_PATH/functions/hid.keyboard
cd $GADGET_PATH/functions/hid.keyboard

HID protocol (according to USB spec: 1 for keyboard)

echo 1 > protocol

device subclass

echo 1 > subclass

number of bytes per record

echo 8 > report_length

writing report descriptor

echo -ne \x05\x01\x09\x06\xa1\x01\x05\x07\x19\xe0\x29\xe7\x15\x00\x25\x01\x75\x01\x95\x08\x81\x02\x95\x01\x75\x08\x81\x03\x95\x05\x75\x01\x05\x08\x19\x01\x29\x05\x91\x02\x95\x01\x75\x03\x91\x03\x95\x06\x75\x08\x15\x00\x25\x65\x05\x07\x19\x00\x29\x65\x81\x00\xc0 > report_desc

mkdir -p $GADGET_PATH/functions/hid.mouse
cd $GADGET_PATH/functions/hid.mouse

HID protocol (according to USB spec: 2 for mouse)

echo 2 > protocol

device subclass

echo 1 > subclass

number of bytes per record

echo 4 > report_length

writing report descriptor

echo -ne \x05\x01\x09\x02\xa1\x01\x09\x01\xa1\x00\x05\x09\x19\x01\x29\x05\x15\x00\x25\x01\x95\x05\x75\x01\x81\x02\x95\x01\x75\x03\x81\x01\x05\x01\x09\x30\x09\x31\x09\x38\x15\x81\x25\x7F\x75\x08\x95\x03\x81\x06\xc0\xc0 > report_desc

cd $GADGET_PATH
echo 0x046a > idVendor
echo 0x002a > idProduct

cd $STRINGS_PATH
echo "tejado" > manufacturer
echo "Android USB Gadget" > product
echo "42" > serialnumber

cd $CONFIG_PATH
echo 120 > MaxPower
echo "Configuration" > strings/0x409/configuration

ln -s ${GADGET_PATH}/functions/hid.keyboard $CONFIG_PATH/hid.keyboard
ln -s ${GADGET_PATH}/functions/hid.mouse $CONFIG_PATH/hid.mouse

ROOT (stdout) -
ROOT (stderr) - mkdir: '/config/usb_gadget/keyboard': Out of memory
mkdir: '/config/usb_gadget/keyboard': Out of memory
mkdir: '/config/usb_gadget/keyboard': Out of memory
: [16]: cd: /config/usb_gadget/keyboard/functions/hid.keyboard: No such file or directory
: [19]: can't create protocol: Read-only file system
: [21]: can't create subclass: Read-only file system
: [23]: can't create report_length: Read-only file system
: [26]: can't create report_desc: Read-only file system
mkdir: '/config/usb_gadget/keyboard': Out of memory
: [29]: cd: /config/usb_gadget/keyboard/functions/hid.mouse: No such file or directory
: [32]: can't create protocol: Read-only file system
: [34]: can't create subclass: Read-only file system
: [36]: can't create report_length: Read-only file system
: [39]: can't create report_desc: Read-only file system
: [42]: cd: /config/usb_gadget/keyboard: No such file or directory
: [43]: can't create idVendor: Read-only file system
: [44]: can't create idProduct: Read-only file system
: [46]: cd: /config/usb_gadget/keyboard/strings/0x409: No such file or directory
: [47]: can't create manufacturer: Read-only file system
: [48]: can't create product: Is a directory
: [49]: can't create serialnumber: Read-only file system
: [51]: cd: /config/usb_gadget/keyboard/configs/c.1: No such file or directory
: [52]: can't create MaxPower: Read-only file system
: [53]: can't create strings/0x409/configuration: No such file or directory
ln: cannot create symbolic link from '/config/usb_gadget/keyboard/functions/hid.keyboard' to '/config/usb_gadget/keyboard/configs/c.1//hid.keyboard': No such file or directory
ln: cannot create symbolic link from '/config/usb_gadget/keyboard/functions/hid.mouse' to '/config/usb_gadget/keyboard/configs/c.1//hid.mouse': No such file or directory
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: #!/bin/sh

GADGET="keyboard"
GADGET_PATH="/config/usb_gadget/g1/"

cd $GADGET_PATH/configs/
CONFIG_PATH="$GADGET_PATH/configs/ls -1 | head -1/"
STRINGS_PATH="$GADGET_PATH/strings/0x409/"

mkdir -p $GADGET_PATH/functions/hid.keyboard
cd $GADGET_PATH/functions/hid.keyboard

HID protocol (according to USB spec: 1 for keyboard)

echo 1 > protocol

device subclass

echo 1 > subclass

number of bytes per record

echo 8 > report_length

writing report descriptor

echo -ne \x05\x01\x09\x06\xa1\x01\x05\x07\x19\xe0\x29\xe7\x15\x00\x25\x01\x75\x01\x95\x08\x81\x02\x95\x01\x75\x08\x81\x03\x95\x05\x75\x01\x05\x08\x19\x01\x29\x05\x91\x02\x95\x01\x75\x03\x91\x03\x95\x06\x75\x08\x15\x00\x25\x65\x05\x07\x19\x00\x29\x65\x81\x00\xc0 > report_desc

ln -s ${GADGET_PATH}/functions/hid.keyboard $CONFIG_PATH/hid.keyboard

ROOT (stdout) -
ROOT (stderr) - mkdir: '/config/usb_gadget/g1//functions/hid.keyboard': No such file or directory
: [12]: cd: /config/usb_gadget/g1/functions/hid.keyboard: No such file or directory
: [15]: can't create protocol: Permission denied
: [17]: can't create subclass: Permission denied
: [19]: can't create report_length: Permission denied
: [22]: can't create report_desc: Permission denied
ln: cannot create symbolic link from '/config/usb_gadget/g1//functions/hid.keyboard' to '/config/usb_gadget/g1//configs/b.1//hid.keyboard': No such file or directory
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: echo "" > /config/usb_gadget/g1//UDC

ROOT (stdout) -
ROOT (stderr) -
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: #!/bin/sh

GADGET="keyboard"
GADGET_PATH="/config/usb_gadget/g1/"

cd $GADGET_PATH/configs/
CONFIG_PATH="$GADGET_PATH/configs/ls -1 | head -1/"
STRINGS_PATH="$GADGET_PATH/strings/0x409/"

mkdir -p $GADGET_PATH/functions/hid.keyboard
cd $GADGET_PATH/functions/hid.keyboard

HID protocol (according to USB spec: 1 for keyboard)

echo 1 > protocol

device subclass

echo 1 > subclass

number of bytes per record

echo 8 > report_length

writing report descriptor

echo -ne \x05\x01\x09\x06\xa1\x01\x05\x07\x19\xe0\x29\xe7\x15\x00\x25\x01\x75\x01\x95\x08\x81\x02\x95\x01\x75\x08\x81\x03\x95\x05\x75\x01\x05\x08\x19\x01\x29\x05\x91\x02\x95\x01\x75\x03\x91\x03\x95\x06\x75\x08\x15\x00\x25\x65\x05\x07\x19\x00\x29\x65\x81\x00\xc0 > report_desc

ln -s ${GADGET_PATH}/functions/hid.keyboard $CONFIG_PATH/hid.keyboard

ROOT (stdout) -
ROOT (stderr) - mkdir: '/config/usb_gadget/g1//functions/hid.keyboard': No such file or directory
: [12]: cd: /config/usb_gadget/g1/functions/hid.keyboard: No such file or directory
: [15]: can't create protocol: Permission denied
: [17]: can't create subclass: Permission denied
: [19]: can't create report_length: Permission denied
: [22]: can't create report_desc: Permission denied
ln: cannot create symbolic link from '/config/usb_gadget/g1//functions/hid.keyboard' to '/config/usb_gadget/g1//configs/b.1//hid.keyboard': No such file or directory
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: #!/bin/sh

GADGET="mouse"
GADGET_PATH="/config/usb_gadget/g1/"

cd $GADGET_PATH/configs/
CONFIG_PATH="$GADGET_PATH/configs/ls -1 | head -1/"
STRINGS_PATH="$GADGET_PATH/strings/0x409/"

mkdir -p $GADGET_PATH/functions/hid.mouse
cd $GADGET_PATH/functions/hid.mouse

HID protocol (according to USB spec: 2 for mouse)

echo 2 > protocol

device subclass

echo 1 > subclass

number of bytes per record

echo 4 > report_length

writing report descriptor

echo -ne \x05\x01\x09\x02\xa1\x01\x09\x01\xa1\x00\x05\x09\x19\x01\x29\x05\x15\x00\x25\x01\x95\x05\x75\x01\x81\x02\x95\x01\x75\x03\x81\x01\x05\x01\x09\x30\x09\x31\x09\x38\x15\x81\x25\x7F\x75\x08\x95\x03\x81\x06\xc0\xc0 > report_desc

ln -s ${GADGET_PATH}/functions/hid.mouse $CONFIG_PATH/hid.mouse

ROOT (stdout) -
ROOT (stderr) - mkdir: '/config/usb_gadget/g1//functions/hid.mouse': No such file or directory
: [12]: cd: /config/usb_gadget/g1/functions/hid.mouse: No such file or directory
: [15]: can't create protocol: Permission denied
: [17]: can't create subclass: Permission denied
: [19]: can't create report_length: Permission denied
: [22]: can't create report_desc: Permission denied
ln: cannot create symbolic link from '/config/usb_gadget/g1//functions/hid.mouse' to '/config/usb_gadget/g1//configs/b.1//hid.mouse': No such file or directory
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/ls -1 | head -1/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done;

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=13600000.dwc3
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.0
FUNCTIONS=acm.0
FUNCTIONS=audio_source.0
FUNCTIONS=conn_gadget.0
FUNCTIONS=dm.0
FUNCTIONS=ffs.adb
FUNCTIONS=midi.0
FUNCTIONS=mtp.0
FUNCTIONS=ncm.0
FUNCTIONS=ptp.0
FUNCTIONS=rndis.0
FUNCTIONS=uts.0
manufacturer=SAMSUNG
product=SAMSUNG_Android
serialnumber=R58M35R5X6Z

ROOT (stderr) -
ROOT - Execute command: echo KERNEL_VERSION=(uname -r |cut -d '-' -f1 ) && (gunzip -c /proc/config.gz | grep -i configfs | sed 's/# //; s/ is not set/=NOT_SET/')

ROOT (stdout) - KERNEL_VERSION=4.4.177
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_SERIAL=NOT_SET
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=NOT_SET
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=NOT_SET
CONFIG_USB_CONFIGFS_ECM_SUBSET=NOT_SET
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=NOT_SET
CONFIG_USB_CONFIGFS_PHONET=NOT_SET
CONFIG_USB_CONFIGFS_MASS_STORAGE=NOT_SET
CONFIG_USB_CONFIGFS_F_LB_SS=NOT_SET
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_DM=y
CONFIG_USB_CONFIGFS_F_ADB=y
CONFIG_USB_CONFIGFS_F_MTP=y
CONFIG_USB_CONFIGFS_F_PTP=y
CONFIG_USB_CONFIGFS_F_CONN_GADGET=y
CONFIG_USB_CONFIGFS_F_ACC=y
CONFIG_USB_CONFIGFS_F_AUDIO_SRC=y
CONFIG_USB_CONFIGFS_UEVENT=y
CONFIG_USB_CONFIGFS_F_UAC1=NOT_SET
CONFIG_USB_CONFIGFS_F_UAC2=NOT_SET
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_HID=NOT_SET
CONFIG_USB_CONFIGFS_F_UVC=NOT_SET
CONFIG_USB_CONFIGFS_F_PRINTER=NOT_SET
CONFIG_CONFIGFS_FS=y

ROOT (stderr) -