magisk-ghid/customize.sh

16 lines
805 B
Bash
Raw Normal View History

#!/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
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"
2021-04-18 14:27:01 -07:00
. "$MODPATH/utils.sh"
. "$MODPATH/flash_script.sh"