-
Notifications
You must be signed in to change notification settings - Fork 148
Add efibootmgr script #3645
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
base: main
Are you sure you want to change the base?
Add efibootmgr script #3645
Conversation
6a82bf3
to
c6050d8
Compare
@@ -16,6 +16,12 @@ results are represented as ``<testsuite>`` tags, each containing a | |||
``<testcase>`` tag for the main result, along with additional | |||
``<testcase>`` tags for any subresults. | |||
|
|||
A new ``tmt-ensure-efiboot-order`` script has been added to help manage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using a bit more generic name such as tmt-boot-order
or tmt-set-boot-order
? Not sure if there are (or will be) more similar use cases, but the currently proposed name sounds very specific to efiboot
. Perhaps, in the future, we would like to support not only preserving the current one but setting a specific one? Just brainstorming...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, @psss you are the naming expert :)
fi | ||
|
||
# Get current boot entry | ||
os_boot_entry=$(efibootmgr | awk '/BootCurrent/ { print $2 }') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we already have a similar code in the tmt-reboot
script:
tmt/tmt/steps/execute/scripts/tmt-reboot
Lines 25 to 39 in 434cbe1
if [ $efi = True ]; then | |
if efibootmgr &>/dev/null ; then | |
os_boot_entry=$(efibootmgr | awk '/BootCurrent/ { print $2 }') | |
# fall back to /root/EFI_BOOT_ENTRY.TXT if it exists and BootCurrent is not available | |
if [[ -z "$os_boot_entry" && -f /root/EFI_BOOT_ENTRY.TXT ]] ; then | |
os_boot_entry=$(</root/EFI_BOOT_ENTRY.TXT) | |
fi | |
if [[ -n "$os_boot_entry" ]] ; then | |
logger -s "efibootmgr -n $os_boot_entry" | |
efibootmgr -n $os_boot_entry | |
else | |
logger -s "Could not determine value for BootNext!" | |
fi | |
fi | |
fi |
Possibly it would make sense to keep it at one place and share?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be, I just thought it would be good to have it fully independent, but no preference, especially if we'll be copying all scripts at once to guests.
Requires #3396
Pull Request Checklist