Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

paulober
Copy link

@paulober paulober commented Oct 16, 2024

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.

  • I have signed the CLA: https://ubuntu.com/legal/contributors
  • I have added my Github username to tools/.github-cla-signers
  • I have included a comprehensive commit message using the guide below
  • I have added unit tests to cover the new behavior under tests/unittests/
    • Test files should map to source files i.e. a source file cloudinit/example.py should be tested by tests/unittests/test_example.py
    • Run unit tests with tox -e py3
  • I have kept the change small, avoiding unnecessary whitespace or non-functional changes.
  • I have added a reference to issues that this PR relates to in the PR message
  • I have updated the documentation with the changed behavior.
    • If the change doesn't change the user interface and is trivial, this step may be skipped.
    • Cloud-config documentation is generated from the jsonschema.
    • Generate docs with tox -e doc.

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

Tested with custom Raspberry Pi OS image.
Will add more

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@github-actions github-actions bot added the documentation This Pull Request changes documentation label Oct 16, 2024
@holmanb holmanb added the CLA signed The submitter of the PR has signed the CLA label Oct 16, 2024
@paulober paulober force-pushed the raspios-support branch 2 times, most recently from c475d72 to 683ffc8 Compare October 17, 2024 08:34
@paulober paulober marked this pull request as ready for review October 17, 2024 08:41
@paulober
Copy link
Author

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
Copy link

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.

@@ -305,6 +320,11 @@ system_info:
{% elif variant == "openmandriva" %}
network:
renderers: ['network-manager', 'networkd']
{% elif variant == "raspberry-pi-os" %}
network:
dhcp_client_priority: [dhclient]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream dhclient is abandoned. Is raspberry-pi-os's plan to support it forever?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was included as an error, and dhclient is not actually used by Raspberry Pi OS - instead, we use network-manager's built in DHCP client. I believe this has been corrected in the latest version of this PR.

{% elif variant == "raspberry-pi-os" %}
network:
dhcp_client_priority: [dhclient]
renderers: ['netplan', 'network-manager', 'networkd', 'eni']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which of these does raspberry-pi-os support and plan to use?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which of these does raspberry-pi-os support and plan to use?

In the updated PR, this has been reduced to netplan & network-manager, both of which we want to offer.

@paulober paulober force-pushed the raspios-support branch 2 times, most recently from fcd247a to 9bb2b18 Compare October 18, 2024 10:42
@holmanb
Copy link
Member

holmanb commented Nov 12, 2024

There are some merge conflicts now.

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

Signed-off-by: paulober <44974737+paulober@users.noreply.github.com>
Signed-off-by: paulober <44974737+paulober@users.noreply.github.com>
Signed-off-by: paulober <44974737+paulober@users.noreply.github.com>
Signed-off-by: paulober <44974737+paulober@users.noreply.github.com>
Signed-off-by: paulober <44974737+paulober@users.noreply.github.com>
@paulober
Copy link
Author

There are some merge conflicts now.

Resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA signed The submitter of the PR has signed the CLA documentation This Pull Request changes documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants