setup_usb_configfs: Make it possible to choose the used UDC

Some devices may have more than one UDC available.
This commit is contained in:
Sebastian Krzyszkowiak 2021-01-24 06:20:32 +01:00
parent 96439b1828
commit c9e92c9193
No known key found for this signature in database
GPG Key ID: E8F235CF3BDBC3FF

View File

@ -73,8 +73,12 @@ setup_usb_configfs() {
fatal_error "No USB Device Controller available"
fi
if [ -z "$UDC" ]; then
UDC="$(ls /sys/class/udc)"
fi
# shellcheck disable=SC2005
echo "$(ls /sys/class/udc)" > $CONFIGFS/g1/UDC || ( fatal_error "Couldn't write to UDC" )
echo "$UDC" > $CONFIGFS/g1/UDC || ( fatal_error "Couldn't write to UDC" )
}
setup_telnetd() {