mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-23 11:36:32 +01:00
fix(rootfs): reuse stage0 work-image flow for fresh qemu break-after and drop forced ext4 mount type
This commit is contained in:
parent
c55f989e3c
commit
c921403c06
1 changed files with 14 additions and 5 deletions
19
rootfs.py
19
rootfs.py
|
|
@ -72,7 +72,6 @@ def update_stage0_image(image_path,
|
||||||
try:
|
try:
|
||||||
run_as_root(
|
run_as_root(
|
||||||
"mount",
|
"mount",
|
||||||
"-t", "ext4",
|
|
||||||
"-o", "loop,offset=1073741824",
|
"-o", "loop,offset=1073741824",
|
||||||
image_path,
|
image_path,
|
||||||
mountpoint,
|
mountpoint,
|
||||||
|
|
@ -362,7 +361,7 @@ def main():
|
||||||
parser.add_argument("--internal-ci-break-after",
|
parser.add_argument("--internal-ci-break-after",
|
||||||
help="Insert a temporary jump: break after a build step "
|
help="Insert a temporary jump: break after a build step "
|
||||||
"using 'steps:<name>' or 'steps-guix:<name>' "
|
"using 'steps:<name>' or 'steps-guix:<name>' "
|
||||||
"for --stage0-image resume runs.")
|
"for --stage0-image resume runs and fresh --qemu kernel-bootstrap runs.")
|
||||||
parser.add_argument("-s", "--swap", help="Swap space to allocate in Linux",
|
parser.add_argument("-s", "--swap", help="Swap space to allocate in Linux",
|
||||||
default=0)
|
default=0)
|
||||||
|
|
||||||
|
|
@ -441,8 +440,8 @@ def main():
|
||||||
break_scope, _ = parse_internal_ci_break_after(args.internal_ci_break_after)
|
break_scope, _ = parse_internal_ci_break_after(args.internal_ci_break_after)
|
||||||
if break_scope == "steps-guix" and not args.build_guix_also:
|
if break_scope == "steps-guix" and not args.build_guix_also:
|
||||||
raise ValueError("--internal-ci-break-after steps-guix:* requires --build-guix-also.")
|
raise ValueError("--internal-ci-break-after steps-guix:* requires --build-guix-also.")
|
||||||
if not args.qemu or not args.stage0_image:
|
if not args.qemu:
|
||||||
raise ValueError("--internal-ci-break-after currently requires --stage0-image with --qemu.")
|
raise ValueError("--internal-ci-break-after currently requires --qemu.")
|
||||||
if args.kernel:
|
if args.kernel:
|
||||||
raise ValueError("--internal-ci-break-after cannot be used with --kernel.")
|
raise ValueError("--internal-ci-break-after cannot be used with --kernel.")
|
||||||
|
|
||||||
|
|
@ -624,11 +623,21 @@ print(shutil.which('chroot'))
|
||||||
'root=/dev/sda1 rootfstype=ext3 init=/init rw']
|
'root=/dev/sda1 rootfstype=ext3 init=/init rw']
|
||||||
else:
|
else:
|
||||||
generator.prepare(target, kernel_bootstrap=True, target_size=size)
|
generator.prepare(target, kernel_bootstrap=True, target_size=size)
|
||||||
|
boot_image = generator.target_dir + '.img'
|
||||||
|
if args.internal_ci_break_after:
|
||||||
|
boot_image = prepare_stage0_work_image(
|
||||||
|
boot_image,
|
||||||
|
target.path,
|
||||||
|
args.build_guix_also,
|
||||||
|
mirrors=args.mirrors,
|
||||||
|
internal_ci=args.internal_ci,
|
||||||
|
internal_ci_break_after=args.internal_ci_break_after,
|
||||||
|
)
|
||||||
arg_list = [
|
arg_list = [
|
||||||
'-enable-kvm',
|
'-enable-kvm',
|
||||||
'-m', str(args.qemu_ram) + 'M',
|
'-m', str(args.qemu_ram) + 'M',
|
||||||
'-smp', str(args.cores),
|
'-smp', str(args.cores),
|
||||||
'-drive', 'file=' + generator.target_dir + '.img' + ',format=raw'
|
'-drive', 'file=' + boot_image + ',format=raw'
|
||||||
]
|
]
|
||||||
if target.get_disk("external") is not None:
|
if target.get_disk("external") is not None:
|
||||||
arg_list += [
|
arg_list += [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue