Skip to main content

sysroot_is_read_only

Function sysroot_is_read_only 

Source
fn sysroot_is_read_only(d: &Dir) -> Result<bool>
Expand description

Determine whether /sysroot (given as d) is on a physically read-only block device, remounting it read-write as a side effect when necessary.

ostree mounts /sysroot read-only by default even on writable systems and remounts it writable on demand, so the read-only mount flag alone is not meaningful. The authoritative signal is the backing block device’s read-only flag, which is set for a live ISO (a read-only loop device over an immutable rootfs image) and propagates from a whole disk to its partitions. We check that first and avoid even attempting a remount that is bound to fail.