From 364db19d143c2f9fc6d2f346afa9c6d9cf6f719d Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 17 Feb 2022 16:56:51 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/copy.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'hosts') diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index 8cfcbd56..de62dfa5 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py @@ -110,14 +110,15 @@ 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' - upper = pathlib.Path(tmpdir) / 'upper' - work = pathlib.Path(tmpdir) / 'work' - for path in [chroot,upper,work]: - path.mkdir() - print(f'euid={os.getuid()}', file=stderr) - subprocess.run(['stat', '/', upper, work, chroot], check=True) - subprocess.run(['mount', '-t', 'overlay', 'overlay', '-o', f'lowerdir=/,upperdir={upper},workdir={work}', chroot], check=True) - bindMounts = ['nix', 'run', 'proc', 'dev', 'sys', pathlib.Path(os.path.expanduser('~')).relative_to('/')] + chroot.mkdir() + # upper = pathlib.Path(tmpdir) / 'upper' + # work = pathlib.Path(tmpdir) / 'work' + # for path in [chroot,upper,work]: + # path.mkdir() + # print(f'euid={os.getuid()}', file=stderr) + # subprocess.run(['stat', '/', upper, work, chroot], check=True) + # subprocess.run(['mount', '-t', 'overlay', 'overlay', '-o', f'lowerdir=/,upperdir={upper},workdir={work}', chroot], check=True) + bindMounts = ['etc', '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('/')) if 'SSH_AUTH_SOCK' in os.environ: -- cgit v1.2.3