Added install Syslinux section
This commit is contained in:
parent
89ac824d82
commit
9652aa4623
2 changed files with 20 additions and 0 deletions
|
|
@ -86,6 +86,12 @@ if __name__ == '__main__':
|
||||||
)
|
)
|
||||||
|
|
||||||
# Install syslinux
|
# Install syslinux
|
||||||
|
try_and_print(
|
||||||
|
message='Installing Syslinux...',
|
||||||
|
function=install_syslinux,
|
||||||
|
ufd_dev=ufd_dev,
|
||||||
|
use_mbr=args['--use-mbr'],
|
||||||
|
)
|
||||||
|
|
||||||
# Hide items
|
# Hide items
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,20 @@ def get_user_name():
|
||||||
return user
|
return user
|
||||||
|
|
||||||
|
|
||||||
|
def install_syslinux(ufd_dev, use_mbr):
|
||||||
|
"""Install Syslinux to UFD."""
|
||||||
|
cmd = [
|
||||||
|
'dd',
|
||||||
|
'bs=440',
|
||||||
|
'count=1',
|
||||||
|
'if=/usr/lib/syslinux/bios/{}.bin'.format(
|
||||||
|
'mbr' if use_mbr else 'gptmbr',
|
||||||
|
),
|
||||||
|
'of={}'.format(ufd_dev),
|
||||||
|
]
|
||||||
|
run_program(cmd)
|
||||||
|
|
||||||
|
|
||||||
def is_valid_path(path_obj, path_type):
|
def is_valid_path(path_obj, path_type):
|
||||||
"""Verify path_obj is valid by type, returns bool."""
|
"""Verify path_obj is valid by type, returns bool."""
|
||||||
valid_path = False
|
valid_path = False
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue