canonical / cloud-init

Official upstream for the cloud-init: cloud instance initialization
https://cloud-init.io/
Other
3.01k stars 887 forks source link

feat(raspberry-pi-os): Add Raspberry Pi OS support #5827

Open paulober opened 1 month ago

paulober commented 1 month ago

This commit adds support for the Raspberry Pi OS debian based distribution. It includes a distro definition, 3 modules and integration into other systems like config generation and docs.

Proposed Commit Message

<type>(raspberry-pi-os): <summary>  Add support for Raspberry Pi OS

This commit adds support for the Raspberry Pi OS distro.
It includes a distro integration and detection including
four additional configuration modules:
- cc_rpi_userdata
- cc_rpi_interfaces
- cc_rpi_connect
- cc_netplan_nm_patch

Additional Context

It currently includes the cc_rpi_userdata module for renaming the image user and handling the setup wizard. Maybe adding the user configuration stuff to a custom add_user implementation for the first user added is a better approach here.

Also it would be great if the final_message would support commands. This would give use the option to remove the rc.local approach and print the IPs through the cloud-init system configuration.

@tdewey-rpi, @XECDesign, @ghollingworth, @will-v-pi

Test Steps

Raspberry Pi OS Images with cloud-init can be found here.

Merge type

paulober commented 1 month ago

Is there an option if a setting for rpi_interfaces has been set, to tell the power_state_change module that a reboot is required?

tdewey-rpi commented 1 month ago

Some additional context:

This PR (and the linked GitHub PRs from other repos) are part of a wider desire to move to using cloud-init as the customisation scheme for Raspberry Pi OS, with associated infrastructure in Raspberry Pi Imager to ensure we maintain feature parity (if not an increased feature set) with the current 'firstrun' style customisation scheme.

Going forward, assuming this PR is merged and our migration proceeds along happily enough, my plan is to recommend to each distro vendor supplying OS images to the Raspberry Pi Imager that they also adopt cloud-init as their customisation scheme. This may result in additional PRs adding distro features to cloud-init in a similar manner to this PR - but should absolutely improve the experience for end users across the board.

holmanb commented 2 weeks ago

There are some merge conflicts now.

paulober commented 2 weeks ago

There are some merge conflicts now.

Resolved.