From 704769a81c7c2399a81a88983645a78ba6d6e156 Mon Sep 17 00:00:00 2001 From: mbusb Date: Sun, 16 Apr 2017 22:19:18 +0530 Subject: [PATCH] Small improvements and added a distro 1. Added syslinux.bin and an entry in grub.cfg so as to chainload to syslinux from grub2 2. Added grml 3. Kill windows explorer when writing ISO image to USB (This is reqired to prevent dd.exe from failing) 4. Load combobox with detected drive when loading GUI 5. File dialog remembers last opened file directory 6. Logging syslinux install command --- .gitignore | 2 +- data/multibootusb/grub/grub.cfg | 13 ++++++++---- data/multibootusb/syslinux.bin | Bin 0 -> 512 bytes scripts/distro.py | 2 ++ scripts/gen.py | 36 ++++++++++++++++++++++++++++++-- scripts/mbusb_gui.py | 20 +++++++++++++++--- scripts/syslinux.py | 3 ++- scripts/update_cfg_file.py | 3 ++- 8 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 data/multibootusb/syslinux.bin diff --git a/.gitignore b/.gitignore index e081bbb..15a798f 100644 --- a/.gitignore +++ b/.gitignore @@ -103,4 +103,4 @@ multibootusb*.exe *.swp # Test file which I work on to test logic before committing to main file. -mbusb*py \ No newline at end of file +mbusb_te*py \ No newline at end of file diff --git a/data/multibootusb/grub/grub.cfg b/data/multibootusb/grub/grub.cfg index a8c2b3e..738ace7 100644 --- a/data/multibootusb/grub/grub.cfg +++ b/data/multibootusb/grub/grub.cfg @@ -37,9 +37,14 @@ set color_highlight=white/light-blue export color_normal export color_highlight -menuentry "Boot Plop Boot Manager"{ - linux16 /multibootusb/plpbt -} +if [ ${grub_platform} == "pc" ]; then + menuentry "Load Syslinux Boot Loader"{ + chainloader /multibootusb/syslinux.bin + } + menuentry "Boot Plop Boot Manager"{ + linux16 /multibootusb/plpbt + } +fi # Load windows boot loaders from USB drive -source /multibootusb/grub/win.cfg \ No newline at end of file +source /multibootusb/grub/win.cfg diff --git a/data/multibootusb/syslinux.bin b/data/multibootusb/syslinux.bin new file mode 100644 index 0000000000000000000000000000000000000000..d887d40a9646b373107a72bd347658d5eb334fe5 GIT binary patch literal 512 zcmaDIF(EiI*vHc^G=hPNLxF*b0SJCDFxWHvXJFs}vJ2ib+_44;GJxe68Q35kDA~ZE z$*^{Ad~m3ri(`-i2)H?h7#jiUUw;fw_FddlRvp9^E*I8!aHHD(it5ix`)=;8VBp_k z&c7f`;ZlXP;em~8o%WsXOrKMhcJWEnbol-V0D`l^uamk%S9O=JIQWi*@l*3J|1!hI zUz^yAwZFM;sV`Nv@ZC|OkY=ms9uQJ0&``VMZ7EmU|I#-={Ngo#U?7m*^O_w*o5|E{ z;dt?qp-5QaNh$xqR~$~AVp28D5A8dFmi^wnDs+qEi_;860*${zSCw*oJIGkVdW_Aj zmLYA&1%ty3X}dt)+|AJNf{!7s(N3me;b*7((vp`yn9`Wp5~|aL#Zszw3NXCZP76v4 zU<=M-%o6B)mX@%^=|wq1T4HaCKoR5Nv;@NgFEW7KN4G#GYo{fo@ozVir~#68QZ;Gc zzZsrvKb7|Vdz$TkW(J0G@dHoT9626#9PPNagOTZlK2RgjkVhvCzx7?)lTqDwFRh=g zf??mS+BFIXN;tRh?Pg~= usb_disk_size: QtWidgets.QMessageBox.information(self, "No enough space on disk.", os.path.basename(config.image_path) + " size is larger than the size of " + config.usb_disk) + elif gen.process_exist('explorer.exe') is not False: + # Check if windows explorer is running and inform user to close it. + QtWidgets.QMessageBox.information(self, "Windows Explorer", "Windows Explorer is running\n" + "You need to close it before writing ISO " + "image to disk...") else: reply = QtWidgets.QMessageBox.question \ (self, 'Review selection', diff --git a/scripts/syslinux.py b/scripts/syslinux.py index 96f7f0f..b5c18b6 100644 --- a/scripts/syslinux.py +++ b/scripts/syslinux.py @@ -171,6 +171,7 @@ def syslinux_distro_dir(usb_disk, iso_link, distro): else: config.status_text = 'Failed to install syslinux on distro directory...' log ("\nFailed to install syslinux on distro directory...\n") + elif platform.system() == "Windows": syslinux_path = resource_path(os.path.join(multibootusb_host_dir(), "syslinux", "bin")) + \ "\syslinux" + config.syslinux_version + ".exe" @@ -178,7 +179,7 @@ def syslinux_distro_dir(usb_disk, iso_link, distro): distro_sys_install_bs = distro_sys_install_bs.replace("/", "\\") sys_cmd = syslinux_path + option + distro_syslinux_install_dir + ' ' + usb_disk + ' ' + \ distro_sys_install_bs - log("\nExecuting ==> " + sys_cmd, '\n') + log("\nExecuting ==> " + sys_cmd + '\n') config.status_text = 'Installing distro specific syslinux...' if subprocess.call(sys_cmd, shell=True) == 0: config.status_text = 'Syslinux install on distro directory is success...' diff --git a/scripts/update_cfg_file.py b/scripts/update_cfg_file.py index 759ba51..42c2321 100644 --- a/scripts/update_cfg_file.py +++ b/scripts/update_cfg_file.py @@ -62,7 +62,8 @@ def update_distro_cfg_files(iso_link, usb_disk, distro, persistence=0): if not persistence == 0: string = re.sub(r'boot=live', 'boot=live persistent persistent-path=/multibootusb/' + iso_basename(iso_link) + "/", string) - + elif distro == 'grml': + string = re.sub(r'live-media-path=', 'ignore_bootid live-media-path=', string) elif distro == "ubuntu-server": string = re.sub(r'file', 'cdrom-detect/try-usb=true floppy.allowed_drive_mask=0 ignore_uuid ignore_bootid root=UUID=' +