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

Add safe grub embedded space inhibitor #17

Merged
merged 8 commits into from
Jun 20, 2024

Conversation

Monstrofil
Copy link
Collaborator

This PR cherry-picks changes from upstream that:

  • add inhibitor for legacy grub (NOT grub2)
  • add inhibitor for old disk partitions which do not have enough space for grub2 installation.

Both changes should decrease amount of machines that are "briked" during elevation.

mhecko and others added 6 commits June 13, 2024 13:47
Adds a new actor checking for whether any of the GRUB devices
have the old GRUB Legacy installed. If any of such devices
is detected, the upgrade is inhibited. The GRUB Legacy is detected
by searching for the string 'GRUB version 0.94' in `file -s`
of the device.

(cherry picked from commit 8fe2a2d)
The new message informs the useir will happen (they will boot into the old RHEL's kernel) so they
understand why they need to run the remediation.

jira: https://issues.redhat.com/browse/RHEL-29683

(cherry picked from commit 6d05575)
Check that the first partition starts at least at 1MiB (2048 cylinders),
as too small first-partition offsets lead to failures when doing
grub2-install. The limit (1MiB) has been chosen as it is a common
value set by the disk formatting tools nowadays.

jira: https://issues.redhat.com/browse/RHEL-3341
(cherry picked from commit ea6cd79)
This is extension of the previous commit. The original problem that
we are trying to resolve is to be sure the embedding area (MBR gap)
has expected size. This is irrelevant in case of GPT partition table
is used on a device. The fdisk output format is in case of GPT
disk label different, which breaks the parsing, resulting in empty
list of partitions in related GRUBDevicePartitionLayout msg.

For now, let's skip produce of msgs for "GPT devices". As a seatbelt,
ignore processing of messages with empty partitions field, expecting
that such a device does not contain MBR. We want to prevent false
positive inhibitors (and FP blocking errors). We expect that total
number of machines with small embedding area is very minor in total
numbers, so even if we would miss something (which is not expected
now to our best knowledge) it's still good trade-off as the major
goal is to reduce number of machines that have problems with the
in-place upgrade.

The solution can be updated in future if there is a reason for it.

(cherry picked from commit 683176d)
newer versions of leapp deprecated get_grub_device and use
get_grub_devices instead which support raid, etc

our version does not support multiple grub devices,
so use legacy functions instead
Copy link

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergable.
If you want to re-run tests or request review, you can use following commands as a comment:

  • leapp-ci build to run copr build and e2e tests in OAMG CI
  • review please to notify leapp developers of review request

Please open ticket in case you experience technical problem with the CI. (RH internal only)

Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra.

@prilr prilr merged commit c887b0e into cloudlinux Jun 20, 2024
@prilr prilr deleted the clos-2610-add-safe-grub-space-inhibitor branch June 20, 2024 08:55
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.

5 participants