-
Notifications
You must be signed in to change notification settings - Fork 40
Allow to skip BIOS component installation for x86_64 #1010
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -127,16 +127,17 @@ impl Component for Bios { | |||||||||
| }) | ||||||||||
| } | ||||||||||
|
|
||||||||||
| fn generate_update_metadata(&self, sysroot_path: &str) -> Result<ContentMetadata> { | ||||||||||
| fn generate_update_metadata(&self, sysroot_path: &str) -> Result<Option<ContentMetadata>> { | ||||||||||
| let grub_install = Path::new(sysroot_path).join(GRUB_BIN); | ||||||||||
| if !grub_install.exists() { | ||||||||||
| bail!("Failed to find {:?}", grub_install); | ||||||||||
| println!("Failed to find {:?}", grub_install); | ||||||||||
| return Ok(None); | ||||||||||
|
Comment on lines
+133
to
+134
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using Note: You will need to add
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used the |
||||||||||
| } | ||||||||||
|
|
||||||||||
| // Query the rpm database and list the package and build times for /usr/sbin/grub2-install | ||||||||||
| let meta = packagesystem::query_files(sysroot_path, [&grub_install])?; | ||||||||||
| write_update_metadata(sysroot_path, self, &meta)?; | ||||||||||
| Ok(meta) | ||||||||||
| Ok(Some(meta)) | ||||||||||
| } | ||||||||||
|
|
||||||||||
| fn query_adopt(&self, devices: &Option<Vec<String>>) -> Result<Option<Adoptable>> { | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,6 +93,15 @@ pub(crate) fn install( | |
| continue; | ||
| } | ||
|
|
||
| // skip components that don't have an update metadata | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm this one is interesting. I think actually the problem is we're iterating over the static list of components, when actually I think we should just accept whatever the updated components in the updates set are to start with or so. Although it raises a different point - it would probably make sense in the future to handle the case where a component is removed. (e.g. an OS update drops out BIOS support and we would then in theory clear out the BIOS partition e.g.) And to do that, we do need to iterate over the components we know (as this is doing) and intersect them with the update set. |
||
| if component.query_update(&source_root_dir)?.is_none() { | ||
| println!( | ||
| "Skip installing component {} without update metadata", | ||
| component.name() | ||
| ); | ||
| continue; | ||
| } | ||
|
|
||
| let meta = component | ||
| .install(&source_root, dest_root, device, update_firmware) | ||
| .with_context(|| format!("installing component {}", component.name()))?; | ||
|
|
@@ -199,12 +208,18 @@ pub(crate) fn generate_update_metadata(sysroot_path: &str) -> Result<()> { | |
| std::fs::create_dir_all(&updates_dir) | ||
| .with_context(|| format!("Failed to create updates dir {:?}", &updates_dir))?; | ||
| for component in get_components().values() { | ||
| let v = component.generate_update_metadata(sysroot_path)?; | ||
| println!( | ||
| "Generated update layout for {}: {}", | ||
| component.name(), | ||
| v.version, | ||
| ); | ||
| if let Some(v) = component.generate_update_metadata(sysroot_path)? { | ||
| println!( | ||
| "Generated update layout for {}: {}", | ||
| component.name(), | ||
| v.version, | ||
| ); | ||
| } else { | ||
| println!( | ||
| "Generating update layout for {} was not possible, skipping.", | ||
| component.name(), | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| Ok(()) | ||
|
|
||
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.
How about:
Skipping, executable not found: {:?}(it's not a failure) - as you've used elsewhere in the PR