Add an argument to rootfs.py to preseed bootstrap with binary packages.

This commit is contained in:
Andrius Štikonas 2022-05-28 22:59:42 +01:00
parent 0b3782d61b
commit d84bb236a4
2 changed files with 9 additions and 2 deletions

View File

@ -60,6 +60,8 @@ def main():
parser.add_argument("--no-create-config", parser.add_argument("--no-create-config",
help="Do not automatically create config file", help="Do not automatically create config file",
action="store_true") action="store_true")
parser.add_argument("-r", "--repo",
help="Path to prebuilt binary packages.", nargs=None)
# QEMU arguments # QEMU arguments
parser.add_argument("-q", "--qemu", help="Use QEMU", parser.add_argument("-q", "--qemu", help="Use QEMU",
@ -137,7 +139,8 @@ print(shutil.which('chroot'))
create_disk_image=False) create_disk_image=False)
system_a.prepare(mount_tmpfs=True, system_a.prepare(mount_tmpfs=True,
copy_sysc=True, copy_sysc=True,
create_initramfs=False) create_initramfs=False,
repo_path=args.repo)
# sysa # sysa
arch = stage0_arch_map.get(args.arch, args.arch) arch = stage0_arch_map.get(args.arch, args.arch)

View File

@ -34,7 +34,7 @@ class SysA(SysGeneral):
self.sysb_dir = sysb_dir self.sysb_dir = sysb_dir
self.sysc_tmp = sysc_tmp self.sysc_tmp = sysc_tmp
def prepare(self, mount_tmpfs, copy_sysc, create_initramfs): def prepare(self, mount_tmpfs, copy_sysc, create_initramfs, repo_path):
""" """
Prepare directory structure for System A. Prepare directory structure for System A.
We create an empty tmp directory, unpack stage0-posix. We create an empty tmp directory, unpack stage0-posix.
@ -54,6 +54,10 @@ class SysA(SysGeneral):
if copy_sysc: if copy_sysc:
self.sysc() self.sysc()
if repo_path:
repo_dir = os.path.join(self.tmp_dir, 'usr', 'src', 'repo-preseeded')
shutil.copytree(repo_path, repo_dir)
if create_initramfs: if create_initramfs:
self.make_initramfs() self.make_initramfs()