Update install.sh

Fixes
This commit is contained in:
Jan Rude
2017-03-06 11:43:28 +01:00
committed by GitHub
parent 73dbeb9e45
commit 78e1fd761f

View File

@@ -32,14 +32,17 @@ then
sudo cp /etc/rc.local ~/HackPi/backup/rc.local.bak
sudo cp /etc/default/isc-dhcp-server ~/HackPi/backup/isc-dhcp-server.bak
sudo cp /etc/network/interfaces ~/HackPi/backup/interfaces.bak
sudo cp /lib/modules/"$KERNEL_VERSION"/kernel/drivers/usb/dwc2/dwc2.ko ~/HackPi/backup/dwc2.ko.bak
fi
# Check if kernel module is there, otherwise download kernel and patch
if [ -f ~/HackPi/dwc2/dwc2."$KERNEL_VERSION".ko ] ;
then
if [[ $backup == y* ]] ;
then
sudo cp /lib/modules/"$KERNEL_VERSION"/kernel/drivers/usb/dwc2/dwc2.ko ~/HackPi/backup/dwc2.ko.bak
fi
sudo cp -f ~/HackPi/dwc2/dwc2."$KERNEL_VERSION".ko /lib/modules/"$KERNEL_VERSION"/kernel/drivers/usb/dwc2/dwc2.ko
$MODULE_INSTALLED=true
MODULE_INSTALLED=true
else
printf "\nModule for kernel $KERNEL_VERSION not found.\nPatching is possible, but requires downloading the kernel."
printf "\nProceed? [y/n] "
@@ -55,13 +58,13 @@ else
patch -i ~/HackPi/dwc2/gadget.patch
cd ~/linux
make M=drivers/usb/dwc2 CONFIG_USB_DWC2=m
sudo cp -f drivers/usb/dwc2/dwc2."$KERNEL_VERSION".ko /lib/modules/"$KERNEL_VERSION"/kernel/drivers/usb/dwc2/dwc2.ko
sudo cp -f drivers/usb/dwc2/dwc2."$KERNEL_VERSION".ko ~/HackPi/dwc2/
$MODULE_INSTALLED=true
sudo cp -f drivers/usb/dwc2/dwc2.ko /lib/modules/"$KERNEL_VERSION"/kernel/drivers/usb/dwc2/dwc2.ko
sudo cp -f drivers/usb/dwc2/dwc2.ko ~/HackPi/dwc2/dwc2."$KERNEL_VERSION".ko
MODULE_INSTALLED=true
fi
fi
if [ "$MODULE_INSTALLED" = true ] ;
if [ "$MODULE_INSTALLED" == true ] ;
then
# Server configuration
printf "\nConfigure backdoor usage? [y/n] "