|
|
|
|
@ -4,6 +4,7 @@ FLAG=0
|
|
|
|
|
checkout=0
|
|
|
|
|
BULLSEYE=0
|
|
|
|
|
UPDATE=0
|
|
|
|
|
TRIXIE=0
|
|
|
|
|
|
|
|
|
|
FILE=/home/pi/CubeSatSim/cubesatsim # code has already been compiled
|
|
|
|
|
if [ -f "$FILE" ]; then
|
|
|
|
|
@ -257,19 +258,114 @@ if [[ $(grep 'bookworm' /etc/os-release) ]]; then
|
|
|
|
|
|
|
|
|
|
elif [[ $(grep 'trixie' /etc/os-release) ]]; then
|
|
|
|
|
|
|
|
|
|
echo "Trixie detected, installation continuing."
|
|
|
|
|
echo "Your Pi OS version is not Bookworm or Bullseye."
|
|
|
|
|
echo "The software installation will likely not work."
|
|
|
|
|
echo "See the README.md for how to install using Bookworm."
|
|
|
|
|
echo
|
|
|
|
|
echo "Trixie detected"
|
|
|
|
|
|
|
|
|
|
echo "Are you sure you want to continue the installation (y/n)?"
|
|
|
|
|
TRIXIE=1
|
|
|
|
|
|
|
|
|
|
sudo cp /boot/firmware/config.txt /boot/firmware/config.txt.0
|
|
|
|
|
|
|
|
|
|
read -r ANS
|
|
|
|
|
sudo cp /boot/firmware/cmdline.txt /boot/firmware/cmdline.txt.0
|
|
|
|
|
|
|
|
|
|
if [ "$ANS" = "n" ]; then
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
sudo raspi-config nonint do_i2c 0
|
|
|
|
|
|
|
|
|
|
sudo raspi-config nonint do_camera 0
|
|
|
|
|
|
|
|
|
|
sudo raspi-config nonint do_legacy 0
|
|
|
|
|
|
|
|
|
|
sudo sed -i 's/console=serial0,115200 //g' /boot/firmware/cmdline.txt
|
|
|
|
|
|
|
|
|
|
sudo sed -i 's/console=tty1 r/console=tty1 maxcpus=2 r/g' /boot/firmware/cmdline.txt # single core if Pi Zero 2
|
|
|
|
|
# sudo sed -i 's/console=tty1 maxcpus=1 r/console=tty1 r/g' /boot/firmware/cmdline.txt
|
|
|
|
|
|
|
|
|
|
sudo sed -i 's/maxcpus=1/maxcpus=2/g' /boot/firmware/cmdline.txt # single core if Pi Zero 2
|
|
|
|
|
|
|
|
|
|
sudo sed -i 's/#dtparam=i2c_arm=on/dtparam=i2c_arm=on/g' /boot/firmware/config.txt
|
|
|
|
|
|
|
|
|
|
sudo sed -i 's/#dtoverlay=vc4-fkms-v3d/dtoverlay=vc4-fkms-v3d/g' /boot/firmware/config.txt
|
|
|
|
|
sudo sed -i 's/#dtoverlay=vc4-kms-v3d/dtoverlay=vc4-kms-v3d/g' /boot/firmware/config.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ $(grep 'dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24' /boot/firmware/config.txt) ]]; then
|
|
|
|
|
echo "dtoverlay=i2c-gpio already in /boot/firmware/config.txt"
|
|
|
|
|
else
|
|
|
|
|
echo "adding dtoverlay=i2c-gpio to /boot/firmware/config.txt"
|
|
|
|
|
sudo sh -c 'echo "\ndtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24" >> /boot/firmware/config.txt'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ $(grep 'enable_uart=1' /boot/firmware/config.txt) ]]; then
|
|
|
|
|
echo "enable_uart=1 already in /boot/firmware/config.txt"
|
|
|
|
|
else
|
|
|
|
|
echo "adding enable_uart=1 to /boot/firmware/config.txt"
|
|
|
|
|
sudo sh -c 'echo "\nenable_uart=1" >> /boot/firmware/config.txt'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ $(grep 'dtoverlay=disable-bt' /boot/firmware/config.txt) ]]; then
|
|
|
|
|
echo "dtoverlay=disable-bt already in /boot/firmware/config.txt"
|
|
|
|
|
else
|
|
|
|
|
echo "adding dtoverlay=disable-bt to /boot/firmware/config.txt"
|
|
|
|
|
sudo sh -c 'echo "\ndtoverlay=disable-bt" >> /boot/firmware/config.txt'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ $(grep 'dtoverlay=dwc2' /boot/firmware/config.txt) ]]; then
|
|
|
|
|
echo "dtoverlay=dwc2 aalready in /boot/firmware/config.txt"
|
|
|
|
|
else
|
|
|
|
|
echo "adding dtoverlay=dwc2 to /boot/firmware/config.txt"
|
|
|
|
|
sudo sh -c 'echo "\ndtoverlay=dwc2" >> /boot/firmware/config.txt'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ $(grep 'modules-load=dwc2,g_ether' /boot/firmware/cmdline.txt) ]]; then
|
|
|
|
|
echo "modules-load=dwc2,g_ether already in /boot/firmware/cmdline.txt"
|
|
|
|
|
else
|
|
|
|
|
echo "adding modules-load=dwc2,g_ether to /boot/firmware/cmdline.txt"
|
|
|
|
|
sudo sed -i 's/ rootwait/ rootwait modules-load=dwc2,g_ether/g' /boot/firmware/cmdline.txt
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ $(grep 'dtparam=audio=on' /boot/firmware/config.txt) ]]; then
|
|
|
|
|
echo "dtparam=audio=on already in /boot/firmware/config.txt"
|
|
|
|
|
else
|
|
|
|
|
echo "adding dtparam=audio=on to /boot/firmware/config.txt"
|
|
|
|
|
sudo sh -c 'echo "\ndtparam=audio=on" >> /boot/firmware/config.txt'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ $(grep 'dtoverlay=audremap,enable_jack=on' /boot/firmware/config.txt) ]]; then
|
|
|
|
|
echo "dtoverlay=audremap,enable_jack=on already in /boot/firmware/config.txt"
|
|
|
|
|
else
|
|
|
|
|
echo "adding dtoverlay=audremap,enable_jack=on to /boot/firmware/config.txt"
|
|
|
|
|
sudo sh -c 'echo "\ndtoverlay=audremap,enable_jack=on" >> /boot/firmware/config.txt'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ $(grep 'dtoverlay=pwm,pin=18,func=2' /boot/firmware/config.txt) ]]; then
|
|
|
|
|
echo "dtoverlay=pwm,pin=18,func=2 already in /boot/firmware/config.txt"
|
|
|
|
|
else
|
|
|
|
|
echo "adding to /boot/firmware/config.txt"
|
|
|
|
|
sudo sh -c 'echo "\ndtoverlay=pwm,pin=18,func=2" >> /boot/firmware/config.txt'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ $(grep 'disable_splash=1' /boot/firmware/config.txt) ]]; then
|
|
|
|
|
echo "disable_splash=1 already in /boot/firmware/config.txt"
|
|
|
|
|
else
|
|
|
|
|
echo "adding disable_splash=1 to /boot/firmware/config.txt"
|
|
|
|
|
sudo sh -c 'echo "\ndisable_splash=1" >> /boot/firmware/config.txt'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ $(grep 'boot_delay=0' /boot/firmware/config.txt) ]]; then
|
|
|
|
|
echo "boot_delay=0 already in /boot/firmware/config.txt"
|
|
|
|
|
else
|
|
|
|
|
echo "adding boot_delay=0 to /boot/firmware/config.txt"
|
|
|
|
|
sudo sh -c 'echo "\nboot_delay=0" >> /boot/firmware/config.txt'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ $(grep 'camera_auto_detect=1' /boot/firmware/config.txt) ]]; then
|
|
|
|
|
echo "camera_auto_detect=1 already in /boot/firmware/config.txt"
|
|
|
|
|
else
|
|
|
|
|
echo "adding camera_auto_detect=1 to /boot/firmware/config.txt"
|
|
|
|
|
sudo sh -c 'echo "\ncamera_auto_detect=1" >> /boot/firmware/config.txt'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if ! grep -q force_turbo=1 /boot/firmware/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/firmware/config.txt'; fi
|
|
|
|
|
|
|
|
|
|
sudo sh -c 'echo "\n" >> /boot/firmware/config.txt'
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
FILE=/home/pi/CubeSatSim/sim.cfg
|
|
|
|
|
|