#!/bin/sh

if (test "${1}" = "")
then
  echo "Example: ./usb_ehci.sh ehci|xhci"
  exit 2
elif (test "${1}" = "ehci")
then
  sed -i "s/CONFIG_LP_USB_UHCI=y/CONFIG_LP_USB_UHCI=n/" ./payloads/libpayload/configs/defconfig ./payloads/libpayload/configs/defconfig-tinycurses  
  sed -i "s/CONFIG_LP_USB_OHCI=y/CONFIG_LP_USB_OHCI=n/" ./payloads/libpayload/configs/defconfig ./payloads/libpayload/configs/defconfig-tinycurses  
  sed -i "s/CONFIG_LP_USB_XHCI=y/CONFIG_LP_USB_XHCI=n/" ./payloads/libpayload/configs/defconfig ./payloads/libpayload/configs/defconfig-tinycurses  
elif (test "${1}" = "xhci")
then
  sed -i "s/CONFIG_LP_USB_UHCI=n/CONFIG_LP_USB_UHCI=y/" ./payloads/libpayload/configs/defconfig ./payloads/libpayload/configs/defconfig-tinycurses
  sed -i "s/CONFIG_LP_USB_OHCI=n/CONFIG_LP_USB_OHCI=y/" ./payloads/libpayload/configs/defconfig ./payloads/libpayload/configs/defconfig-tinycurses
  sed -i "s/CONFIG_LP_USB_XHCI=n/CONFIG_LP_USB_XHCI=y/" ./payloads/libpayload/configs/defconfig ./payloads/libpayload/configs/defconfig-tinycurses
fi
