Restore persistent system path composition
This commit is contained in:
parent
84bb22a7db
commit
7aff8e542e
1 changed files with 338 additions and 30 deletions
|
|
@ -137,7 +137,28 @@ fn run() -> io::Result<()> {
|
|||
},
|
||||
)
|
||||
.map_err(io::Error::other)?;
|
||||
let runtime_targets = [
|
||||
PathBuf::from("etc/resolv.conf"),
|
||||
PathBuf::from("etc/hosts"),
|
||||
PathBuf::from("etc/hostname"),
|
||||
];
|
||||
runtime_mount
|
||||
.require_persistent_destinations(&[PathBuf::from("usr"), PathBuf::from("etc")])
|
||||
.map_err(io::Error::other)?;
|
||||
runtime_mount
|
||||
.require_transient_override_targets(&runtime_targets)
|
||||
.map_err(io::Error::other)?;
|
||||
fs::write(layout.merged().join("etc/hosts"), b"stale")?;
|
||||
if runtime_mount
|
||||
.require_transient_override_targets(&runtime_targets)
|
||||
.is_ok()
|
||||
{
|
||||
return Err(io::Error::other(
|
||||
"upper runtime-file entry survived transient override preflight",
|
||||
));
|
||||
}
|
||||
runtime_mount.unmount().map_err(io::Error::other)?;
|
||||
fs::remove_file(layout.upper().join("etc/hosts"))?;
|
||||
|
||||
let first = acquire(&layout, &artifact)?;
|
||||
fs::write(
|
||||
|
|
|
|||
Loading…
Reference in a new issue