Skip to content

Commit 8818a2a

Browse files
committed
Merge branch 'devel'
2 parents c0094c6 + d588276 commit 8818a2a

23 files changed

+352
-59
lines changed

CHANGELOG

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
Version - 8.9.0
2+
---------------
3+
* Support for GPT based USB disks. BIOS mode works only under USB created under Linux. UEFI for on Windows and Linux
4+
* Added command line option to install sysinux on multibootusb director (use -s or --syslinux)
5+
* Added command line option to direct ISO writing to USB disk (use -r or --raw)
6+
* Boot ISO and IMG directly using memdisk
7+
* Added feature for selecting ISO, IMG, Zip and all files options in file chooser dialog
8+
* Corrected path to menu.lst file for distrs based on grub4dos
9+
* Fix for crash when multicard reader is inserted on the system without a SD card
10+
* Correctly detect USB disk information using udisk2-dbus without crash under Linux
11+
* Fixed an issue where using a path with spaces would cause a qemu boot error
12+
* If distro is not supported, ISO is automatically added using memdisk. You can uninstall later if it does not work
13+
* Added Nano Linux
14+
115
Version - 8.8.0
216
---------------
317
* Fix for crash when listing fixed partition

data/EFI/BOOT/bootx64-gpt.efi

2.51 MB
Binary file not shown.

data/EFI/BOOT/bootx64-msdos.efi

2.51 MB
Binary file not shown.

data/multibootusb/grub/core-gpt.img

30.8 KB
Binary file not shown.

data/multibootusb/grub/core-msdos.img

30.9 KB
Binary file not shown.

data/tools/EFI/BOOT/bootx64-gpt.efi

2.51 MB
Binary file not shown.

data/tools/EFI/BOOT/bootx64-msdos.efi

2.51 MB
Binary file not shown.

data/tools/gdisk/gdisk.exe

718 KB
Binary file not shown.

data/tools/gdisk/list-disk.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
list disk

data/tools/gptmbr.bin

440 Bytes
Binary file not shown.

data/version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.8.0
1+
8.9.0

multibootusb

