|
|
|
@ -89,9 +89,6 @@ def delete_frm_file_list(iso_file_list, uninstall_distro_dir_name):
|
|
|
|
|
if os.path.exists(os.path.join(usb_mount, generic.strip("/"))):
|
|
|
|
|
os.remove(os.path.join(usb_mount, generic.strip("/")))
|
|
|
|
|
gen.log('Removed files from ' + uninstall_distro_dir_name)
|
|
|
|
|
if platform.system() == 'Linux':
|
|
|
|
|
gen.log('Syncing....')
|
|
|
|
|
os.sync()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -108,7 +105,6 @@ def do_uninstall_distro(target_distro, uninstall_distro_dir_name):
|
|
|
|
|
usb_mount = usb_details['mount_point']
|
|
|
|
|
|
|
|
|
|
if platform.system() == 'Linux':
|
|
|
|
|
os.sync()
|
|
|
|
|
# remove 'immutable' from files on ext2/3/4 fs
|
|
|
|
|
if usb_mount:
|
|
|
|
|
subprocess.call("chattr -i -R %s/* 2>/dev/null" % usb_mount, shell=True)
|
|
|
|
@ -149,8 +145,6 @@ def do_uninstall_distro(target_distro, uninstall_distro_dir_name):
|
|
|
|
|
shutil.rmtree(os.path.join(usb_mount, "trk3"))
|
|
|
|
|
|
|
|
|
|
if os.path.exists(uninstall_distro_dir_name_fullpath):
|
|
|
|
|
if platform.system() == 'Linux':
|
|
|
|
|
os.sync()
|
|
|
|
|
shutil.rmtree(uninstall_distro_dir_name_fullpath)
|
|
|
|
|
|
|
|
|
|
delete_frm_file_list(iso_file_list, uninstall_distro_dir_name)
|
|
|
|
@ -178,8 +172,6 @@ def update_sys_cfg_file(uninstall_distro_dir_name):
|
|
|
|
|
Main function to remove uninstall distro specific operations.
|
|
|
|
|
:return:
|
|
|
|
|
"""
|
|
|
|
|
if platform.system() == 'Linux':
|
|
|
|
|
os.sync()
|
|
|
|
|
|
|
|
|
|
sys_cfg_file = os.path.join(config.usb_mount, "multibootusb", "syslinux.cfg")
|
|
|
|
|
if not os.path.exists(sys_cfg_file):
|
|
|
|
@ -201,8 +193,6 @@ def update_grub_cfg_file(uninstall_distro_dir_name):
|
|
|
|
|
Main function to remove uninstall distro name from the grub.cfg file.
|
|
|
|
|
:return:
|
|
|
|
|
"""
|
|
|
|
|
if platform.system() == 'Linux':
|
|
|
|
|
os.sync()
|
|
|
|
|
|
|
|
|
|
grub_cfg_file = os.path.join(config.usb_mount, "multibootusb",
|
|
|
|
|
"grub", "grub.cfg")
|
|
|
|
@ -231,8 +221,6 @@ def uninstall_progress():
|
|
|
|
|
from . import progressbar
|
|
|
|
|
usb_details = config.usb_details
|
|
|
|
|
usb_mount = usb_details['mount_point']
|
|
|
|
|
if platform.system() == 'Linux':
|
|
|
|
|
os.sync()
|
|
|
|
|
|
|
|
|
|
uninstall_distro_dir_name = config.uninstall_distro_dir_name \
|
|
|
|
|
.replace('\n', '')
|
|
|
|
|