Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build_rpi instructions #637

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions raspberrypi/build_rpi/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,33 @@
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`
6. copy the ./Aliro/raspberrypi/intropage directory into the root directory (/intropage)
7. copy the extracted contents of the Aliro-*.zip file from the GitHub release page into the root directory. (/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
9. copy the aliroed-compose.service file in /etc/systemd/system/ (`sudo cp aliroed-compose.service /etc/systemd/system/`
10. enable the aliroed-compose service with `sudo systemctl enable aliroed-compose.service`
12. Remove any unused kernels:
use `uname -r` to check the current kernel in use
use `dpkg -l | grep linux-image` to see a list of installed kernels
remove the ones we don't need with `sudo apt purge linux-image-<kernel-name>`
13. Zero out free space for better compression:
This one was useless!
Inside the Raspberry Pi, run `sudo dd if=/dev/zero of=/EMPTY bs=1M` and `sudo rm -f /EMPTY`
14. run clean.sh

# Building the aliro-image executable
## Windows

Perform these steps after performing the steps in Linux to extract the .img file, shrinking with PiShrink and compressing with xz.
These steps work on a Windows 11 machine:
1. Ensure you have a Code Signing Certificate installed.
2. Embed the aliro.img.xz file in the same level as the **src** directory.
3. Open the Epistasis/aliro-imager project in Qt Creator (follow the instructions on the aliro-imager repository)
4. Configure the version number as needed. The current scheme is to use the version of the latest Aliro Release (e.g. 0.21)
5. Proceed to `Build All Projects` in Qt Creator
6. Use `nsis-binary-7336-1` to build the installer, using the **aliro-imager.nsi** script output by the Qt Creator build.
## Linux
1. Extract the image into a **.img** file with a tool like **dd**: `sudo dd if=/dev/sdX of=aliroed.img bs=4M`
2. Use PiShrink to shrink the image. The image should also be compressed with **xz**. There are 2 options for this: `sudo ./pishrink.sh aliroed.img`
a. use PiShrink with the -Z option, or
b. use the `xz` utility independently: `xz -9 aliroed.img` (**Note: This option has worked best so far**)
12 changes: 12 additions & 0 deletions raspberrypi/build_rpi/aliroed-compose.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=AliroEd Docker Service
After=docker.service
Requires=docker.service

[Service]
Restart=always
WorkingDirectory=/target/production/Aliro-0.21
ExecStart=/usr/bin/docker compose up -d

[Install]
WantedBy=multi-user.target
4 changes: 4 additions & 0 deletions raspberrypi/build_rpi/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ sudo apt purge bluez -y
sudo apt autoremove -y
sudo apt autoclean -y
sudo apt clean -y
sudo journalctl --vacuum-time=7d
docker builder prune --all
sudo rm -rf /var/log/*
sudo rm -rf /tmp/*
# clear bash history
history -c

Loading