diff --git a/src/bootupd.rs b/src/bootupd.rs
index c323d68e..f5a8529d 100644
--- a/src/bootupd.rs
+++ b/src/bootupd.rs
@@ -388,8 +388,8 @@ pub(crate) fn print_status(status: &Status) -> Result<()> {
}
}
- if let Some(coreos_aleph) = coreos::get_aleph_version()? {
- println!("CoreOS aleph image ID: {}", coreos_aleph.aleph.imgid);
+ if let Some(coreos_aleph) = coreos::get_aleph_version(Path::new("/"))? {
+ println!("CoreOS aleph version: {}", coreos_aleph.aleph.version);
}
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
diff --git a/src/coreos.rs b/src/coreos.rs
index e8b91cdc..9977acef 100644
--- a/src/coreos.rs
+++ b/src/coreos.rs
@@ -6,20 +6,18 @@
* SPDX-License-Identifier: Apache-2.0
*/
-use anyhow::Result;
+use anyhow::{Context, Result};
use chrono::prelude::*;
-use openat_ext::OpenatDirExt;
use serde::{Deserialize, Serialize};
+use std::fs::File;
+use std::path::Path;
#[derive(Serialize, Deserialize, Clone, Debug, Hash, Ord, PartialOrd, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
/// See https://github.com/coreos/fedora-coreos-tracker/blob/66d7d00bedd9d5eabc7287b9577f443dcefb7c04/internals/README-internals.md#aleph-version
pub(crate) struct Aleph {
- pub(crate) build: String,
- #[serde(rename = "ref")]
- pub(crate) ostree_ref: String,
- pub(crate) ostree_commit: String,
- pub(crate) imgid: String,
+ #[serde(alias = "build")]
+ pub(crate) version: String,
}
pub(crate) struct AlephWithTimestamp {
@@ -29,21 +27,21 @@ pub(crate) struct AlephWithTimestamp {
}
/// Path to the file, see above
-const ALEPH_PATH: &str = "/sysroot/.coreos-aleph-version.json";
+const ALEPH_PATH: &str = "sysroot/.coreos-aleph-version.json";
-pub(crate) fn get_aleph_version() -> Result