mirror of
https://github.com/akuker/RASCSI.git
synced 2025-01-17 19:30:44 +00:00
Script for installing OLED Screen software (#348)
* Script for installing OLED Screen software * Reboot is required * Compile protobuf lib * Reboot only when kernel config has changed
This commit is contained in:
parent
cbe3642054
commit
7ce84aac6c
@ -135,6 +135,59 @@ function installRaScsiWebInterface() {
|
|||||||
sudo systemctl start rascsi-web
|
sudo systemctl start rascsi-web
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function installRaScsiScreen() {
|
||||||
|
echo "IMPORTANT: This configuration requires a OLED screen to be installed onto your RaSCSI board."
|
||||||
|
echo "See wiki for more information: https://github.com/akuker/RASCSI/wiki/OLED-Status-Display-(Optional)"
|
||||||
|
echo ""
|
||||||
|
echo "Press enter to continue or CTRL-C to exit"
|
||||||
|
read REPLY
|
||||||
|
|
||||||
|
sudo systemctl stop monitor_rascsi || true
|
||||||
|
updateRaScsiGit
|
||||||
|
|
||||||
|
sudo apt-get update && sudo apt-get install python3-dev python3-pip python3-venv libjpeg-dev libpng-dev libopenjp2-7-dev i2c-tools -y </dev/null
|
||||||
|
|
||||||
|
if [ -f "$BASE/src/oled_monitor/rascsi_interface_pb2.py" ]; then
|
||||||
|
rm "$BASE/src/oled_monitor/rascsi_interface_pb2.py"
|
||||||
|
echo "Deleting old Python protobuf library rascsi_interface_pb2.py"
|
||||||
|
fi
|
||||||
|
echo "Compiling the Python protobuf library rascsi_interface_pb2.py..."
|
||||||
|
protoc -I="$BASE/src/raspberrypi/" --python_out="$BASE/src/oled_monitor" rascsi_interface.proto
|
||||||
|
|
||||||
|
if [[ $(grep -c "^dtparam=i2c_arm=on" /boot/config.txt) -ge 1 ]]; then
|
||||||
|
echo "NOTE: I2C support seems to have been configured already."
|
||||||
|
REBOOT=0
|
||||||
|
elif [[ $(grep -c "^dtparam=i2c_arm=off" /boot/config.txt) -ge 1 ]]; then
|
||||||
|
echo "NOTE: I2C support seems to have been disabled; We will override that configuration in /boot/config.txt"
|
||||||
|
sudo sed -i /^dtparam=i2c_arm/d /boot/config.txt
|
||||||
|
sudo bash -c 'echo "dtparam=i2c_arm=on" >> /boot/config.txt'
|
||||||
|
REBOOT=1
|
||||||
|
else
|
||||||
|
sudo bash -c 'echo "dtparam=i2c_arm=on" >> /boot/config.txt'
|
||||||
|
echo "Modified /boot/config.txt"
|
||||||
|
REBOOT=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Installing the monitor_rascsi.service configuration..."
|
||||||
|
sudo cp -f "$BASE/src/oled_monitor/monitor_rascsi.service" /etc/systemd/system/monitor_rascsi.service
|
||||||
|
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable monitor_rascsi
|
||||||
|
|
||||||
|
if [ $REBOOT -eq 1 ]; then
|
||||||
|
echo ""
|
||||||
|
echo "The monitor_rascsi service will start on the next Pi boot."
|
||||||
|
echo "Press Enter to reboot or CTRL-C to exit"
|
||||||
|
read
|
||||||
|
|
||||||
|
echo "Rebooting..."
|
||||||
|
sleep 3
|
||||||
|
sudo reboot
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo systemctl start monitor_rascsi
|
||||||
|
}
|
||||||
|
|
||||||
function createImagesDir() {
|
function createImagesDir() {
|
||||||
if [ -d "$VIRTUAL_DRIVER_PATH" ]; then
|
if [ -d "$VIRTUAL_DRIVER_PATH" ]; then
|
||||||
echo "The $VIRTUAL_DRIVER_PATH directory already exists."
|
echo "The $VIRTUAL_DRIVER_PATH directory already exists."
|
||||||
@ -193,6 +246,10 @@ function showRaScsiWebStatus() {
|
|||||||
sudo systemctl status rascsi-web | tee
|
sudo systemctl status rascsi-web | tee
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showRaScsiScreenStatus() {
|
||||||
|
sudo systemctl status monitor_rascsi | tee
|
||||||
|
}
|
||||||
|
|
||||||
function createDrive600MB() {
|
function createDrive600MB() {
|
||||||
createDrive 600 "HD600"
|
createDrive 600 "HD600"
|
||||||
}
|
}
|
||||||
@ -551,34 +608,40 @@ function runChoice() {
|
|||||||
echo "Installing / Updating RaSCSI Service (${CONNECT_TYPE-FULLSPEC}) - Complete!"
|
echo "Installing / Updating RaSCSI Service (${CONNECT_TYPE-FULLSPEC}) - Complete!"
|
||||||
;;
|
;;
|
||||||
3)
|
3)
|
||||||
|
echo "Installing / Updating RaSCSI OLED Screen"
|
||||||
|
installRaScsiScreen
|
||||||
|
showRaScsiScreenStatus
|
||||||
|
echo "Installing / Updating RaSCSI OLED Screen - Complete!"
|
||||||
|
;;
|
||||||
|
4)
|
||||||
echo "Creating a 600MB drive"
|
echo "Creating a 600MB drive"
|
||||||
createDrive600MB
|
createDrive600MB
|
||||||
echo "Creating a 600MB drive - Complete!"
|
echo "Creating a 600MB drive - Complete!"
|
||||||
;;
|
;;
|
||||||
4)
|
5)
|
||||||
echo "Creating a custom drive"
|
echo "Creating a custom drive"
|
||||||
createDriveCustom
|
createDriveCustom
|
||||||
echo "Creating a custom drive - Complete!"
|
echo "Creating a custom drive - Complete!"
|
||||||
;;
|
;;
|
||||||
5)
|
6)
|
||||||
echo "Configuring wired network bridge"
|
echo "Configuring wired network bridge"
|
||||||
showMacNetworkWired
|
showMacNetworkWired
|
||||||
setupWiredNetworking
|
setupWiredNetworking
|
||||||
echo "Configuring wired network bridge - Complete!"
|
echo "Configuring wired network bridge - Complete!"
|
||||||
;;
|
;;
|
||||||
6)
|
7)
|
||||||
echo "Configuring wifi network bridge"
|
echo "Configuring wifi network bridge"
|
||||||
showMacNetworkWireless
|
showMacNetworkWireless
|
||||||
setupWirelessNetworking
|
setupWirelessNetworking
|
||||||
echo "Configuring wifi network bridge - Complete!"
|
echo "Configuring wifi network bridge - Complete!"
|
||||||
;;
|
;;
|
||||||
7)
|
8)
|
||||||
echo "Reserving SCSI IDs"
|
echo "Reserving SCSI IDs"
|
||||||
reserveScsiIds
|
reserveScsiIds
|
||||||
showRaScsiWebStatus
|
showRaScsiWebStatus
|
||||||
echo "Reserving SCSI IDs - Complete!"
|
echo "Reserving SCSI IDs - Complete!"
|
||||||
;;
|
;;
|
||||||
8)
|
9)
|
||||||
echo "Installing AppleShare File Server"
|
echo "Installing AppleShare File Server"
|
||||||
installNetatalk
|
installNetatalk
|
||||||
echo "Installing AppleShare File Server - Complete!"
|
echo "Installing AppleShare File Server - Complete!"
|
||||||
@ -595,8 +658,8 @@ function runChoice() {
|
|||||||
function readChoice() {
|
function readChoice() {
|
||||||
choice=-1
|
choice=-1
|
||||||
|
|
||||||
until [ $choice -ge "0" ] && [ $choice -le "8" ]; do
|
until [ $choice -ge "0" ] && [ $choice -le "9" ]; do
|
||||||
echo -n "Enter your choice (0-8) or CTRL-C to exit: "
|
echo -n "Enter your choice (0-9) or CTRL-C to exit: "
|
||||||
read -r choice
|
read -r choice
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -609,16 +672,17 @@ function showMenu() {
|
|||||||
echo "INSTALL/UPDATE RASCSI (${CONNECT_TYPE-FULLSPEC} version)"
|
echo "INSTALL/UPDATE RASCSI (${CONNECT_TYPE-FULLSPEC} version)"
|
||||||
echo " 1) install or update RaSCSI Service + Web Interface"
|
echo " 1) install or update RaSCSI Service + Web Interface"
|
||||||
echo " 2) install or update RaSCSI Service"
|
echo " 2) install or update RaSCSI Service"
|
||||||
|
echo " 3) install or update RaSCSI OLED Screen (requires hardware)"
|
||||||
echo "CREATE HFS FORMATTED (MAC) IMAGE WITH LIDO DRIVERS"
|
echo "CREATE HFS FORMATTED (MAC) IMAGE WITH LIDO DRIVERS"
|
||||||
echo "** For the Mac Plus, it's better to create an image through the Web Interface **"
|
echo "** For the Mac Plus, it's better to create an image through the Web Interface **"
|
||||||
echo " 3) 600MB drive (suggested size)"
|
echo " 4) 600MB drive (suggested size)"
|
||||||
echo " 4) custom drive size (up to 4000MB)"
|
echo " 5) custom drive size (up to 4000MB)"
|
||||||
echo "NETWORK ASSISTANT"
|
echo "NETWORK ASSISTANT"
|
||||||
echo " 5) configure network forwarding over Ethernet (DHCP)"
|
echo " 6) configure network forwarding over Ethernet (DHCP)"
|
||||||
echo " 6) configure network forwarding over WiFi (static IP)"
|
echo " 7) configure network forwarding over WiFi (static IP)"
|
||||||
echo "MISCELLANEOUS"
|
echo "MISCELLANEOUS"
|
||||||
echo " 7) reserve SCSI IDs"
|
echo " 8) reserve SCSI IDs"
|
||||||
echo " 8) install AppleShare File Server (Netatalk)"
|
echo " 9) install AppleShare File Server (Netatalk)"
|
||||||
}
|
}
|
||||||
|
|
||||||
# parse arguments
|
# parse arguments
|
||||||
@ -638,7 +702,7 @@ while [ "$1" != "" ]; do
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
case $VALUE in
|
case $VALUE in
|
||||||
FULLSPEC | STANDARD | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8)
|
FULLSPEC | STANDARD | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 )
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "ERROR: unknown option \"$VALUE\""
|
echo "ERROR: unknown option \"$VALUE\""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user