Skip to content

Image creation changes for bullseye#3739

Merged
joolswills merged 10 commits intoRetroPie:masterfrom
joolswills:image_bullseye
Aug 15, 2023
Merged

Image creation changes for bullseye#3739
joolswills merged 10 commits intoRetroPie:masterfrom
joolswills:image_bullseye

Conversation

@joolswills
Copy link
Copy Markdown
Member

@joolswills joolswills commented Jul 30, 2023

This PR includes some reworking of the image module for compatibility with bullseye and easier maintenance. Changes include (More information in the individual commits):

  • add distribution parameter to install_rp
  • only set gpu_mem on buster for rpi1-3
  • use fat32 for boot partition and remove unneeded boot flag
  • use the mke2fs config from the chroot for ext4 filesystem
  • set password and disable userconfig in chroot
  • disable 64bit kernel
  • build additional rpi3 images for bullseye
  • rework logic to use ini configuration for distributions
  • use "dmsetup remove" to remove device mapper files
  • use bootfs for boot partition name

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.
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.
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.
@joolswills joolswills force-pushed the image_bullseye branch 2 times, most recently from 2cf87db to cbeb57b Compare August 7, 2023 18:58
For bullseye we have separate binaries for the rpi3.

Adjust image naming accordingly.
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)
kpartx doesn't seem to reliably remove the loopback device mapper files it creates.
@joolswills joolswills marked this pull request as ready for review August 8, 2023 18:11
@cmitu
Copy link
Copy Markdown
Contributor

cmitu commented Aug 9, 2023

Looks good, but I have no testing bed at the moment. 2 things that come to mind after looking at the changes:

  1. The boot partition is labeled bootfs since RPi-Distro/pi-gen@5d2c6f3 for Bullseye images.
  2. The arm_64bit option is necessary only for the Pi4 systems, so maybe can be moved earlier in the pi4 test.

@joolswills
Copy link
Copy Markdown
Member Author

Thanks.

1. The `boot` partition is labeled `bootfs` since [RPi-Distro/pi-gen@5d2c6f3](https://github.com/RPi-Distro/pi-gen/commit/5d2c6f31cefc7710e3bbc44012b9ffb843294e34)  for Bullseye images.

I can change this to the most recent naming - it doesn't actually matter though as it's referred to by partition id in fstab etc.

2. The `arm_64bit` option is necessary only for the Pi4 systems, so maybe can be moved earlier in the `pi4` test.

As it doesn't do any harm for other models, I decided it's easiest just to include it for all.

@joolswills joolswills merged commit 722ae84 into RetroPie:master Aug 15, 2023
@w1ndg
Copy link
Copy Markdown

w1ndg commented Aug 21, 2023

I was testing the latest Buster weekly image for RPi4/Pi400 and in config.txt file, it havegpu_mem settings. I report it just in case that this is a issue with the image building process. Thanks.

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
gpu_mem_256=128
gpu_mem_512=256
gpu_mem_1024=256
overscan_scale=1
arm_64bit=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants