#!/bin/sh $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 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" . "$MODPATH/utils.sh" . "$MODPATH/flash_script.sh"