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

systemd: stop building gpt-auto-generator to avoid remounting /boot #3591

Merged

Conversation

markusboehme
Copy link
Member

Issue number:

Closes #3539

Description of changes:

Stop building systemd-gpt-auto-generator. That generator creates (auto)mount units based on partition GUIDs that interfere with prairiedog mounting the BOTTLEROCKET-BOOT partition at /boot. Please see the commit message for details.

Testing done:

Booting metal-dev on x86_64 via BIOS, waiting a few minutes, checking the contents of /boot.

  • Without this change, the ESP is mounted at /boot eventually.
  • With this change, the BOTTLEROCKET-BOOT partition identified by prairiedog remains mounted at /boot.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

During boot prairiedog figures out which partition bank is in use and
mounts the correct boot partition containing the kernel binary and
configuration at /boot. When an x86 system booted via BIOS/CSM, it was
observed that at some point after boot the EFI System Partition would be
mounted at /boot instead.

The cause for the unexpected remount is systemd-gpt-auto-generator, a
generator running during systemd start that creates mount and automount
units for well-known partition GUIDs. This undoes the work previously
performed by prairiedog. Convincing gpt-auto-generator to do right by
Bottlerocket would involve changing partition GUIDs and implementing
logic for the GPT priority fields. Alternatively, gpt-auto-generator can
be disabled at boot via the `systemd.gpt_auto=0` kernel command line
option, leaving the work of mounting partitions to prairiedog and other
already existing mount units.

Since we would disable the gpt-auto-generator via the kernel command
line for all variants, we might as well stop building and shipping it.
Add a local patch to allow selecting/deselecting gpt-auto-generator at
build-time and actually deselect it.

Signed-off-by: Markus Boehme <markubo@amazon.com>
@markusboehme markusboehme merged commit b44cb90 into bottlerocket-os:develop Nov 20, 2023
46 checks passed
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.

Cannot find kernel image or kernel config in /boot some time after boot
3 participants