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

OpenShift: Improve EFI code in sno-finish.sh #789

Merged
merged 3 commits into from
Feb 27, 2025
Merged

Conversation

Akrog
Copy link
Contributor

@Akrog Akrog commented Feb 26, 2025

This PR makes a couple of changes to the sno-finish.sh script related to the EFI entries:

  • We start cleaning RHCOS entries, in case we are reusing the same node from a previous deployment.
  • Support more than 10 EFI entries (in case we have garbage)
  • Remove unnecessary $NUM at the end of the EFI deletion

If we use the same host to redeploy an OpenShift cluster we'll end up
with a long list of RHCOS entries in EFI.

With this patch we clean not only the DVD and CD entry but also any
RHCOS entry previously created.

This way only the newly RHCOS created entry will be left.
When cleaning EFI entries we are using:

```
efibootmgr -b 000$NUM -B $NUM
```

But according to the documentation the last $NUM is not necessary:

```
       -b | --bootnum XXXX
              Modify BootXXXX (hex).

       -B | --delete-bootnum
              Delete bootnum.
```

So we just remove it.
Current code in `sno-finish.sh` assumes there can never be more than 10
entries, which is not correct.

If we've done a lot of retries deploying OpenShift on the same node we
may have more than 10 EFI entries.

With this patch we change the regex used to get the boot number as an
hexadecimal 4 digits entry.
@karmab karmab merged commit 383584f into karmab:main Feb 27, 2025
1 check 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.

2 participants