mirror of
https://github.com/wismna/HackPi.git
synced 2025-10-03 15:40:16 -04:00
Update install.sh
Fixes
This commit is contained in:
15
install.sh
15
install.sh
@@ -32,14 +32,17 @@ then
|
|||||||
sudo cp /etc/rc.local ~/HackPi/backup/rc.local.bak
|
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/default/isc-dhcp-server ~/HackPi/backup/isc-dhcp-server.bak
|
||||||
sudo cp /etc/network/interfaces ~/HackPi/backup/interfaces.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
|
fi
|
||||||
|
|
||||||
# Check if kernel module is there, otherwise download kernel and patch
|
# Check if kernel module is there, otherwise download kernel and patch
|
||||||
if [ -f ~/HackPi/dwc2/dwc2."$KERNEL_VERSION".ko ] ;
|
if [ -f ~/HackPi/dwc2/dwc2."$KERNEL_VERSION".ko ] ;
|
||||||
then
|
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
|
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
|
else
|
||||||
printf "\nModule for kernel $KERNEL_VERSION not found.\nPatching is possible, but requires downloading the kernel."
|
printf "\nModule for kernel $KERNEL_VERSION not found.\nPatching is possible, but requires downloading the kernel."
|
||||||
printf "\nProceed? [y/n] "
|
printf "\nProceed? [y/n] "
|
||||||
@@ -55,13 +58,13 @@ else
|
|||||||
patch -i ~/HackPi/dwc2/gadget.patch
|
patch -i ~/HackPi/dwc2/gadget.patch
|
||||||
cd ~/linux
|
cd ~/linux
|
||||||
make M=drivers/usb/dwc2 CONFIG_USB_DWC2=m
|
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.ko /lib/modules/"$KERNEL_VERSION"/kernel/drivers/usb/dwc2/dwc2.ko
|
||||||
sudo cp -f drivers/usb/dwc2/dwc2."$KERNEL_VERSION".ko ~/HackPi/dwc2/
|
sudo cp -f drivers/usb/dwc2/dwc2.ko ~/HackPi/dwc2/dwc2."$KERNEL_VERSION".ko
|
||||||
$MODULE_INSTALLED=true
|
MODULE_INSTALLED=true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$MODULE_INSTALLED" = true ] ;
|
if [ "$MODULE_INSTALLED" == true ] ;
|
||||||
then
|
then
|
||||||
# Server configuration
|
# Server configuration
|
||||||
printf "\nConfigure backdoor usage? [y/n] "
|
printf "\nConfigure backdoor usage? [y/n] "
|
||||||
|
Reference in New Issue
Block a user