Parse the systemd major version from `bootctl --version` output, whose first line looks like `systemd 259 (259.5-0ubuntu3)`.
(output: &str)
| 345 | /// Parse the systemd major version from `bootctl --version` output, whose first |
| 346 | /// line looks like `systemd 259 (259.5-0ubuntu3)`. |
| 347 | fn parse_systemd_version(output: &str) -> Result<u32> { |
| 348 | output |
| 349 | .split_whitespace() |
| 350 | .nth(1) |
| 351 | .and_then(|s| s.parse::<u32>().ok()) |
| 352 | .ok_or_else(|| { |
| 353 | anyhow!("Could not parse systemd version from bootctl --version: {output:?}") |
| 354 | }) |
| 355 | } |
| 356 | |
| 357 | #[context("Installing bootloader using zipl")] |
| 358 | pub(crate) fn install_via_zipl(device: &bootc_blockdev::Device, boot_uuid: &str) -> Result<()> { |
no outgoing calls
no test coverage detected