From a0eca1bb61ab246aedbe1d1fbb1fffe7f8eb6a6e Mon Sep 17 00:00:00 2001 From: aiminick Date: Tue, 9 Nov 2021 22:12:30 +0800 Subject: [PATCH] Add config settings support for Debian-Pi-Aarch64 --- hardware/argon1-pifan.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hardware/argon1-pifan.sh b/hardware/argon1-pifan.sh index 41f2773..422fa79 100644 --- a/hardware/argon1-pifan.sh +++ b/hardware/argon1-pifan.sh @@ -42,12 +42,24 @@ for curpkg in ${pkglist[@]}; do fi done -# Ubuntu Mate for RPi has raspi-config too +# Ubuntu Mate for RPi has raspi-config too, but can not used for Debian-Pi-Aarch64 command -v raspi-config &> /dev/null if [ $? -eq 0 ] then sudo raspi-config nonint do_i2c 0 sudo raspi-config nonint do_serial 0 +else +# Add config settings support for Debian-Pi-Aarch64 + cat /boot/config.txt |grep "^#.*i2c_arm" + if [ $? -eq 0 ] + then + sed -i 's/^#.*dtparam=i2c_arm=on/dtparam=i2c_arm=on/g' /boot/config.txt + fi + cat /boot/config.txt |grep "^#.*enable_uart" + if [ $? -eq 0 ] + then + sed -i 's/^#.*enable_uart=1/enable_uart=1/g' /boot/config.txt + fi fi daemonname="argononed" @@ -281,6 +293,9 @@ echo ' sudo rm '$removescript >> $removescript echo ' echo "Removed Argon One Services."' >> $removescript echo ' echo "Cleanup will complete after restarting the device."' >> $removescript echo 'fi' >> $removescript +echo "sed -i 's/.*dtparam=i2c_arm=on/# dtparam=i2c_arm=on/g' /boot/config.txt" >> $removescript +echo "sed -i 's/.*enable_uart=1/# enable_uart=1/g' /boot/config.txt" >> $removescript +echo 'echo "I2C & UART in config.txt was restored as disabled."' >> $removescript sudo chmod 755 $removescript