Skip to content

Unable to enable FUNCTION, errors occurredΒ #55

@suixinex

Description

@suixinex

The following is the complete log

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=11201000.usb0
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs0
FUNCTIONS=acm.gs1
FUNCTIONS=acm.gs2
FUNCTIONS=acm.gs3
FUNCTIONS=audio_source.gs3
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=hid.gs0
FUNCTIONS=mass_storage.usb0
FUNCTIONS=midi.gs5
FUNCTIONS=mtk_rndis.gs4
FUNCTIONS=via_atc.gs0
FUNCTIONS=via_ets.gs0
FUNCTIONS=via_modem.gs0
manufacturer=Xiaomi
product=Redmi K50
serialnumber=RWFAVOZTTC8PCMZ9
=============

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=5.10.209
CONFIG_PCI_ENDPOINT_CONFIGFS=NOT_SET
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_UEVENT=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=NOT_SET
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=NOT_SET
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_LB_SS=NOT_SET
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_ACC=y
CONFIG_USB_CONFIGFS_F_AUDIO_SRC=y
CONFIG_USB_CONFIGFS_F_UAC1=NOT_SET
CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=NOT_SET
CONFIG_USB_CONFIGFS_F_UAC2=y
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_CONFIGFS_F_UVC=y
CONFIG_USB_CONFIGFS_F_PRINTER=NOT_SET
CONFIG_IIO_CONFIGFS=NOT_SET
CONFIG_CONFIGFS_FS=y

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) - ln: cannot create symbolic link from '/config/usb_gadget/g1//functions/hid.keyboard' to '/config/usb_gadget/g1//configs/b.1//hid.keyboard': Invalid argument
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=11201000.usb0
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs0
FUNCTIONS=acm.gs1
FUNCTIONS=acm.gs2
FUNCTIONS=acm.gs3
FUNCTIONS=audio_source.gs3
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=hid.gs0
FUNCTIONS=hid.keyboard
FUNCTIONS=mass_storage.usb0
FUNCTIONS=midi.gs5
FUNCTIONS=mtk_rndis.gs4
FUNCTIONS=via_atc.gs0
FUNCTIONS=via_ets.gs0
FUNCTIONS=via_modem.gs0
manufacturer=Xiaomi
product=Redmi K50
serialnumber=RWFAVOZTTC8PCMZ9
=============

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) - ln: cannot create symbolic link from '/config/usb_gadget/g1//functions/hid.mouse' to '/config/usb_gadget/g1//configs/b.1//hid.mouse': Invalid argument
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=11201000.usb0
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs0
FUNCTIONS=acm.gs1
FUNCTIONS=acm.gs2
FUNCTIONS=acm.gs3
FUNCTIONS=audio_source.gs3
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=hid.gs0
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
FUNCTIONS=mass_storage.usb0
FUNCTIONS=midi.gs5
FUNCTIONS=mtk_rndis.gs4
FUNCTIONS=via_atc.gs0
FUNCTIONS=via_ets.gs0
FUNCTIONS=via_modem.gs0
manufacturer=Xiaomi
product=Redmi K50
serialnumber=RWFAVOZTTC8PCMZ9
=============

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: ln -s /config/usb_gadget/g1//functions/hid.keyboard /config/usb_gadget/g1//configs/b.1//hid.keyboard

ROOT (stdout) - 
ROOT (stderr) - ln: cannot create symbolic link from '/config/usb_gadget/g1//functions/hid.keyboard' to '/config/usb_gadget/g1//configs/b.1//hid.keyboard': Invalid argument
GadgetShellApi - Gadget Path is valid
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: ln -s /config/usb_gadget/g1//functions/hid.mouse /config/usb_gadget/g1//configs/b.1//hid.mouse

ROOT (stdout) - 
ROOT (stderr) - ln: cannot create symbolic link from '/config/usb_gadget/g1//functions/hid.mouse' to '/config/usb_gadget/g1//configs/b.1//hid.mouse': Invalid argument

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions