Restore persistent system path composition

This commit is contained in:
ms2k 2026-07-22 03:07:42 +09:00
commit 7aff8e542e

View file

@ -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(