"Mounting" files in the chroot, in addition to directories
Dependencies
- [2]
ODUDDQRYAdding the OCaml interface - [3]
BDEVQIAUHandle cyclic Ubuntu dependencies - [4]
NWEGAWPPMounting /proc, /sys and /dev in the chroot
Change contents
- replacement in src/container.rs at line 500
std::fs::create_dir_all(&guest).unwrap();debug!("created {:?} to {:?}", host, guest);match mount::Mount::bind(host, guest.to_str().unwrap()) {Ok(m) => std::mem::forget(m),Err(e) => error!("{e:?}"),}debug!("mounted {:?}", guest);let meta = std::fs::metadata(&host)?; - edit in src/container.rs at line 513
if meta.is_dir() {std::fs::create_dir_all(&guest).unwrap();debug!("created {:?} to {:?}", host, guest);match mount::Mount::bind(host, guest.to_str().unwrap()) {Ok(m) => std::mem::forget(m),Err(e) => error!("{e:?}"),}debug!("mounted {:?}", guest);} else if meta.is_file() {debug!("hardlinking file {:?}", guest);std::fs::hard_link(&host, &guest)?;}