-
Notifications
You must be signed in to change notification settings - Fork 94
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
bootc status
doesn't work in CoreOS live ISO
#1043
Comments
Whipped up diff --git a/lib/src/cli.rs b/lib/src/cli.rs
index e7df044..a28e768 100644
--- a/lib/src/cli.rs
+++ b/lib/src/cli.rs
@@ -595,20 +595,24 @@ pub(crate) fn ensure_self_unshared_mount_namespace() -> Result<()> {
/// Acquire a locked sysroot.
/// TODO drain this and the above into SysrootLock
#[context("Acquiring sysroot")]
-pub(crate) async fn get_locked_sysroot() -> Result<ostree_ext::sysroot::SysrootLock> {
+pub(crate) async fn get_sysroot(lock: bool) -> Result<ostree_ext::sysroot::SysrootLock> {
prepare_for_write()?;
let sysroot = ostree::Sysroot::new_default();
sysroot.set_mount_namespace_in_use();
- let sysroot = ostree_ext::sysroot::SysrootLock::new_from_sysroot(&sysroot).await?;
+ let sysroot = if lock {
+ ostree_ext::sysroot::SysrootLock::new_from_sysroot(&sysroot).await?
+ } else {
+ ostree_ext::sysroot::SysrootLock::from_assumed_locked(&sysroot)
+ };
sysroot.load(gio::Cancellable::NONE)?;
Ok(sysroot)
}
/// Load global storage state, expecting that we're booted into a bootc system.
#[context("Initializing storage")]
-pub(crate) async fn get_storage() -> Result<crate::store::Storage> {
+pub(crate) async fn get_storage(lock_sysroot: bool) -> Result<crate::store::Storage> {
let global_run = Dir::open_ambient_dir("/run", cap_std::ambient_authority())?;
- let sysroot = get_locked_sysroot().await?;
+ let sysroot = get_sysroot(lock_sysroot).await?;
crate::store::Storage::new(sysroot, &global_run)
} but feels hacky to use |
Hmm, isn't there more to it? Presumably you're going to change the It may be a more targeted fix to detect when the block device under the sysroot is readonly and never lock (or attempt to remount readwrite) then. |
OK I see, the difference between rpm-ostree and bootc is that in rpm-ostree we only call That said...I suspect we've always had the issue in rpm-ostree that it will be racy for us to try to reload the state if something else is concurrently changing it. The race is probably hard to hit because we only reload after the mtime bump, so one would have to do e.g.
IOW two concurrent mutations are required. |
Having to remount
/sysroot
at all forstatus
seems dubious.The text was updated successfully, but these errors were encountered: