Apple2-IO-RPi/RaspberryPi/setup.sh

68 lines
1.9 KiB
Bash
Raw Normal View History

2022-03-19 18:05:20 +00:00
#!/bin/sh
sudo apt update
2022-03-19 18:08:22 +00:00
sudo apt install git -y
if [ "$(uname -m)" = 'aarch64' ]; then
if [ ! -f go1.21.3.linux-arm64.tar.gz ]; then
wget https://go.dev/dl/go1.21.3.linux-arm64.tar.gz
sudo tar -C /usr/local -xzf go1.21.3.linux-arm64.tar.gz
fi
else
if [ ! -f go1.21.3.linux-arm6l.tar.gz ]; then
wget https://golang.org/dl/go1.21.3.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.21.3.linux-armv6l.tar.gz
fi
fi
if [ -f "/usr/bin/go" ]; then
sudo rm /usr/bin/go
fi
2022-03-19 18:05:20 +00:00
sudo ln -s /usr/local/go/bin/go /usr/bin/go
if [ ! -d "ProDOS-Utilities" ]; then
git clone https://github.com/tjboldt/ProDOS-Utilities.git
fi
2022-04-28 02:44:13 +00:00
cd ProDOS-Utilities || exit
2022-03-19 18:05:20 +00:00
go build
2022-04-28 02:44:13 +00:00
cd ~ || exit
if [ -L "/usr/bin/ProDOS-Utilities" ]; then
sudo rm /usr/bin/ProDOS-Utilities
fi
2022-03-19 18:05:20 +00:00
sudo ln -s /home/pi/ProDOS-Utilities/ProDOS-Utilities /usr/bin/ProDOS-Utilities
if [ ! -d "Apple2-IO-RPi" ]; then
git clone https://github.com/tjboldt/Apple2-IO-RPi.git
fi
2022-04-28 02:44:13 +00:00
cd Apple2-IO-RPi/RaspberryPi/apple2driver || exit
2022-03-19 18:05:20 +00:00
go build
2022-03-19 18:08:22 +00:00
sudo apt install cc65 vim -y
2022-04-28 02:44:13 +00:00
cd ~ || exit
2022-03-19 18:05:20 +00:00
sudo bash -c 'cat > /boot/config.txt << EOF
disable_splash=1
dtoverlay=disable-bt
boot_delay=0
EOF'
sudo bash -c 'echo " quiet" >> /boot/cmdline.txt'
bash -c 'cat > apple2driver.service << EOF
2022-03-19 18:05:20 +00:00
[Unit]
Description=Apple2-IO-RPi Driver
[Service]
ExecStart=/home/$USER/Apple2-IO-RPi/RaspberryPi/apple2driver/apple2driver
2022-03-19 18:05:20 +00:00
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=apple2driver
User=$USER
Group=$USER
WorkingDirectory=/home/$USER/Apple2-IO-RPi/RaspberryPi/apple2driver
2022-03-19 18:05:20 +00:00
[Install]
WantedBy=basic.target
EOF'
sudo mv apple2driver.service /etc/systemd/system/apple2driver.service
sudo chown root:root /etc/systemd/system/apple2driver.service
2022-03-19 18:05:20 +00:00
sudo systemctl start apple2driver
sudo systemctl enable apple2driver
sudo systemctl disable avahi-daemon.service
sudo systemctl disable triggerhappy.service
sudo systemctl disable raspi-config.service
sudo systemctl daemon-reload