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

bios.rs: implement BIOS (grub) #420

Merged
merged 9 commits into from
Feb 2, 2023
Merged

bios.rs: implement BIOS (grub) #420

merged 9 commits into from
Feb 2, 2023

Conversation

HuijingHei
Copy link
Member

@HuijingHei HuijingHei commented Dec 27, 2022

bootupd: Prepare bootupd update directory for both components

  • Prepare bootupd update directory which will save component metadata
    files for both components.

Add bios.rs and implement generate_update_metadata

  • This will generate /usr/lib/bootupd/updates/BIOS.json, which will have the version and timestamp of grub2-tools

bios.rs: implement BIOS (grub) install function

  • Add --device </dev/vda> option to install BIOS bootloader (grub)
  • If call function without --device, will only install EFI.

bios.rs: add run_update to support bootupctl update

  • This is the same action as install

bios.rs: return Skipped when run bootupctl validate for BIOS


ppc64: fix build warning

  • The fix looks really ugly. Just realize bootupd is not supported on ppc yet, maybe we will support in future.

aarch64: fix build warning


Fix #53

@openshift-ci
Copy link

openshift-ci bot commented Dec 27, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

src/bios.rs Outdated Show resolved Hide resolved
src/bios.rs Outdated Show resolved Hide resolved
src/bios.rs Outdated
}

fn validate(&self, current: &InstalledContent) -> Result<ValidationResult> {
unreachable!()
Copy link
Member

Choose a reason for hiding this comment

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

As discussed we could probably keep this unimplemented, though it should return an error or so?

Copy link
Member Author

Choose a reason for hiding this comment

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

Return Skipped for BIOS instead, does that make sense?

[root@cosa-devsh ~]# bootupctl validate
Skipped: BIOS
Validated: EFI

src/util.rs Outdated Show resolved Hide resolved
src/bios.rs Outdated Show resolved Hide resolved
src/util.rs Show resolved Hide resolved
@HuijingHei
Copy link
Member Author

Will update based on #423

@HuijingHei
Copy link
Member Author

HuijingHei commented Feb 1, 2023

Wait, I am testing on ppc64le, and there are some errors need to be fixed.

sh-5.2# cargo build --release
   Compiling bootupd v0.2.9 (/srv/bootupd)
error[E0432]: unresolved import `crate::efi`
 --> src/bootupd.rs:4:5
  |
4 | use crate::efi;
  |     ^^^^^^^^^^ no `efi` in the root

error[E0433]: failed to resolve: could not find `efi` in the crate root
  --> src/component.rs:79:34
   |
79 |         "EFI" => Box::new(crate::efi::Efi::default()),
   |                                  ^^^ could not find `efi` in the crate root

Prepare bootupd update directory which will save component metadata
files for both components.
This will generate `/usr/lib/bootupd/updates/BIOS.json`, which will
have the version and timestamp of `grub2-tools`.
- Add `--device </dev/vda>` option to install BIOS bootloader (grub)
- If call function without `--device`, will only install EFI.
This is the same action as `install`
To make CI green and will update in future patch.
@HuijingHei HuijingHei marked this pull request as ready for review February 2, 2023 07:39
Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Nice work on this!

I hadn't even realized when we started this how complex adding ppc64le would be from the conditional-compilation perspective. Thanks for plowing through all those conditionals.

I think there's some smaller things to clean up here but we can do that post-merge

Thanks so much for your work on this!

@jlebon
Copy link
Member

jlebon commented Sep 21, 2023

This merged a while back but either forgot or never noticed it. Nice work on this @HuijingHei!

@HuijingHei
Copy link
Member Author

Thanks @jlebon! Also thanks @cgwalters for lots of help!

karuboniru pushed a commit to karuboniru/karuboniru-workstation that referenced this pull request Jan 22, 2024
As bootupd supports GRUB and ppc64le since 0.2.10, we wil be able to
enable it once we enable bootupd support in Silverblue & friends.

See: coreos/bootupd#420
See: https://fedoraproject.org/wiki/Changes/FedoraSilverblueBootupd
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.

implement BIOS (grub)
3 participants