From 32c87dc2a17e8d5c78a7ffae553be59d214a04fa Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 17 Feb 2022 16:16:46 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/copy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index fb0414d5..41b0ae74 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py @@ -110,14 +110,14 @@ def copy_archive(src_repo_path, dst_repo_path, entry): gid_map.write(f'0 {gid} 1') subprocess.run(['mount', '--make-rprivate', '/'], check=True) chroot = pathlib.Path(tmpdir) / 'chroot' + chroot2 = pathlib.Path(tmpdir) / 'chroot2' upper = pathlib.Path(tmpdir) / 'upper' work = pathlib.Path(tmpdir) / 'work' - for path in [chroot,upper,work]: + for path in [chroot,chroot2,upper,work]: path.mkdir() print(f'euid={os.getuid()}', file=stderr) subprocess.run(['stat', '/', upper, work, chroot], check=True) - subprocess.run(['mount', '-t', 'tmpfs', 'tmpfs', chroot], check=True) - subprocess.run(['mount', '-t', 'overlay', 'overlay', '-o', f'lowerdir=/,upperdir={upper},workdir={work}', chroot], check=True) + subprocess.run(['mount', '-t', 'overlay', 'overlay', '-o', f'lowerdir={chroot2},upperdir={upper},workdir={work}', chroot], check=True) bindMounts = ['nix', 'run', 'proc', 'dev', 'sys', pathlib.Path(os.path.expanduser('~')).relative_to('/')] if not ":" in src_repo_path: bindMounts.append(pathlib.Path(src_repo_path).relative_to('/')) -- cgit v1.2.3