Skip to content

Use raspberrypi-sys-mods firstboot procedure - #5

Closed
0rax wants to merge 1 commit into
mainfrom
feature/raspberrypi-sys-mods
Closed

0rax wants to merge 1 commit into
mainfrom
feature/raspberrypi-sys-mods

Conversation

@0rax

@0rax 0rax commented Oct 6, 2022

Copy link
Copy Markdown
Owner

Since the latest update of BerryOS and within the latest revisions of Raspberry Pi OS Bullseye 2022-09-06 & 2022-09-22 (RPi-Distro/pi-gen@2022-04-04-raspios-bullseye...2022-09-22-raspios-bullseye), RPI-Distro now uses the firstboot script provided by the raspberrypi-sys-mods package. This change was implemented in RPi-Distro/pi-gen@7206ab1.

This PR updates BerryOS to use this same package for its firstboot routine to take it in line with the upstream version of RaspberryPi OS.


NOTE

This is currently untested, the new /usr/lib/raspberrypi-sys-mods/firstboot script provided by raspberrypi-sys-mods seems to apply some configuration that weren't done by the original /usr/lib/raspi-config/init_resize.sh. Those changes includes:

Another point we must verify before adding the raspberrypi-sys-mods package is the extra system configuration files shipped with it to see they real impact on BerryOS. Potential problematic files includes:

@0rax 0rax self-assigned this Oct 6, 2022
@0rax

0rax commented Jul 3, 2024

Copy link
Copy Markdown
Owner Author

An example of what config.toml can be used for is available here: https://gist.github.com/lpenz/ef21bb38a7aa12ebde17fa719a8546b5. This seems to conflict pretty heavily with cloud-init thus will not be included in the Debian 12 release of BerryOS.

If any other tweak present in the raspberrypi-sys-mods package is required, we could bring them directly here and include them at build-time (though it might cause issues if the package is installed by any dependency). We could also just add the package to our bootstrap package but not call the firstboot script, tho this still include the /etc/sudoers.d/10-pi file which I am not a fan of.

In the end the implication of not including this package should be discussed if any issues is reported that could be fixed by including it.

One thing to note, by diverging from "upstream" RaspiOS here, we might miss on some tweaks ran in this firstboot script. We may want, in the near future, create our one version of it here and include just the parts we need. This might also be required if /usr/lib/raspi-config/init_resize.sh is removed from the raspi-config package at some point as this is our current "first boot" script.

@0rax

0rax commented Jul 3, 2024

Copy link
Copy Markdown
Owner Author

I am closing this PR for now, I really don't feel good about adding this package to BerryOS right now and the implications of not adding it seems to be extremely small.

raspberrypi-sys-mods pretty much just handles:

  • partition resizing (see firstboot:141-174)
    • handled by rpi-config's init_resize.sh script for us
  • /boot/config.toml parsing and handling (see init_config)
    • which does stuff similar to cloud-init but with less granularity or features
  • adding some udev rules mostly related to I²C (see udev/rules.d
    • which seems a bit extraneous when we are mainly focusing on making a light alternative to RaspiOS, those file can be provisioned using cloud-init if needed if your deployment uses I²C
  • a small tweak related to wpa_supplicant (see firstboot:84-97)
    • our network stack and configuration if pretty different from how RaspiOS handles it, I am not sure this is needed when using netplan
  • some specific handling for NOOBS (see firstboot
    • as we are not part of NOOBS, we don't really need to handle it
  • regenerating the host system ssh keys (see firstboot:176-182)
    • this is handled by cloud-init on first-boot
  • it also adds some other system files which relates to some extremely specific edge cases

Most of those are either useless to us, conflicting with our philosophy to let cloud-init handles most of our initial provisioning or tailored to one specific use case.

@0rax 0rax closed this Jul 3, 2024
@0rax
0rax deleted the feature/raspberrypi-sys-mods branch July 5, 2024 00:35
@0rax 0rax added the enhancement New feature or request label Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant