Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbusb committed Nov 17, 2017
2 parents c0094c6 + d588276 commit 8818a2a
Show file tree
Hide file tree
Showing 23 changed files with 352 additions and 59 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
Version - 8.9.0
---------------
* Support for GPT based USB disks. BIOS mode works only under USB created under Linux. UEFI for on Windows and Linux
* Added command line option to install sysinux on multibootusb director (use -s or --syslinux)
* Added command line option to direct ISO writing to USB disk (use -r or --raw)
* Boot ISO and IMG directly using memdisk
* Added feature for selecting ISO, IMG, Zip and all files options in file chooser dialog
* Corrected path to menu.lst file for distrs based on grub4dos
* Fix for crash when multicard reader is inserted on the system without a SD card
* Correctly detect USB disk information using udisk2-dbus without crash under Linux
* Fixed an issue where using a path with spaces would cause a qemu boot error
* If distro is not supported, ISO is automatically added using memdisk. You can uninstall later if it does not work
* Added Nano Linux

Version - 8.8.0
---------------
* Fix for crash when listing fixed partition
Expand Down
Binary file added data/EFI/BOOT/bootx64-gpt.efi
Binary file not shown.
Binary file added data/EFI/BOOT/bootx64-msdos.efi
Binary file not shown.
Binary file added data/multibootusb/grub/core-gpt.img
Binary file not shown.
Binary file added data/multibootusb/grub/core-msdos.img
Binary file not shown.
Binary file added data/tools/EFI/BOOT/bootx64-gpt.efi
Binary file not shown.
Binary file added data/tools/EFI/BOOT/bootx64-msdos.efi
Binary file not shown.
Binary file added data/tools/gdisk/gdisk.exe
Binary file not shown.
1 change: 1 addition & 0 deletions data/tools/gdisk/list-disk.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
list disk
Binary file added data/tools/gptmbr.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion data/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.8.0
8.9.0
10 changes: 7 additions & 3 deletions multibootusb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Example for writing ISO image to target USB disk (will destroy data on USB disk)
Windows:
python3 multibootusb -c -i -r ../../favourite.iso -t G:
''')
exit(2)
sys.exit(2)


def start_gui():
Expand All @@ -121,9 +121,9 @@ if __name__ == '__main__':
admin.runAsAdmin()
sys.exit(0)
try:
opts, args = getopt.getopt(sys.argv[1:], 'i:t:yvhcudr',
opts, args = getopt.getopt(sys.argv[1:], 'i:t:yvhcudrs',
['iso=', 'target=', 'yes', 'version', 'help', 'command', 'uninstall', 'debug',
'raw'])
'raw', 'syslinux'])
except getopt.GetoptError:
usage()
sys.exit(2)
Expand Down Expand Up @@ -151,6 +151,8 @@ if __name__ == '__main__':
config.yes = True
elif opt in ('-r', '--raw'):
config.cli_dd = True
elif opt in ('-s', '--syslinux'):
config.cli_syslinux = True
else:
gui = True
#start_gui()
Expand All @@ -174,6 +176,8 @@ if gui is False:
elif config.image_path is '' and config.usb_disk is '':
log('\nNo option provided. See the usage below.')
usage()
elif config.cli_syslinux is True and config.usb_disk is not '':
cli_install_syslinux()
elif config.image_path is '' or config.usb_disk is '':
log('\nOptions \'-i\' and \'-t\' must be supplied together. See the usage below.')
usage()
Expand Down
15 changes: 2 additions & 13 deletions scripts/_7zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def list_iso(iso_link, suppress_out=True):
file_list = []
_cmd = _7zip + ' l ' + gen.quote(iso_link) + suppress_out
try:
_cmd_out = subprocess.check_output(_cmd, stderr=subprocess.PIPE, shell=True).decode('utf-8', 'ignore').splitlines()
_cmd_out = subprocess.check_output(_cmd, stderr=subprocess.PIPE, stdin=subprocess.DEVNULL,
shell=True).decode('utf-8', 'ignore').splitlines()
except Exception as e:
gen.log(e)
_cmd_out = ''
Expand All @@ -84,18 +85,6 @@ def list_iso(iso_link, suppress_out=True):
line = line.split()
_path = line[-1]
file_list.append(_path)
'''
for line in _cmd_out:
line = line.split()
if '.....' in line:
if gen.has_digit(line[2]) or gen.has_digit(line[4]):
if len(line) > 6:
f_path = " ".join(line[5:])
file_list.append(f_path)
else:
f_path = line[-1]
file_list.append(f_path)
'''
return file_list


Expand Down
2 changes: 2 additions & 0 deletions scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
process_exist = None
yes = False
cli_dd = False
cli_syslinux = False
usb_gpt = ''

imager_iso_link = ""
imager_usb_disk_selected = ""
Expand Down
17 changes: 17 additions & 0 deletions scripts/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,23 @@ def copy_mbusb_dir_usb(usb_disk):
else:
log('EFI directory already exist. Not copying.')

# For backward compatibility
if not os.path.exists(os.path.join(usb_mount_path, 'EFI', 'BOOT', 'bootx64-gpt.efi')):
shutil.copy(resource_path(os.path.join('data', 'EFI', 'BOOT', 'bootx64-gpt.efi')),
os.path.join(usb_mount_path, 'EFI', 'BOOT', 'bootx64-gpt.efi'))

if not os.path.exists(os.path.join(usb_mount_path, 'EFI', 'BOOT', 'bootx64-msdos.efi')):
shutil.copy(resource_path(os.path.join('data', 'EFI', 'BOOT', 'bootx64-msdos.efi')),
os.path.join(usb_mount_path, 'EFI', 'BOOT', 'bootx64-msdos.efi'))

if not os.path.exists(os.path.join(usb_mount_path, 'multibootusb', 'grub', 'core-gpt.img')):
shutil.copy(resource_path(os.path.join('data', 'multibootusb', 'grub', 'core-gpt.img')),
os.path.join(usb_mount_path, 'multibootusb', 'grub', 'core-gpt.img'))

if not os.path.exists(os.path.join(usb_mount_path, 'multibootusb', 'grub', 'core-msdos.img')):
shutil.copy(resource_path(os.path.join('data', 'multibootusb', 'grub', 'core-msdos.img')),
os.path.join(usb_mount_path, 'multibootusb', 'grub', 'core-msdos.img'))

return result


Expand Down
2 changes: 1 addition & 1 deletion scripts/gui/about.ui
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<item row="1" column="1">
<widget class="QLabel" name="label_6">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;An advanced bootable usb creator with option to install/uninstall multiple distros.&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;This software is written in Python and PyQt. &lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Copyright 2010-2017 Sundar&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Author(s)&lt;/span&gt;: Sundar, Ian Bruce, LiQiong Lee and Alin Trăistaru (alindt)&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Licence&lt;/span&gt;: GPL version 2 or later&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Home page&lt;/span&gt;: &lt;a href=&quot; http://multibootusb.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://multibootusb.org&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Help/Email&lt;/span&gt;: [email protected]&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Source Code&lt;/span&gt;: &lt;a href=&quot;https://github.com/mbusb/multibootusb&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/mbusb/multibootusb&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;An advanced bootable usb creator with option to install/uninstall multiple distros.&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;This software is written in Python and PyQt. &lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Copyright 2010-2017 Sundar&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Author(s)&lt;/span&gt;: Sundar, Ian Bruce, LiQiong Lee and Alin Trăistaru (alindt)&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Licence&lt;/span&gt;: GPL version 2 or later&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Home page&lt;/span&gt;: &lt;a href=&quot;http://multibootusb.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://multibootusb.org&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Help/Email&lt;/span&gt;: [email protected]&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Source Code&lt;/span&gt;: &lt;a href=&quot;https://github.com/mbusb/multibootusb&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/mbusb/multibootusb&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
Expand Down
3 changes: 1 addition & 2 deletions scripts/gui/ui_about.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def setupUi(self, About):
def retranslateUi(self, About):
_translate = QtCore.QCoreApplication.translate
About.setWindowTitle(_translate("About", "Dialog"))
self.label_6.setText(_translate("About", "<html><head/><body><p align=\"center\">An advanced bootable usb creator with option to install/uninstall multiple distros.</p><p align=\"center\">This software is written in Python and PyQt. </p><p align=\"center\">Copyright 2010-2017 Sundar</p><p align=\"center\"><span style=\" font-weight:600;\">Author(s)</span>: Sundar, Ian Bruce, LiQiong Lee and Alin Trăistaru (alindt)</p><p align=\"center\"><span style=\" font-weight:600;\">Licence</span>: GPL version 2 or later</p><p align=\"center\"><span style=\" font-weight:600;\">Home page</span>: <a href=\" http://multibootusb.org\"><span style=\" text-decoration: underline; color:#0000ff;\">http://multibootusb.org</span></a></p><p align=\"center\"><span style=\" font-weight:600;\">Help/Email</span>: [email protected]</p><p align=\"center\"><span style=\" font-weight:600;\">Source Code</span>: <a href=\"https://github.com/mbusb/multibootusb\"><span style=\" text-decoration: underline; color:#0000ff;\">https://github.com/mbusb/multibootusb</span></a></p><p><br/></p></body></html>"))
self.label_6.setText(_translate("About", "<html><head/><body><p align=\"center\">An advanced bootable usb creator with option to install/uninstall multiple distros.</p><p align=\"center\">This software is written in Python and PyQt. </p><p align=\"center\">Copyright 2010-2017 Sundar</p><p align=\"center\"><span style=\" font-weight:600;\">Author(s)</span>: Sundar, Ian Bruce, LiQiong Lee and Alin Trăistaru (alindt)</p><p align=\"center\"><span style=\" font-weight:600;\">Licence</span>: GPL version 2 or later</p><p align=\"center\"><span style=\" font-weight:600;\">Home page</span>: <a href=\"http://multibootusb.org\"><span style=\" text-decoration: underline; color:#0000ff;\">http://multibootusb.org</span></a></p><p align=\"center\"><span style=\" font-weight:600;\">Help/Email</span>: [email protected]</p><p align=\"center\"><span style=\" font-weight:600;\">Source Code</span>: <a href=\"https://github.com/mbusb/multibootusb\"><span style=\" text-decoration: underline; color:#0000ff;\">https://github.com/mbusb/multibootusb</span></a></p><p><br/></p></body></html>"))
self.button_close.setText(_translate("About", "Close"))


Expand All @@ -60,4 +60,3 @@ def retranslateUi(self, About):
ui.setupUi(About)
About.show()
sys.exit(app.exec_())

10 changes: 9 additions & 1 deletion scripts/iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,20 @@ def iso_size(iso_link):
return os.path.getsize(iso_link)


def is_readable(iso_link):
return os.access(iso_link, os.R_OK)


def is_bootable(iso_link):
"""
Check if an ISO has the ability to boot.
:return: True if ISO is bootable and False if not.
"""
iso9660fs = ISO9660(iso_link)
try:
iso9660fs = ISO9660(iso_link)
except IOError as e:
log(str(e))
raise
isBootable = iso9660fs.checkISOBootable()
return bool(isBootable)

Expand Down
30 changes: 16 additions & 14 deletions scripts/isodump3.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@
E_DEVICEFILE = -2 # can't write device file

class PrimaryVolume(Structure):
def __init__(self):
self.sysIdentifier = ""
self.volIdentifier = ""
self.volSize = 0
self.volSeq = 0
self.blockSize = 0
self.ptSize = 0
self.ptLRd = 0
self.fsVer = 0
self.rootLoc = 0
self.rootTotal = 0
def __init__(self):
self.sysIdentifier = ""
self.volIdentifier = ""
self.volSize = 0
self.volSeq = 0
self.blockSize = 0
self.ptSize = 0
self.ptLRd = 0
self.fsVer = 0
self.rootLoc = 0
self.rootTotal = 0

class Rrip(Structure):
def __init__(self):
self.offset = -1
self.offset = -1
self.altname = ""
self.devH = 0
self.devL = 0
Expand Down Expand Up @@ -106,7 +106,10 @@ def __init__(self, isofile):
f = open(isofile, 'rb')
except(IOError):
sys.stderr.write("can't open {0}".format(isofile))
sys.exit(-1)
raise

if os.path.getsize(isofile) == 0:
raise IOError("File {0} appears to be empty".format(isofile))

self.isoFile = f
self.priVol = None
Expand Down Expand Up @@ -803,4 +806,3 @@ def usage():
else:
gen.log("writeDir(%s)->(%s) with pattern(%s)"%(isodir, o_path, pattern))
sys.exit(iso9660fs.writeDir(isodir, o_path, pattern, r, True))

40 changes: 40 additions & 0 deletions scripts/mbusb_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from .syslinux import *
from .install import *
from . import imager
from . import syslinux


def read_input_uninstall():
Expand Down Expand Up @@ -99,6 +100,7 @@ def iso_install(iso_image):
install_progress()
syslinux_distro_dir(config.usb_disk, iso_image, _distro)
syslinux_default(config.usb_disk)
replace_grub_binary()
update_distro_cfg_files(iso_image, config.usb_disk, _distro)
log('Finished installing ' + iso.iso_basename(iso_image))
else:
Expand All @@ -110,6 +112,7 @@ def iso_install(iso_image):
install_progress()
syslinux_distro_dir(config.usb_disk, iso_image, _distro)
syslinux_default(config.usb_disk)
replace_grub_binary()
update_distro_cfg_files(iso_image, config.usb_disk, _distro)
log('Finished installing ' + iso.iso_basename(iso_image))
else:
Expand Down Expand Up @@ -167,3 +170,40 @@ def cli_dd():
else:
log('\nAuto install is not recommended in direct writing method. Please choose without \'-y\' option.\n')
sys.exit(2)


def cli_install_syslinux():
"""
Install syslinux on a target USB disk. It will installed on 'multibootusb' directory
:return:
"""
if platform.system() == 'Linux':
if config.usb_disk[-1].isdigit() is not True:
log('Selected USB disk is not a partition. Please enter the partition eg. \'/dev/sdb1\'')
sys.exit(2)
elif is_root() is False:
log("You need to have root privileges to run this script.\nPlease try again using admin privilege (sudo).")
sys.exit(2)

if config.yes is not True:
log('\nInitiating process for installing syslinux on ' + config.usb_disk)
log('Selected target device is : ' + quote(config.usb_disk))
log('Syslinux install directory : \'multibootusb\'\n')
log('Please confirm the option.')
log('Y/y/Yes/yes/YES or N/n/No/no/NO')
if read_input_yes() is True:
if syslinux.syslinux_default(config.usb_disk) is True:
log('Syslinux successfully installed on ' + config.usb_disk)
else:
log('Failed to install syslinux on ' + config.usb_disk)
else:
log('Operation cancelled by user. Exiting...')
sys.exit(2)
else:
log('\nSkipping user input and installing syslinux on ' + config.usb_disk)
if syslinux.syslinux_default(config.usb_disk) is True:
log('Syslinux successfully installed on ' + config.usb_disk)
else:
log('Failed to install syslinux on ' + config.usb_disk)
sys.exit(2)

Loading

0 comments on commit 8818a2a

Please sign in to comment.