Add early preseed
Speeds up development cycle, allows for the pre-kaem stages to be extracted as a tarball
This commit is contained in:
parent
d91deb50c9
commit
6f76fd2071
|
@ -69,6 +69,8 @@ def main():
|
|||
action="store_true")
|
||||
parser.add_argument("-r", "--repo",
|
||||
help="Path to prebuilt binary packages.", nargs=None)
|
||||
parser.add_argument("--early-preseed",
|
||||
help="Skip early stages of live-bootstrap.", nargs=None)
|
||||
|
||||
# QEMU arguments
|
||||
parser.add_argument("-q", "--qemu", help="Use QEMU",
|
||||
|
@ -126,7 +128,8 @@ def main():
|
|||
tmpdir=args.tmpdir, external_sources=args.external_sources)
|
||||
system_b = SysB(arch=args.arch, preserve_tmp=args.preserve)
|
||||
system_a = SysA(arch=args.arch, preserve_tmp=args.preserve,
|
||||
tmpdir=args.tmpdir, external_sources=args.external_sources,
|
||||
early_preseed=args.early_preseed, tmpdir=args.tmpdir,
|
||||
external_sources=args.external_sources,
|
||||
sysb_dir=system_b.sys_dir, sysc_dir=system_c.sys_dir)
|
||||
|
||||
if args.tmpdir is not None:
|
||||
|
|
14
sysa.py
14
sysa.py
|
@ -9,6 +9,7 @@
|
|||
import os
|
||||
from distutils.dir_util import copy_tree
|
||||
import shutil
|
||||
import tarfile
|
||||
|
||||
from lib.sysgeneral import SysGeneral, stage0_arch_map
|
||||
|
||||
|
@ -18,10 +19,11 @@ class SysA(SysGeneral):
|
|||
Class responsible for preparing sources for System A.
|
||||
"""
|
||||
# pylint: disable=too-many-instance-attributes,too-many-arguments
|
||||
def __init__(self, arch, preserve_tmp, external_sources, tmpdir, sysb_dir, sysc_dir):
|
||||
def __init__(self, arch, preserve_tmp, external_sources, early_preseed, tmpdir, sysb_dir, sysc_dir):
|
||||
self.git_dir = os.path.dirname(os.path.join(__file__))
|
||||
self.arch = arch
|
||||
self.preserve_tmp = preserve_tmp
|
||||
self.early_preseed = early_preseed
|
||||
|
||||
self.sys_dir = os.path.join(self.git_dir, 'sysa')
|
||||
if tmpdir is None:
|
||||
|
@ -46,7 +48,15 @@ class SysA(SysGeneral):
|
|||
else:
|
||||
os.mkdir(self.tmp_dir)
|
||||
|
||||
self.stage0_posix()
|
||||
if self.early_preseed:
|
||||
# Extract tar containing preseed
|
||||
with tarfile.open(self.early_preseed, "r") as seed:
|
||||
seed.extractall(self.tmp_dir)
|
||||
shutil.copy2(os.path.join(self.sys_dir, 'base-preseeded.kaem'),
|
||||
os.path.join(self.tmp_dir, 'kaem.x86'))
|
||||
else:
|
||||
self.stage0_posix()
|
||||
|
||||
self.sysa()
|
||||
|
||||
# sysb must be added to sysa as it is another initramfs stage
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/sh
|
||||
|
||||
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
|
||||
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2020-2022 fosslinux <fosslinux@aussies.space>
|
||||
# SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
set -ex
|
||||
|
||||
# Set commonly used variables
|
||||
sysa=/sysa
|
||||
distfiles=/sysa/distfiles
|
||||
prefix=/usr
|
||||
bindir=${prefix}/bin
|
||||
libdir=${libdir}/mes
|
||||
incdir=${prefix}/include
|
||||
srcdir=${prefix}/src
|
||||
TMPDIR=/tmp # tmpdir is needed for patch to work
|
||||
PATH=${bindir}
|
||||
|
||||
cd ${sysa}
|
||||
|
||||
exec bash run.sh
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/usr/bin/kaem -f /sysa/after-preseeded.kaem
|
Loading…
Reference in New Issue