Move chroot transition script inside bootstrap.

This commit is contained in:
Andrius Štikonas 2021-10-10 16:01:50 +01:00
parent 35a7df58b7
commit c6c8a1eb7f
5 changed files with 21 additions and 28 deletions

15
sysc.py
View file

@ -73,21 +73,6 @@ class SysC(SysGeneral):
if not self.chroot:
umount(self.rootfs_dir)
def chroot_transition(self, original):
"""
For chroot, transition sysa -> sysc
See create_sysc in sysb/run.sh
We skip sysb when using chroot, as sysb is entirely irrelevant
to chrooting (only for kernel shenanigans)
Copy directories from /usr (sysa) -> /usr (sysc)
"""
run('sudo', 'chown', '-R', getpass.getuser(), original)
run('sudo', 'chown', '-R', getpass.getuser(), self.rootfs_dir)
shutil.copytree(os.path.join(original, 'usr'),
os.path.join(self.rootfs_dir, 'usr'),
ignore=shutil.ignore_patterns("src"),
dirs_exist_ok=True, symlinks=True)
def deploy_scripts(self):
"""Add the scripts to the chroot"""
src_files = ['run.sh', 'run2.sh']