From dde33b0ebd3ddd1645c8e80529afef129a8dca86 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 17 Feb 2022 19:27:03 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/copy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hosts/vidhar/borg/copy.py') diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index 578394cc..a1c40c98 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py @@ -103,16 +103,16 @@ def copy_archive(src_repo_path, dst_repo_path, entry): 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('/')] if os.environ.get('BORG_BASE_DIR'): - bindMounts.append(os.environ['BORG_BASE_DIR']) + bindMounts.append(os.environ['BORG_BASE_DIR'].relative_to('/')) if os.environ.get('CREDENTIALS_DIRECTORY'): - bindMounts.append(os.environ['CREDENTIALS_DIRECTORY']) + bindMounts.append(os.environ['CREDENTIALS_DIRECTORY'].relative_to('/')) if not ":" in src_repo_path: bindMounts.append(pathlib.Path(src_repo_path).relative_to('/')) if 'SSH_AUTH_SOCK' in os.environ: bindMounts.append(pathlib.Path(os.environ['SSH_AUTH_SOCK']).parent.relative_to('/')) for bindMount in bindMounts: (chroot / bindMount).mkdir(parents=True,exist_ok=True) - print(*['mount', '--bind', pathlib.Path('/') / bindMount, chroot / bindMount], file=stderr) + # print(*['mount', '--bind', pathlib.Path('/') / bindMount, chroot / bindMount], file=stderr) subprocess.run(['mount', '--bind', pathlib.Path('/') / bindMount, chroot / bindMount], check=True) os.chroot(chroot) os.chdir('/') -- cgit v1.2.3