MCPcopy Create free account
hub / github.com/bootc-dev/bootc / parse_systemd_version

Function parse_systemd_version

crates/lib/src/bootloader.rs:347–355  ·  view source on GitHub ↗

Parse the systemd major version from `bootctl --version` output, whose first line looks like `systemd 259 (259.5-0ubuntu3)`.

(output: &str)

Source from the content-addressed store, hash-verified

345/// Parse the systemd major version from `bootctl --version` output, whose first
346/// line looks like `systemd 259 (259.5-0ubuntu3)`.
347fn 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")]
358pub(crate) fn install_via_zipl(device: &bootc_blockdev::Device, boot_uuid: &str) -> Result<()> {

Callers 1

bootctl_systemd_versionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected