Using LZMA (xz) for compression instead LZ77 (gzip) reduces the image size by approx 30% more. Image writing utilities with compressed image support (RPI Imager, Balena Etcher) already support it and the RaspiOS or Armbian images are already distributed as `.xz` files.
Changed our image compression format from `.gz` to `.xz` and thus reduce the download size for all images.
When making a chroot use the distribution name rather than the default $md_build/chroot
Require the chroot location parameter for the chroot, init and deinit functions.
Adjust the _get_info function so it can be used directly from the builder module.
New function _get_info_image reads values from the distribution ini configuration files stored in image/dists
This simplifies the code and avoids having logic for different versions in multiple functions.
The ini format is as follows - it may change and be extended in the future.
The filename is the dist name that is passed into the building functions.
The current images now have a prefix "rpios-"
* name: name of distro - eg buster
* version: rpios/debian version
* url: url for image file
* format: format of the image file - currently supported is zip and xz (used by raspberrypi.org)
* platforms: list of the platforms supported (eg. rpi1 rpi2 rpi3 rpi4)
* file_PLATFORM (name to be used in the image file for each platform)
* title_PLATFORM (user friendly name of file for each platform - used for rpi imager json)
Set the "pi" password in the chroot install script rather than via userconfig.txt.
Disable the Raspberry Pi OS userconfig service for now. This stops the code to rename user after partition resize.
This would also disable autologin (with a var/lib/userconf-pi/autologin) file, but since our set-up doesn't currently
work with renaming the user RetroPie was installed for due to some hardcoded paths on install, it's safer to bypass this functionality.
Enable getty@tty1.
Note: Have tested with RPI-Imager, which when using a local image, checks it and thinks it can be configured.
This also resolves this case where it would allow a username change.
In the future we may be able to change the few config paths that are hardcoded to allow configuration of the user via RPI-imager.
This ensures the filesystem is created with supported features if images are created on a system with a newer mkfs.ext4.
Remove metadata_csum disabling as it's no longer needed with above changes (and was added for compatibility with Jessie).
Disable 64bit ext4 feature as with the Raspberry Pi OS images.
The parameter ordering has changed - install_rp takes the parameters platform, dist, and chroot.
If platform and dist are not included an error is shown. chroot location defaults to "$md_build/chroot".
Move the default username/password setting for bullseye to the install_rp function.
Raspberry PI OS images have added a first-boot wizard to change the default username/password [1].
In order to skip this step and keep the (former) default username 'pi', add a 'userconf.txt' to preset the info needed for the default user.
[1] https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022
The speexdsp meson wrap enables armv7/neon instructions when building for armv6 (Raspberry Pi 1). This causes compilation to fail.
Patch meson.build to disable the simd option for older arm platforms (that don't have the neon platform flag).
Image files for Raspberry Pi OS buster (oldstable) and bulleye are now single files compressed with .xz instead of the zip files used previously.
Add support for decompressing xz as well as an additional check to make sure the image was extracted ok before continuing. Added return codes to the function.
Default to "buster" if no dist parameter is provided.
Raspberry Pi OS bulleye based image is now out, and is the default image so we needed to update the URL
for buster to the last archived version.
second thoughts - we actually already handle remove ssh host keys, and set autologin after. I partly misread
some error logs, and though this may have helped a situation, but actually we need the latest packages really,
and certainly when building based on older images like stretch.
This reverts commit 211fa81841.
when upstream image is out of date, some package updates can cause issues - eg udev conflicts with auto login, and openssh-server generating host keys (we don't want to ship with any keys pregenerated)
Although some of these can be circuvented, it's easier to just leave updating to the user for now - I may revisit this.
* was added due to old qemu bugs with arm1176 - but will cause issues with bins for newer cpus. Suspect it's also no longer needed but will do some testing
The RPI VC4/VC6 drivers use the kernel CMA heap allocation for GPU memory
(which defaults to 256MB on 1GB+ targets) instead of the gpu_mem allocation.
Although the gpu_mem allocation is still used, it's needed only for camera and
hardware decoders, but the default allocation (~64-76MB) is sufficient.
Without this change, we are losing ~192MB of user-addressible kernel memory
for no reason.
The Pi4 Buster recommendation is actually 256MiB but the script was creating
a much smaller boot partition (240MiB) because of two bugs:
- parted mkpart units defaults to MB not MiB for input (256MiB is 268MB)
- parted's parameters are `start` `end` not `start` `size`. We need to specify
260 as an end because the start is 4
I changed the default unit to MiB because while explicitly specifying 260MiB
is possible, specifying units on mkpart disables parted's helpful range of
sloppiness.
* rename chroot to create_chroot
* add new chroot function
* use mktemp for temporary location names when building images
* allow choosing of image path and chroot location