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

Support kexec reboot for grub2-bls and sdboot #126

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

danyspin97
Copy link
Contributor

No description provided.

lib/BlsEntry.cpp Outdated Show resolved Hide resolved
@danyspin97 danyspin97 force-pushed the sdboot-reboot branch 2 times, most recently from dc614ed to ff8b0ee Compare July 16, 2024 13:17
lib/Reboot.cpp Outdated Show resolved Hide resolved
@danyspin97 danyspin97 force-pushed the sdboot-reboot branch 3 times, most recently from c74dad1 to ed3116f Compare July 22, 2024 17:04
@danyspin97
Copy link
Contributor Author

I can confirm that this PR works now.

Copy link
Collaborator

@laenion laenion left a comment

Choose a reason for hiding this comment

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

Looks really good now, just a few nits.

lib/BlsEntry.hpp Show resolved Hide resolved
lib/BlsEntry.cpp Outdated
Comment on lines 14 to 15
std::string kernel{};
std::string initrd{};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Initialization with braces is not needed here / doesn't make any difference...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

lib/BlsEntry.cpp Outdated
std::string initrd{};
while(getline(is, str))
{
TransactionalUpdate::Util::trim(str);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are in the TransactionalUpdate namespace already (same for the other occurrences in the patch).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

lib/Reboot.cpp Outdated
kernel = efi / std::filesystem::path(kernel).relative_path();
initrd = efi / std::filesystem::path(initrd).relative_path();
}
command = "kexec --kexec-syscall-auto -l " + kernel + " --initrd=" + initrd + " --reuse-cmdline;";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume that now, with the BLS, in theory the kernel / initrd entries could also contain things like spaces, e.g. a pathname such as My System/6.9.9-1-default/initrd? Or can we be sure that the subdirectory will always be without whitespace?

Copy link
Collaborator

Choose a reason for hiding this comment

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

that is correct, FAT32 can have spaces in the directory and file names. sdbootutil does not generate them tho

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, it is better to add quotes Just in case this might happen. Fixed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But now the user could add a ' to the file or directory name ;-) If we wanted to protect ourselves, then every occurrence of ' would have to be replaced with '\''.
Otherwise I'll just merge tomorrow.

@danyspin97 danyspin97 force-pushed the sdboot-reboot branch 2 times, most recently from 8c157ff to 20cb4ae Compare July 24, 2024 08:06
@laenion laenion merged commit 0465bf4 into openSUSE:master Aug 7, 2024
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.

None yet

3 participants