diff --git a/raspberrypi/build_rpi/.bash_profile b/raspberrypi/build_rpi/.bash_profile new file mode 100644 index 000000000..007b79638 --- /dev/null +++ b/raspberrypi/build_rpi/.bash_profile @@ -0,0 +1 @@ +[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- diff --git a/raspberrypi/build_rpi/Readme.md b/raspberrypi/build_rpi/Readme.md index e69de29bb..d409f267b 100644 --- a/raspberrypi/build_rpi/Readme.md +++ b/raspberrypi/build_rpi/Readme.md @@ -0,0 +1,18 @@ +# Raspberry Pi OS Setup Instructions +1. Use the raspberry pi imager to write Raspberry Pi OS Lite (64-bit) onto an sd card +2. Boot the Raspberry Pi OS and setup the locale, keyboard layout and initial username and password. Enable **Auto-Login** in **System Options** +**NOTE:** The following steps require that the Raspberry Pi have an active internet connection. Wifi can be configured by running `sudo raspi-config` and setting up the **Wireless LAN** in **System Options**. +3. run install.sh + a. verify that docker is installed. Run `docker --version` +4. save the autostart file in /etc/xdg/openbox/ +5. copy the .bash_profile file into the initial user's home directory (~/.bash_profile) +6. copy the ./Aliro/raspberrypi/intropage directory into the user's home directory (~/intropage) +7. copy the extracted contents of the Aliro-*.zip file from the GitHub release page into the user's home page. (~/target) +8. change directory into ~/target/production/Aliro-*/ and run `docker compose pull` + **NOTE:** The docker images will only be **pulled**. The containers will not be built inside the Pi (to keep the final custom OS as light as possible) +9. run clean.sh + +# Building the aliro-image executable +## Windows + +## Linux diff --git a/raspberrypi/build_rpi/autostart b/raspberrypi/build_rpi/autostart new file mode 100644 index 000000000..92a86e57a --- /dev/null +++ b/raspberrypi/build_rpi/autostart @@ -0,0 +1,13 @@ +# Place this file in /etc/xdg/openbox/ +# Disable any form of screen saver / screen blanking / power management +xset s off +xset s noblank +xset -dpms + +# Allow quitting the X server with CTRL-ATL-Backspace +setxkbmap -option terminate:ctrl_alt_bksp + +# Start Chromium in kiosk mode +sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State' +sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences +chromium-browser --disable-infobars --kiosk 'file:///intropage/index.html' diff --git a/raspberrypi/build_rpi/clean.sh b/raspberrypi/build_rpi/clean.sh new file mode 100644 index 000000000..76e34dbca --- /dev/null +++ b/raspberrypi/build_rpi/clean.sh @@ -0,0 +1,14 @@ +#/bin/bash +# disable and remove bluetooth +# not needed in kiosk mode +sudo systemctl disable hciuart.service +sudo systemctl disable bluealsa.service +sudo systemctl disable bluetooth.service +sudo apt purge bluez -y +# remove unnecessary packages and clean up apt +sudo apt autoremove -y +sudo apt autoclean -y +sudo apt clean -y +# clear bash history +history -c + diff --git a/raspberrypi/build_rpi/docker_load.sh b/raspberrypi/build_rpi/docker_load.sh deleted file mode 100644 index 135ef24cf..000000000 --- a/raspberrypi/build_rpi/docker_load.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -# run these commands on the machine where the arm64 docker images are built - -docker load < aliro_machine.tar.gz -docker load < aliro_lab.tar.gz -docker load < aliro_dbmongo.tar.gz \ No newline at end of file diff --git a/raspberrypi/build_rpi/docker_save.sh b/raspberrypi/build_rpi/docker_save.sh deleted file mode 100644 index 527bda86a..000000000 --- a/raspberrypi/build_rpi/docker_save.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -# run these commands on the machine where the arm64 docker images are built - -docker save aliro_machine | gzip > aliro_machine.tar.gz -docker save aliro_lab | gzip > aliro_lab.tar.gz -docker save aliro_dbmongo | gzip > aliro_dbmongo.tar.gz \ No newline at end of file diff --git a/raspberrypi/build_rpi/install.sh b/raspberrypi/build_rpi/install.sh new file mode 100644 index 000000000..89d0e7ec1 --- /dev/null +++ b/raspberrypi/build_rpi/install.sh @@ -0,0 +1,15 @@ +#/bin/bash +# update and upgrade to latest packages +sudo apt update +sudo apt upgrade +# install xserver, xinit, openbox, chromium-browser, pcmanfm, docker +sudo apt install --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox +sudo apt install --no-install-recommends chromium-browser +sudo apt install pcmanfm +# use the convenience script to install docker +curl -fsSL https://get.docker.com -o get-docker.sh +sudo sh ./get-docker.sh +# post install docker +sudo groupadd docker +sudo usermod -aG docker $USER +newgrp docker