Include /proc in chroot mounts
This commit is contained in:
parent
2608f38d64
commit
fcadde057e
|
@ -558,6 +558,15 @@ def create_vm(
|
|||
f"Failed to mount sysfs onto {temp_dir}/sys for chroot: {stderr}"
|
||||
)
|
||||
|
||||
# Bind mount /proc to the chroot location /proc
|
||||
retcode, stdout, stderr = pvc_common.run_os_command(
|
||||
f"mount --bind --options rw /proc {temp_dir}/proc"
|
||||
)
|
||||
if retcode:
|
||||
raise ProvisioningError(
|
||||
f"Failed to mount procfs onto {temp_dir}/proc for chroot: {stderr}"
|
||||
)
|
||||
|
||||
print("Chroot environment prepared successfully")
|
||||
|
||||
def general_cleanup():
|
||||
|
@ -576,6 +585,10 @@ def create_vm(
|
|||
retcode, stdout, stderr = pvc_common.run_os_command(
|
||||
f"umount {temp_dir}/sys"
|
||||
)
|
||||
# Unmount bind-mounted procfs on the chroot
|
||||
retcode, stdout, stderr = pvc_common.run_os_command(
|
||||
f"umount {temp_dir}/proc"
|
||||
)
|
||||
# Unmount bind-mounted tmpfs on the chroot
|
||||
retcode, stdout, stderr = pvc_common.run_os_command(
|
||||
f"umount {temp_dir}/tmp"
|
||||
|
|
Loading…
Reference in New Issue