Builds a working base image for the Mark II based on Raspberry Pi OS.
raspberry-pi-os
directoryraspberry-pi-os
, run img2tar.py -i <img-file>
to create p1.tar
and p2.tar
git submodule init
git submodule update
make
sudo ./update-image.sh
custom.img
Once you've completed steps 1 and 2, you can run steps 3-5 after any changes to the Dockerfile.
This splits a Raspberry Pi OS image into boot/user partitions (p1.tar
and p2.tar
respectively).
It then runs the Docker build with the user partition (p2.tar
) as the base file system, allowing for software to be installed, etc.
Finally, update-image.sh
recombines the original boot parition (p1.tar
) with the result of the Docker build. This uses the files in the boot
to overwrite /boot
in the image (e.g., with config.txt
).
NOTE: depending on how much stuff you install during the Docker build, you may need to adjust the raspberry-pi-os/partition_table.txt
file. The size
of the second partition (type=83
) may need to be increased before you run update-image.sh
. Remember that this size is in sectors of 512 bytes. Lastly, ensure that the custom_image_bytes
in update-image.sh
is large enough to accomodate your new parition size.
The following software is installed on top of the base Raspberry Pi OS:
i2s_master_loader
); you can re-build this module by running make
in the vocalfusion
directory on a Raspberry Pi.mark2-leds R1,G1,B1,R2,G2,B2,...
lets you set the color(s) of the LEDs (0-255)
mark2-leds <colors> <brightness>
also works (0-100)mark2-fan <percent>
lets you set the fan speed (0-100)mark2-volume <percent>
lets you set the amplifier volume (0-100)mark2-buttons
prints on/off events for the 3 buttons and 1 switch/usr/local/mycroft/mark-2/boot.sh
on boot
Additionally, I2C and SPI are enabled by default (required for the Mark II hardware).
Building requires Docker BuildKit. This is used to build for the arm64
platform as well as cache apt/python packages so they can be reused across multiple builds.
To bootstrap your machine for the first build, ensure that you have qemu "binformat" support:
sudo apt-get install binfmt-support
Then, create a Docker "builder" that supports multi-platform builds:
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --use --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap
After that, you should be able to run make <TARGET>
to build one of the images (e.g., make dinkum
).