Remove the arch dir when updating the UFD
This commit is contained in:
parent
949efa4de6
commit
cd4ea75862
2 changed files with 17 additions and 2 deletions
|
|
@ -53,8 +53,15 @@ if __name__ == '__main__':
|
|||
if not args['--force']:
|
||||
confirm_selections(args)
|
||||
|
||||
# Format and partition device
|
||||
if not args['--update']:
|
||||
# Prep UFD
|
||||
if args['--update']:
|
||||
# Remove arch folder
|
||||
try_and_print(
|
||||
message='Removing Linux...',
|
||||
function=remove_arch,
|
||||
)
|
||||
else:
|
||||
# Format and partition
|
||||
prep_device(ufd_dev, UFD_LABEL, use_mbr=args['--use-mbr'])
|
||||
|
||||
# Mount UFD
|
||||
|
|
|
|||
|
|
@ -327,6 +327,14 @@ def recursive_copy(source, dest, overwrite=False):
|
|||
raise FileExistsError('Refusing to delete file: {}'.format(dest))
|
||||
|
||||
|
||||
def remove_arch():
|
||||
"""Remove arch dir from UFD.
|
||||
|
||||
This ensures a clean installation to the UFD and resets the boot files
|
||||
"""
|
||||
shutil.rmtree(find_path('/mnt/UFD/arch'))
|
||||
|
||||
|
||||
def running_as_root():
|
||||
"""Check if running with effective UID of 0, returns bool."""
|
||||
return os.geteuid() == 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue