2020-03-03 15:31:32 -08:00
|
|
|
#!/bin/sh
|
2021-04-18 14:27:01 -07:00
|
|
|
$BOOTMODE || abort "! must be installed in the running system"
|
|
|
|
if [[ -e /proc/config.gz ]]; then
|
|
|
|
zcat /proc/config.gz | grep -Eq 'CONFIG_USB_(CONFIGFS_)?F_HID=[my]' || abort "! kernel does not have the required modules"
|
|
|
|
else
|
|
|
|
[[ -d /config/usb_gadget ]] || abort "! kernel does not have the required modules"
|
|
|
|
mkdir /config/usb_gadget/g1 || abort "! kernel does not have the required modules"
|
|
|
|
mkdir /config/usb_gadget/g1/functions/hid.usb0 || abort "! kernel does not have the required modules"
|
|
|
|
fi
|
2020-03-04 12:35:05 -08:00
|
|
|
chmod 755 "$MODPATH/system/bin/ghid.sh"
|
|
|
|
sed "s@\[MODDIR\]@$MODPATH@g" "$MODPATH/system/bin/ghid.sh" | sed 's/modules_update/modules/g' >"$TMPDIR/ghid.sh"
|
|
|
|
cp "$TMPDIR/ghid.sh" "$MODPATH/system/bin/ghid.sh"
|
2020-03-03 15:31:32 -08:00
|
|
|
|
2021-04-18 14:27:01 -07:00
|
|
|
. "$MODPATH/utils.sh"
|
|
|
|
. "$MODPATH/flash_script.sh"
|