Add 64 bit OS support, upgrade Go, allow non-pi user

This commit is contained in:
Terence Boldt 2023-10-31 21:47:49 -04:00
parent 5db78ba3b9
commit 0dbb55fda1

View File

@ -2,43 +2,66 @@
sudo apt update sudo apt update
sudo apt install git -y sudo apt install git -y
wget https://golang.org/dl/go1.17.3.linux-armv6l.tar.gz if [ "$(uname -m)" = 'aarch64' ]; then
sudo tar -C /usr/local -xzf go1.17.3.linux-armv6l.tar.gz 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
sudo ln -s /usr/local/go/bin/go /usr/bin/go sudo ln -s /usr/local/go/bin/go /usr/bin/go
git clone https://github.com/tjboldt/ProDOS-Utilities.git if [ ! -d "ProDOS-Utilities" ]; then
git clone https://github.com/tjboldt/ProDOS-Utilities.git
fi
cd ProDOS-Utilities || exit cd ProDOS-Utilities || exit
go build go build
cd ~ || exit cd ~ || exit
if [ -L "/usr/bin/ProDOS-Utilities" ]; then
sudo rm /usr/bin/ProDOS-Utilities
fi
sudo ln -s /home/pi/ProDOS-Utilities/ProDOS-Utilities /usr/bin/ProDOS-Utilities sudo ln -s /home/pi/ProDOS-Utilities/ProDOS-Utilities /usr/bin/ProDOS-Utilities
git clone https://github.com/tjboldt/Apple2-IO-RPi.git if [ ! -d "Apple2-IO-RPi" ]; then
git clone https://github.com/tjboldt/Apple2-IO-RPi.git
fi
cd Apple2-IO-RPi/RaspberryPi/apple2driver || exit cd Apple2-IO-RPi/RaspberryPi/apple2driver || exit
go build go build
sudo apt install cc65 vim -y sudo apt install cc65 vim -y
cd ~ || exit cd ~ || exit
sudo bash -c 'cat > /boot/config.txt << EOF sudo bash -c 'cat > /boot/config.txt << EOF
disable_splash=1 disable_splash=1
dtoverlay=disable-bt dtoverlay=disable-bt
boot_delay=0 boot_delay=0
EOF' EOF'
sudo bash -c 'echo " quiet" >> /boot/cmdline.txt' sudo bash -c 'echo " quiet" >> /boot/cmdline.txt'
sudo bash -c 'cat > /etc/systemd/system/apple2driver.service << EOF bash -c 'cat > apple2driver.service << EOF
[Unit] [Unit]
Description=Apple2-IO-RPi Driver Description=Apple2-IO-RPi Driver
[Service] [Service]
ExecStart=/home/pi/Apple2-IO-RPi/RaspberryPi/apple2driver/apple2driver ExecStart=/home/$USER/Apple2-IO-RPi/RaspberryPi/apple2driver/apple2driver
StandardOutput=syslog StandardOutput=syslog
StandardError=syslog StandardError=syslog
SyslogIdentifier=apple2driver SyslogIdentifier=apple2driver
User=pi User=$USER
Group=pi Group=$USER
WorkingDirectory=/home/pi/Apple2-IO-RPi/RaspberryPi/apple2driver WorkingDirectory=/home/$USER/Apple2-IO-RPi/RaspberryPi/apple2driver
[Install] [Install]
WantedBy=basic.target WantedBy=basic.target
EOF' EOF'
sudo mv apple2driver.service /etc/systemd/system/apple2driver.service
sudo chown root:root /etc/systemd/system/apple2driver.service
sudo systemctl start apple2driver sudo systemctl start apple2driver
sudo systemctl enable apple2driver sudo systemctl enable apple2driver
sudo systemctl disable avahi-daemon.service sudo systemctl disable avahi-daemon.service
sudo systemctl disable triggerhappy.service sudo systemctl disable triggerhappy.service
sudo systemctl disable raspi-config.service sudo systemctl disable raspi-config.service
sudo systemctl daemon-reload