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

View File

@ -34,7 +34,7 @@ class SysA(SysGeneral):
self.sysb_dir = sysb_dir
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.
We create an empty tmp directory, unpack stage0-posix.
@ -54,6 +54,10 @@ class SysA(SysGeneral):
if copy_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:
self.make_initramfs()