lint grub
This commit is contained in:
parent
a4f49d6ac0
commit
c7db231dc2
1 changed files with 14 additions and 14 deletions
|
@ -1,17 +1,17 @@
|
||||||
import cmd
|
import cmd
|
||||||
import ps
|
import ps
|
||||||
|
|
||||||
cmd.need('grub-mkimage')
|
cmd.need("grub-mkimage")
|
||||||
|
|
||||||
COMPRESSION = 'xz'
|
COMPRESSION = "xz"
|
||||||
ENV_BYTES = 1024
|
ENV_BYTES = 1024
|
||||||
ENV_COMMENT = '#'
|
ENV_COMMENT = "#"
|
||||||
ENV_HEADER = f'''{ENV_COMMENT} GRUB Environment Block
|
ENV_HEADER = f"""{ENV_COMMENT} GRUB Environment Block
|
||||||
'''
|
"""
|
||||||
MODULES = {
|
MODULES = {
|
||||||
'i386-pc': [
|
"i386-pc": [
|
||||||
('biosdisk',),
|
("biosdisk",),
|
||||||
('ntldr',),
|
("ntldr",),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,14 +19,14 @@ MODULES = {
|
||||||
def make_image(image_format: str, image_path: str, modules: list[str],
|
def make_image(image_format: str, image_path: str, modules: list[str],
|
||||||
memdisk_path: str, pubkey_path: str = None) -> None:
|
memdisk_path: str, pubkey_path: str = None) -> None:
|
||||||
args = [
|
args = [
|
||||||
('grub-mkimage',),
|
("grub-mkimage",),
|
||||||
('--compress', COMPRESSION),
|
("--compress", COMPRESSION),
|
||||||
('--format', image_format),
|
("--format", image_format),
|
||||||
('--output', image_path),
|
("--output", image_path),
|
||||||
('--memdisk', memdisk_path),
|
("--memdisk", memdisk_path),
|
||||||
]
|
]
|
||||||
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, None):
|
if modules := MODULES.get(image_format, None):
|
||||||
args.extend(modules)
|
args.extend(modules)
|
||||||
|
|
Loading…
Reference in a new issue