LCD-show/system_config.sh

38 lines
997 B
Bash
Raw Normal View History

2022-07-28 11:08:09 +02:00
#!/bin/bash
big_version=`lsb_release -r | awk -F ' ' '{printf $NF}'`
deb_version=`cat /etc/debian_version | tr -d '\n'`
2024-01-26 11:09:28 +01:00
hw_result=`tr -d '\0' < /proc/device-tree/model`
2022-07-28 11:08:09 +02:00
if [ $(getconf WORD_BIT) = '32' ] && [ $(getconf LONG_BIT) = '64' ] ; then
hardware_arch=64
else
hardware_arch=32
fi
2024-01-26 11:09:28 +01:00
if [[ $hw_result == *"Raspberry Pi 5"* ]]; then
hardware_model=5
else
hardware_model=255
fi
2024-01-02 04:41:52 +01:00
sudo raspi-config nonint do_wayland W1
2022-07-28 11:08:09 +02:00
if [ $hardware_arch -eq 32 ]; then
if [ $(($big_version)) -lt 10 ]; then
sudo cp -rf ./boot/config-nomal-10.9-32.txt ./boot/config.txt.bak
else
if [[ "$deb_version" < "10.9" ]] || [[ "$deb_version" = "10.9" ]]; then
sudo cp -rf ./boot/config-nomal-10.9-32.txt ./boot/config.txt.bak
2024-01-02 04:41:52 +01:00
elif [[ "$deb_version" < "12.1" ]]; then
2022-07-28 11:08:09 +02:00
sudo cp -rf ./boot/config-nomal-11.4-32.txt ./boot/config.txt.bak
2024-01-02 04:41:52 +01:00
else
sudo cp -rf ./boot/config-nomal-12.1-32.txt ./boot/config.txt.bak
2022-07-28 11:08:09 +02:00
fi
fi
elif [ $hardware_arch -eq 64 ]; then
sudo cp -rf ./boot/config-nomal-11.4-64.txt ./boot/config.txt.bak
fi