flash: add write-efi-boot-entries flag
This commit is contained in:
@@ -85,6 +85,7 @@ def flash_machine(
|
|||||||
disks: dict[str, str],
|
disks: dict[str, str],
|
||||||
system_config: dict[str, Any],
|
system_config: dict[str, Any],
|
||||||
dry_run: bool,
|
dry_run: bool,
|
||||||
|
write_efi_boot_entries: bool,
|
||||||
debug: bool,
|
debug: bool,
|
||||||
extra_args: list[str] = [],
|
extra_args: list[str] = [],
|
||||||
) -> None:
|
) -> None:
|
||||||
@@ -113,6 +114,8 @@ def flash_machine(
|
|||||||
disko_install.append("sudo")
|
disko_install.append("sudo")
|
||||||
|
|
||||||
disko_install.append("disko-install")
|
disko_install.append("disko-install")
|
||||||
|
if write_efi_boot_entries:
|
||||||
|
disko_install.append("--write-efi-boot-entries")
|
||||||
if dry_run:
|
if dry_run:
|
||||||
disko_install.append("--dry-run")
|
disko_install.append("--dry-run")
|
||||||
if debug:
|
if debug:
|
||||||
@@ -183,6 +186,7 @@ def flash_command(args: argparse.Namespace) -> None:
|
|||||||
mode=args.mode,
|
mode=args.mode,
|
||||||
language=args.lang,
|
language=args.lang,
|
||||||
keymap=args.keymap,
|
keymap=args.keymap,
|
||||||
|
write_efi_boot_entries=args.write_efi_boot_entries,
|
||||||
nix_options=args.options,
|
nix_options=args.options,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -239,6 +243,8 @@ def flash_command(args: argparse.Namespace) -> None:
|
|||||||
system_config=extra_config,
|
system_config=extra_config,
|
||||||
dry_run=opts.dry_run,
|
dry_run=opts.dry_run,
|
||||||
debug=opts.debug,
|
debug=opts.debug,
|
||||||
|
write_efi_boot_entries=opts.write_efi_boot_entries,
|
||||||
|
extra_args=opts.nix_options,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -301,4 +307,16 @@ def register_parser(parser: argparse.ArgumentParser) -> None:
|
|||||||
default=False,
|
default=False,
|
||||||
action="store_true",
|
action="store_true",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--write-efi-boot-entries",
|
||||||
|
help=textwrap.dedent(
|
||||||
|
"""
|
||||||
|
Write EFI boot entries to the NVRAM of the system for the installed system.
|
||||||
|
Specify this option if you plan to boot from this disk on the current machine,
|
||||||
|
but not if you plan to move the disk to another machine.
|
||||||
|
"""
|
||||||
|
).strip(),
|
||||||
|
default=False,
|
||||||
|
action="store_true",
|
||||||
|
)
|
||||||
parser.set_defaults(func=flash_command)
|
parser.set_defaults(func=flash_command)
|
||||||
|
|||||||
Reference in New Issue
Block a user