+7-3
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Example for writing ISO image to target USB disk (will destroy data on USB disk)
101101
Windows:
102102
python3 multibootusb -c -i -r ../../favourite.iso -t G:
103103
''')
104-
exit(2)
104+
sys.exit(2)
105105

106106

107107
def start_gui():
@@ -121,9 +121,9 @@ if __name__ == '__main__':
121121
admin.runAsAdmin()
122122
sys.exit(0)
123123
try:
124-
opts, args = getopt.getopt(sys.argv[1:], 'i:t:yvhcudr',
124+
opts, args = getopt.getopt(sys.argv[1:], 'i:t:yvhcudrs',
125125
['iso=', 'target=', 'yes', 'version', 'help', 'command', 'uninstall', 'debug',
126-
'raw'])
126+
'raw', 'syslinux'])
127127
except getopt.GetoptError:
128128
usage()
129129
sys.exit(2)
@@ -151,6 +151,8 @@ if __name__ == '__main__':
151151
config.yes = True
152152
elif opt in ('-r', '--raw'):
153153
config.cli_dd = True
154+
elif opt in ('-s', '--syslinux'):
155+
config.cli_syslinux = True
154156
else:
155157
gui = True
156158
#start_gui()
@@ -174,6 +176,8 @@ if gui is False:
174176
elif config.image_path is '' and config.usb_disk is '':
175177
log('\nNo option provided. See the usage below.')
176178
usage()
179+
elif config.cli_syslinux is True and config.usb_disk is not '':
180+
cli_install_syslinux()
177181
elif config.image_path is '' or config.usb_disk is '':
178182
log('\nOptions \'-i\' and \'-t\' must be supplied together. See the usage below.')
179183
usage()

scripts/_7zip.py

+2-13
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def list_iso(iso_link, suppress_out=True):
7575
file_list = []
7676
_cmd = _7zip + ' l ' + gen.quote(iso_link) + suppress_out
7777
try:
78-
_cmd_out = subprocess.check_output(_cmd, stderr=subprocess.PIPE, shell=True).decode('utf-8', 'ignore').splitlines()
78+
_cmd_out = subprocess.check_output(_cmd, stderr=subprocess.PIPE, stdin=subprocess.DEVNULL,
79+
shell=True).decode('utf-8', 'ignore').splitlines()
7980
except Exception as e:
8081
gen.log(e)
8182
_cmd_out = ''
@@ -84,18 +85,6 @@ def list_iso(iso_link, suppress_out=True):
8485
line = line.split()
8586
_path = line[-1]
8687
file_list.append(_path)
87-
'''
88-
for line in _cmd_out:
89-
line = line.split()
90-
if '.....' in line:
91-
if gen.has_digit(line[2]) or gen.has_digit(line[4]):
92-
if len(line) > 6:
93-
f_path = " ".join(line[5:])
94-
file_list.append(f_path)
95-
else:
96-
f_path = line[-1]
97-
file_list.append(f_path)
98-
'''
9988
return file_list
10089

10190

scripts/config.py

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
process_exist = None
2828
yes = False
2929
cli_dd = False
30+
cli_syslinux = False
31+
usb_gpt = ''
3032

3133
imager_iso_link = ""
3234
imager_usb_disk_selected = ""

scripts/gen.py

+17
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,23 @@ def copy_mbusb_dir_usb(usb_disk):
229229
else:
230230
log('EFI directory already exist. Not copying.')
231231

232+
# For backward compatibility
233+
if not os.path.exists(os.path.join(usb_mount_path, 'EFI', 'BOOT', 'bootx64-gpt.efi')):
234+
shutil.copy(resource_path(os.path.join('data', 'EFI', 'BOOT', 'bootx64-gpt.efi')),
235+
os.path.join(usb_mount_path, 'EFI', 'BOOT', 'bootx64-gpt.efi'))
236+
237+
if not os.path.exists(os.path.join(usb_mount_path, 'EFI', 'BOOT', 'bootx64-msdos.efi')):
238+
shutil.copy(resource_path(os.path.join('data', 'EFI', 'BOOT', 'bootx64-msdos.efi')),
239+
os.path.join(usb_mount_path, 'EFI', 'BOOT', 'bootx64-msdos.efi'))
240+
241+
if not os.path.exists(os.path.join(usb_mount_path, 'multibootusb', 'grub', 'core-gpt.img')):
242+
shutil.copy(resource_path(os.path.join('data', 'multibootusb', 'grub', 'core-gpt.img')),
243+
os.path.join(usb_mount_path, 'multibootusb', 'grub', 'core-gpt.img'))
244+
245+
if not os.path.exists(os.path.join(usb_mount_path, 'multibootusb', 'grub', 'core-msdos.img')):
246+
shutil.copy(resource_path(os.path.join('data', 'multibootusb', 'grub', 'core-msdos.img')),
247+
os.path.join(usb_mount_path, 'multibootusb', 'grub', 'core-msdos.img'))
248+
232249
return result
233250

234251

scripts/gui/about.ui

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<item row="1" column="1">
2626
<widget class="QLabel" name="label_6">
2727
<property name="text">
28-
<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>
28+
<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>
2929
</property>
3030
</widget>
3131
</item>

scripts/gui/ui_about.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def setupUi(self, About):
4848
def retranslateUi(self, About):
4949
_translate = QtCore.QCoreApplication.translate
5050
About.setWindowTitle(_translate("About", "Dialog"))
51-
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>"))
51+
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>"))
5252
self.button_close.setText(_translate("About", "Close"))
5353

5454

@@ -60,4 +60,3 @@ def retranslateUi(self, About):
6060
ui.setupUi(About)
6161
About.show()
6262
sys.exit(app.exec_())
63-

scripts/iso.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,20 @@ def iso_size(iso_link):
6060
return os.path.getsize(iso_link)
6161

6262

63+
def is_readable(iso_link):
64+
return os.access(iso_link, os.R_OK)
65+
66+
6367
def is_bootable(iso_link):
6468
"""
6569
Check if an ISO has the ability to boot.
6670
:return: True if ISO is bootable and False if not.
6771
"""
68-
iso9660fs = ISO9660(iso_link)
72+
try:
73+
iso9660fs = ISO9660(iso_link)
74+
except IOError as e:
75+
log(str(e))
76+
raise
6977
isBootable = iso9660fs.checkISOBootable()
7078
return bool(isBootable)
7179

scripts/isodump3.py

+16-14
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,21 @@
4444
E_DEVICEFILE = -2 # can't write device file
4545

4646
class PrimaryVolume(Structure):
47-
def __init__(self):
48-
self.sysIdentifier = ""
49-
self.volIdentifier = ""
50-
self.volSize = 0
51-
self.volSeq = 0
52-
self.blockSize = 0
53-
self.ptSize = 0
54-
self.ptLRd = 0
55-
self.fsVer = 0
56-
self.rootLoc = 0
57-
self.rootTotal = 0
47+
def __init__(self):
48+
self.sysIdentifier = ""
49+
self.volIdentifier = ""
50+
self.volSize = 0
51+
self.volSeq = 0
52+
self.blockSize = 0
53+
self.ptSize = 0
54+
self.ptLRd = 0
55+
self.fsVer = 0
56+
self.rootLoc = 0
57+
self.rootTotal = 0
5858

5959
class Rrip(Structure):
6060
def __init__(self):
61-
self.offset = -1
61+
self.offset = -1
6262
self.altname = ""
6363
self.devH = 0
6464
self.devL = 0
@@ -106,7 +106,10 @@ def __init__(self, isofile):
106106
f = open(isofile, 'rb')
107107
except(IOError):
108108
sys.stderr.write("can't open {0}".format(isofile))
109-
sys.exit(-1)
109+
raise
110+
111+
if os.path.getsize(isofile) == 0:
112+
raise IOError("File {0} appears to be empty".format(isofile))
110113

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

scripts/mbusb_cli.py

+40
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from .syslinux import *
1717
from .install import *
1818
from . import imager
19+
from . import syslinux
1920

2021

2122
def read_input_uninstall():
@@ -99,6 +100,7 @@ def iso_install(iso_image):
99100
install_progress()
100101
syslinux_distro_dir(config.usb_disk, iso_image, _distro)
101102
syslinux_default(config.usb_disk)
103+
replace_grub_binary()
102104
update_distro_cfg_files(iso_image, config.usb_disk, _distro)
103105
log('Finished installing ' + iso.iso_basename(iso_image))
104106
else:
@@ -110,6 +112,7 @@ def iso_install(iso_image):
110112
install_progress()
111113
syslinux_distro_dir(config.usb_disk, iso_image, _distro)
112114
syslinux_default(config.usb_disk)
115+
replace_grub_binary()
113116
update_distro_cfg_files(iso_image, config.usb_disk, _distro)
114117
log('Finished installing ' + iso.iso_basename(iso_image))
115118
else:
@@ -167,3 +170,40 @@ def cli_dd():
167170
else:
168171
log('\nAuto install is not recommended in direct writing method. Please choose without \'-y\' option.\n')
169172
sys.exit(2)
173+
174+
175+
def cli_install_syslinux():
176+
"""
177+
Install syslinux on a target USB disk. It will installed on 'multibootusb' directory
178+
:return:
179+
"""
180+
if platform.system() == 'Linux':
181+
if config.usb_disk[-1].isdigit() is not True:
182+
log('Selected USB disk is not a partition. Please enter the partition eg. \'/dev/sdb1\'')
183+
sys.exit(2)
184+
elif is_root() is False:
185+
log("You need to have root privileges to run this script.\nPlease try again using admin privilege (sudo).")
186+
sys.exit(2)
187+
188+
if config.yes is not True:
189+
log('\nInitiating process for installing syslinux on ' + config.usb_disk)
190+
log('Selected target device is : ' + quote(config.usb_disk))
191+
log('Syslinux install directory : \'multibootusb\'\n')
192+
log('Please confirm the option.')
193+
log('Y/y/Yes/yes/YES or N/n/No/no/NO')
194+
if read_input_yes() is True:
195+
if syslinux.syslinux_default(config.usb_disk) is True:
196+
log('Syslinux successfully installed on ' + config.usb_disk)
197+
else:
198+
log('Failed to install syslinux on ' + config.usb_disk)
199+
else:
200+
log('Operation cancelled by user. Exiting...')
201+
sys.exit(2)
202+
else:
203+
log('\nSkipping user input and installing syslinux on ' + config.usb_disk)
204+
if syslinux.syslinux_default(config.usb_disk) is True:
205+
log('Syslinux successfully installed on ' + config.usb_disk)
206+
else:
207+
log('Failed to install syslinux on ' + config.usb_disk)
208+
sys.exit(2)
209+

0 commit comments

Comments
 (0)