Compare commits
3 commits
51b4f0f5f2
...
d4d6098241
Author | SHA1 | Date | |
---|---|---|---|
d4d6098241 | |||
68cbe3cd88 | |||
2ad223fa83 |
2 changed files with 9 additions and 8 deletions
|
@ -25,8 +25,8 @@ def make_image(
|
||||||
pubkey_path: str | None = None,
|
pubkey_path: str | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Make a binary bootable image."""
|
"""Make a binary bootable image."""
|
||||||
args = [
|
args: list[str | tuple[str, ...]] = [
|
||||||
("grub-mkimage",),
|
"grub-mkimage",
|
||||||
("--compress", COMPRESSION),
|
("--compress", COMPRESSION),
|
||||||
("--format", image_format),
|
("--format", image_format),
|
||||||
("--output", image_path),
|
("--output", image_path),
|
||||||
|
@ -35,6 +35,6 @@ def make_image(
|
||||||
if pubkey_path:
|
if pubkey_path:
|
||||||
args.append(("--pubkey", pubkey_path))
|
args.append(("--pubkey", pubkey_path))
|
||||||
args.extend(modules)
|
args.extend(modules)
|
||||||
if modules := MODULES.get(image_format):
|
if extra_modules := MODULES.get(image_format):
|
||||||
args.extend(modules)
|
args.extend(extra_modules)
|
||||||
ps.run(*args)
|
ps.run(*args)
|
||||||
|
|
|
@ -9,10 +9,11 @@ def get_tuples_args(*items: str | tuple[str, ...]) -> list[str]:
|
||||||
"""Turn arguments tuples into an arguments list."""
|
"""Turn arguments tuples into an arguments list."""
|
||||||
args: list[str] = []
|
args: list[str] = []
|
||||||
for item in items:
|
for item in items:
|
||||||
if type(item) is tuple:
|
match item:
|
||||||
args.extend(item)
|
case str():
|
||||||
else:
|
|
||||||
args.append(item)
|
args.append(item)
|
||||||
|
case tuple():
|
||||||
|
args.extend(item)
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue