Added mount and unmount sections
This commit is contained in:
parent
7ee04060d8
commit
26aca0df9f
2 changed files with 20 additions and 5 deletions
|
|
@ -56,9 +56,13 @@ if __name__ == '__main__':
|
||||||
if not args['--update']:
|
if not args['--update']:
|
||||||
prep_device(ufd_dev, UFD_LABEL, use_mbr=args['--use-mbr'])
|
prep_device(ufd_dev, UFD_LABEL, use_mbr=args['--use-mbr'])
|
||||||
|
|
||||||
# TODO: DELETEME
|
# Mount UFD
|
||||||
print_success("It's go-time!")
|
try_and_print(
|
||||||
exit_script()
|
message='Mounting UFD...',
|
||||||
|
function=mount,
|
||||||
|
mount_source=ufd_dev,
|
||||||
|
mount_point='/mnt/UFD',
|
||||||
|
)
|
||||||
|
|
||||||
# Copy sources
|
# Copy sources
|
||||||
|
|
||||||
|
|
@ -68,8 +72,6 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
# Hide items
|
# Hide items
|
||||||
|
|
||||||
# Unmount sources
|
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
if not args['--force']:
|
if not args['--force']:
|
||||||
print_standard('\nDone.')
|
print_standard('\nDone.')
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,19 @@ def is_valid_path(path_obj, path_type):
|
||||||
return valid_path
|
return valid_path
|
||||||
|
|
||||||
|
|
||||||
|
def mount(mount_source, mount_point):
|
||||||
|
"""Mount mount_source on mount_point."""
|
||||||
|
os.makedirs(mount_point, exist_ok=True)
|
||||||
|
cmd = ['mount', mount_source, mount_point]
|
||||||
|
run_program(cmd)
|
||||||
|
|
||||||
|
|
||||||
|
def unmount(mount_point):
|
||||||
|
"""Unmount mount_point."""
|
||||||
|
cmd = ['umount', mount_point]
|
||||||
|
run_program(cmd)
|
||||||
|
|
||||||
|
|
||||||
def prep_device(dev_path, label, use_mbr=False):
|
def prep_device(dev_path, label, use_mbr=False):
|
||||||
"""Format device in preparation for applying the WizardKit components
|
"""Format device in preparation for applying the WizardKit components
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue