# Orignal for ideas written by Andy Taylor (MW0MWZ)
# Remount root as writable
sudo mount -o remount,rw /
sudo mount -o remount,rw /boot
# Update the apt sources
sudo apt update
# Patch Debian 9
if [[ $(cut -c 1 /etc/debian_version) -eq 9 ]]; then
sudo apt install -y --reinstall libraspberrypi0 libraspberrypi-dev libraspberrypi-bin
fi
# Install all the GUI apps
sudo apt install -y lxde
sudo apt update && sudo apt-get upgrade -y
sudo apt install realvnc-vnc-server
sudo apt install -y chromium-browser
# Modify the autostart parameters
#NEED THESE? TBD
mkdir /home/pi-star/.config
mkdir /home/pi-star/.config/lxsession
mkdir /home/pi-star/.config/lxsession/LXDE-pi
#touch /home/pi-star/.config/lxsession/LXDE-pi/autostart
#sed -i 's/@xscreensaver -no-splash/#@xscreensaver -no-splash/g' /home/pi-star/.config/lxsession/LXDE-pi/autostart
#echo "@xset s off" >> /home/pi-star/.config/lxsession/LXDE-pi/autostart
# Modify the FIREWALL rules
touch /root/ipv4.fw
echo "iptables -A INPUT -p tcp --dport 5900 -j ACCEPT #VNC Server" >> /root/ipv4.fw
# Fix the autologin user NEEDED?? TBD
sudo sed -i 's/#autologin-user=/autologin-user=pi-star/g' /etc/lightdm/lightdm.conf
sudo sed -i 's/#autologin-user-timeout=0/autologin-user-timeout=0/g' /etc/lightdm/lightdm.conf
# Chown the .config dir
sudo chown -R pi-star:pi-star /home/pi-star/.config
# Force the disk to be RW on boot
sudo sed -i 's/mount -o remount,ro \///g' /etc/rc.local
sudo reboot
正文完