fix(kernel-bootstrap): unify external raw container flow and remove default second disk

This commit is contained in:
vxtls 2026-03-03 08:33:19 -05:00
parent 919200478b
commit 85c389044d
4 changed files with 120 additions and 91 deletions

View file

@ -129,10 +129,8 @@ def create_configuration_file(args):
"""
config_path = os.path.join('steps', 'bootstrap.cfg')
with open(config_path, "w", encoding="utf_8") as config:
payload_required = ((args.bare_metal or args.qemu)
and not args.kernel
and not args.repo
and not args.external_sources)
kernel_bootstrap = ((args.bare_metal or args.qemu) and not args.kernel)
payload_required = kernel_bootstrap and args.external_sources and not args.repo
config.write(f"ARCH={args.arch}\n")
config.write(f"ARCH_DIR={stage0_arch_map.get(args.arch, args.arch)}\n")
config.write(f"FORCE_TIMESTAMPS={args.force_timestamps}\n")
@ -147,11 +145,8 @@ def create_configuration_file(args):
config.write(f"QEMU={args.qemu}\n")
config.write(f"BARE_METAL={args.bare_metal or (args.qemu and args.interactive)}\n")
config.write(f"BUILD_GUIX_ALSO={args.build_guix_also}\n")
if (args.bare_metal or args.qemu) and not args.kernel:
if args.repo or args.external_sources:
config.write("DISK=sdb1\n")
else:
config.write("DISK=sda\n")
if kernel_bootstrap:
config.write("DISK=sdb1\n" if args.repo else "DISK=sda\n")
config.write("KERNEL_BOOTSTRAP=True\n")
else:
config.write("DISK=sda1\n")
@ -414,11 +409,16 @@ print(shutil.which('chroot'))
path = os.path.join(args.target, os.path.relpath(generator.target_dir, args.target))
print("Please:")
print(f" 1. Take {path}.img and write it to a boot drive and then boot it.")
payload_disk = target.get_disk("payload")
if payload_disk is not None:
payload_path = os.path.join(args.target, os.path.relpath(payload_disk, args.target))
print(" 2. Take " +
f"{payload_path} and attach it as a second raw disk (/dev/sdb preferred).")
external_disk = target.get_disk("external")
if external_disk is not None:
external_path = os.path.join(args.target, os.path.relpath(external_disk, args.target))
if args.repo:
print(" 2. Take " +
f"{external_path} and attach it as a second disk (/dev/sdb preferred).")
else:
print(" 2. Take " +
f"{external_path} and attach it as a second raw container disk "
"(/dev/sdb preferred).")
else:
if args.stage0_image:
@ -472,11 +472,6 @@ print(shutil.which('chroot'))
arg_list += [
'-drive', 'file=' + target.get_disk("external") + ',format=raw',
]
payload_disk = target.get_disk("payload")
if payload_disk is not None:
arg_list += [
'-drive', 'file=' + payload_disk + ',format=raw',
]
arg_list += [
'-machine', 'kernel-irqchip=split',
'-nic', 'user,ipv6=off,model=e1000'