code: def _setup_root_filesystem(self, root_dir):
          
          root_dir = root_dir.encode()
  
          # Create an empty proc folder into the root dir. The grandchild still needs a view of
          # the old /proc, therefore we do not mount a fresh /proc here.
          proc_base = os.path.join(root_dir, b"proc")
          util.makedirs(proc_base, exist_ok=True)
  
          dev_base = os.path.join(root_dir, b"dev")
          util.makedirs(dev_base, exist_ok=True)
  
          # Create a copy of the host's dev- and proc-mountpoints.
          # They are marked as private in order to not being changed
          # by existing mounts during run execution.
          container.make_bind_mount(b"/dev/", dev_base, recursive=True, private=True)
          container.make_bind_mount(b"/proc/", proc_base, recursive=True, private=True)
  
          os.chroot(root_dir)
docs: Setup the filesystem layout in the given root directory.
          Create a copy of the existing proc- and dev-mountpoints in the specified root
          directory. Afterwards we chroot into it.
  
          @param root_dir: The path of the root directory that is used to execute the process.