Skip to main content

get_physical_root_and_run

Function get_physical_root_and_run 

Source
fn get_physical_root_and_run() -> Result<(Dir, Dir, bool)>
Expand description

Open the physical root (/sysroot) and /run directories for a booted system.

The returned boolean is true if /sysroot is on a physically read-only medium (e.g. a live ISO) that cannot be remounted writable.

Note that ostree mounts /sysroot read-only by default even on writable systems and remounts it writable on demand, so being read-only is not by itself meaningful: we only conclude the system is read-only if a remount attempt fails and the backing block device confirms it.