diff --git a/scripts/imager.py b/scripts/imager.py index 46df57a..d69c29e 100644 --- a/scripts/imager.py +++ b/scripts/imager.py @@ -63,7 +63,7 @@ def dd_linux(): if dd_process.poll() is not None: log("\nExecuting ==> sync") - os.system("sync") + os.sync() log("ISO has been written to USB disk...") return diff --git a/scripts/install.py b/scripts/install.py index e9219b8..bd815ef 100644 --- a/scripts/install.py +++ b/scripts/install.py @@ -100,7 +100,7 @@ def install_distro(): if platform.system() == 'Linux': log('ISO extracted successfully. Sync is in progress...') - os.system('sync') + os.sync() if config.persistence != 0: log('Creating persistence...') @@ -159,7 +159,7 @@ def install_patch(): """ if config.distro == 'debian': if platform.system() == 'Linux': # Need to syn under Linux. Otherwise, USB disk becomes random read only. - os.system('sync') + os.sync() iso_cfg_ext_dir = os.path.join(multibootusb_host_dir(), "iso_cfg_ext_dir") isolinux_path = os.path.join(iso_cfg_ext_dir, isolinux_bin_path(config.image_path)) iso_linux_bin_dir = isolinux_bin_dir(config.image_path) diff --git a/scripts/mbusb_gui.py b/scripts/mbusb_gui.py index 58738f6..053c18b 100644 --- a/scripts/mbusb_gui.py +++ b/scripts/mbusb_gui.py @@ -331,7 +331,7 @@ Are you SURE you want to enable it?", self.update_list_box(config.usb_disk) if sys.platform.startswith("linux"): self.ui.statusbar.showMessage("Status: Sync is in progress...") - os.system('sync') + os.sync() self.ui.statusbar.showMessage("Status: Idle") self.ui_disable_persistence() log(iso_name(config.image_path) + ' has been successfully installed.') @@ -453,7 +453,7 @@ Are you SURE you want to enable it?", self.update_list_box(config.usb_mount) if sys.platform.startswith("linux"): self.ui.statusbar.showMessage("Status: Sync in progress...") - os.system('sync') + os.sync() self.ui.statusbar.showMessage("Status: Idle") QtWidgets.QMessageBox.information(self, 'Uninstall Complete...', config.uninstall_distro_dir_name + ' has been successfully removed.') diff --git a/scripts/uninstall_distro.py b/scripts/uninstall_distro.py index 350ada3..9f36088 100644 --- a/scripts/uninstall_distro.py +++ b/scripts/uninstall_distro.py @@ -90,7 +90,7 @@ def delete_frm_file_list(): if platform.system() == 'Linux': gen.log('Removed files from ' + config.uninstall_distro_dir_name) gen.log('Syncing....') - os.system('sync') + os.sync() @@ -107,7 +107,7 @@ def uninstall_distro(): usb_mount = usb_details['mount_point'] if platform.system() == 'Linux': - os.system('sync') + 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) @@ -133,7 +133,7 @@ def uninstall_distro(): if os.path.exists(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name)): if platform.system() == 'Linux': - os.system('sync') + os.sync() shutil.rmtree(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name)) delete_frm_file_list() @@ -161,7 +161,7 @@ def update_sys_cfg_file(): :return: """ if platform.system() == 'Linux': - os.system('sync') + os.sync() sys_cfg_file = os.path.join(config.usb_mount, "multibootusb", "syslinux.cfg") if not os.path.exists(sys_cfg_file): @@ -181,7 +181,7 @@ def update_grub_cfg_file(): :return: """ if platform.system() == 'Linux': - os.system('sync') + os.sync() grub_cfg_file = os.path.join(config.usb_mount, "multibootusb", "grub", "grub.cfg") if not os.path.exists(grub_cfg_file): @@ -204,7 +204,7 @@ def uninstall_progress(): usb_details = details(config.usb_disk) usb_mount = usb_details['mount_point'] if platform.system() == 'Linux': - os.system('sync') + os.sync() if os.path.exists(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name, "multibootusb.cfg")): with open(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name, "multibootusb.cfg"), diff --git a/scripts/update_cfg_file.py b/scripts/update_cfg_file.py index 93a17ae..015bbf0 100644 --- a/scripts/update_cfg_file.py +++ b/scripts/update_cfg_file.py @@ -270,7 +270,7 @@ def update_mbusb_cfg_file(iso_link, usb_uuid, usb_mount, distro): :return: """ if platform.system() == 'Linux': - os.system('sync') + os.sync() log('Updating multibootusb config file...') sys_cfg_file = os.path.join(usb_mount, "multibootusb", "syslinux.cfg") install_dir = os.path.join(usb_mount, "multibootusb", iso_basename(iso_link))