Skip to content

Commit f6b6d1c

Browse files
committed
Update to new release - 8.5.0
1 parent ad5bd3e commit f6b6d1c

File tree

10 files changed

+299
-16
lines changed

10 files changed

+299
-16
lines changed

CHANGELOG

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Version - 8.5.0
2+
---------------
3+
* Added Solus OS
4+
* Added Ka OS
5+
* Added PC Unlocker
6+
* Fixed bug - Same drives appearing multiple times under imager tab
7+
* Fixed HBCD boot issue
8+
* Fix crash when using ISO Imager option to write ISO files (fix by bagage)
9+
* Small improvement in detecting USB disks under Linux (by gktrk)
10+
* Auto mount USB drives if not mounted under Linux
11+
112
Version - 8.4.0
213
---------------
314
* Bug fix in selection of persistence size

data/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.4.0
1+
8.5.0

multibootusb.nsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
;--------------------------------
22
;NSIS script for creating multibootusb setup file
33

4-
Name "multibootusb 8.4.0"
5-
OutFile "multibootusb-8.4.0-setup.exe"
4+
Name "multibootusb 8.5.0"
5+
OutFile "multibootusb-8.5.0-setup.exe"
66

77
SetCompressor lzma
88

scripts/distro.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ def distro(iso_cfg_ext_dir, iso_link):
7272
return "redhat"
7373
# elif re.search(r'suse', string, re.I):
7474
# return "suse"
75-
elif re.search(r'opensuse', string,
76-
re.I):
75+
elif re.search(r'opensuse', string, re.I):
7776
return "opensuse"
7877
elif re.search(
7978
r'slitaz|dban |ophcrack|tinycore|rescue.cpi|xpud|untangle|4mlinux|partition wizard|android-x86.png|'
@@ -127,6 +126,9 @@ def distro(iso_cfg_ext_dir, iso_link):
127126
return "ReactOS"
128127
elif re.search(r'fsecure', string, re.I):
129128
return "fsecure"
129+
elif re.search(r'default rwp', string, re.I):
130+
return "pc-unlocker"
131+
130132

131133
distro = detect_iso_from_file_list(iso_link)
132134
if distro:
@@ -162,12 +164,13 @@ def detect_iso_from_file_list(iso_link):
162164
return "mentest"
163165
elif any("menu.lst" in s.lower() for s in iso_file_list):
164166
return "grub4dos"
167+
elif any("bootwiz.cfg" in s.lower() for s in iso_file_list) and any("bootmenu_logo.png" in s.lower() for s in iso_file_list):
168+
return "grub4dos_iso"
165169
else:
166170
log(iso_file_list)
167171

168172
if __name__ == '__main__':
169173
iso_cfg_ext_dir = os.path.join(multibootusb_host_dir(), "iso_cfg_ext_dir")
170-
#iso_link = '../../../DISTROS/2016/debian-live-8.3.0-amd64-lxde-desktop.iso'
171-
iso_link = '/media/sundar/Data/DISTROS/ubuntu_14_04_backup/Downloads/clonezilla-live-2.4.2-32-amd64.iso'
174+
iso_link = 'Downloads/clonezilla-live-2.4.2-32-amd64.iso'
172175
iso_extract_file(iso_link, iso_cfg_ext_dir, 'cfg')
173176
log(distro(iso_cfg_ext_dir))

scripts/imager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def dd_win():
6565
in_file_size = float(os.path.getsize(config.imager_iso_link) / 1024 / 1024)
6666
output = "of=\\\.\\" + config.imager_usb_disk
6767
command = [windd, input, output, "bs=1M", "--progress"]
68-
log("Executing ==> " + command)
68+
log("Executing ==> " + " ".join(command))
6969
dd_process = subprocess.Popen(command, universal_newlines=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE,
7070
shell=False)
7171
while dd_process.poll() is None:
@@ -224,4 +224,3 @@ def get_usb_size(self, usb_disk):
224224
else:
225225
usb_size = self.usb.disk_usage(self.usb.get_usb(usb_disk).mount).total
226226
return usb_size
227-

scripts/install.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def install_distro():
5252
elif platform.system() == "Linux":
5353
log("Copying " + config.iso_link + " to " + usb_mount)
5454
shutil.copy(config.iso_link, usb_mount)
55-
elif config.distro == "Windows" or config.distro == "alpine":
55+
elif config.distro == "Windows" or config.distro == "alpine" or config.distro == 'pc-unlocker':
5656
log("Extracting iso to " + usb_mount)
5757
iso_extract_full(config.iso_link, usb_mount)
5858
elif config.distro == "trinity-rescue":
@@ -91,6 +91,8 @@ def install_distro():
9191
iso_extract_full(config.iso_link, usb_mount)
9292
elif config.distro == 'ReactOS':
9393
iso_extract_full(config.iso_link, usb_mount)
94+
elif config.distro == 'grub4dos_iso':
95+
copy_iso(config.iso_link, install_dir)
9496
else:
9597
iso.iso_extract_full(config.iso_link, install_dir)
9698

@@ -107,6 +109,13 @@ def install_distro():
107109

108110

109111
def copy_iso(src, dst):
112+
"""
113+
A simple wrapper for copying larger files. This is necessary as
114+
shutil copy files is much slower under Windows platform
115+
:param src: Path to source file
116+
:param dst: Destination directory
117+
:return:
118+
"""
110119
if platform.system() == "Windows":
111120
subprocess.call("xcopy " + src + " " + dst, shell=True)
112121
elif platform.system() == "Linux":

scripts/mbusb_gui.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def add_device(self):
9494
:return:
9595
"""
9696
self.ui.comboBox.clear()
97+
self.ui.comboBox_2.clear()
9798
if self.ui.checkBox_all_drives.isChecked():
9899
detected_device = usb.list(partition=1, fixed=True)
99100
else:

scripts/udisks.py

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
#!/usr/bin/env python3
2+
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
3+
# Name: udisks.py
4+
# Purpose: Module to mount unmount and eject using dbus and udisk
5+
# Authors: Original author is Kovid Goyal <kovid@kovidgoyal.net> and python3
6+
# supporte by Sundar for multibootusb project
7+
# Licence: 'GPL v3' as per original Licence
8+
9+
__license__ = 'GPL v3'
10+
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
11+
__docformat__ = 'restructuredtext en'
12+
13+
# from __future__ import print_function
14+
import os, re
15+
16+
17+
def node_mountpoint(node):
18+
19+
def de_mangle(raw):
20+
return raw.replace('\\040', ' ').replace('\\011', '\t').replace('\\012',
21+
'\n').replace('\\0134', '\\')
22+
23+
for line in open('/proc/mounts').readlines():
24+
line = line.split()
25+
if line[0] == node:
26+
return de_mangle(line[1])
27+
return None
28+
29+
30+
class NoUDisks1(Exception):
31+
pass
32+
33+
34+
class UDisks(object):
35+
36+
def __init__(self):
37+
import dbus
38+
self.bus = dbus.SystemBus()
39+
try:
40+
self.main = dbus.Interface(self.bus.get_object('org.freedesktop.UDisks',
41+
'/org/freedesktop/UDisks'), 'org.freedesktop.UDisks')
42+
except dbus.exceptions.DBusException as e:
43+
if getattr(e, '_dbus_error_name', None) == 'org.freedesktop.DBus.Error.ServiceUnknown':
44+
raise NoUDisks1()
45+
raise
46+
47+
def device(self, device_node_path):
48+
import dbus
49+
devpath = self.main.FindDeviceByDeviceFile(device_node_path)
50+
return dbus.Interface(self.bus.get_object('org.freedesktop.UDisks',
51+
devpath), 'org.freedesktop.UDisks.Device')
52+
53+
def mount(self, device_node_path):
54+
d = self.device(device_node_path)
55+
try:
56+
return str(d.FilesystemMount('',
57+
['auth_no_user_interaction', 'rw', 'noexec', 'nosuid',
58+
'nodev', 'uid=%d'%os.geteuid(), 'gid=%d'%os.getegid()]))
59+
except:
60+
# May be already mounted, check
61+
mp = node_mountpoint(str(device_node_path))
62+
if mp is None:
63+
raise
64+
return mp
65+
66+
def unmount(self, device_node_path):
67+
d = self.device(device_node_path)
68+
d.FilesystemUnmount(['force'])
69+
70+
def eject(self, device_node_path):
71+
parent = device_node_path
72+
while parent[-1] in '0123456789':
73+
parent = parent[:-1]
74+
d = self.device(parent)
75+
d.DriveEject([])
76+
77+
78+
class NoUDisks2(Exception):
79+
pass
80+
81+
82+
class UDisks2(object):
83+
84+
BLOCK = 'org.freedesktop.UDisks2.Block'
85+
FILESYSTEM = 'org.freedesktop.UDisks2.Filesystem'
86+
DRIVE = 'org.freedesktop.UDisks2.Drive'
87+
88+
def __init__(self):
89+
import dbus
90+
self.bus = dbus.SystemBus()
91+
try:
92+
self.bus.get_object('org.freedesktop.UDisks2',
93+
'/org/freedesktop/UDisks2')
94+
except dbus.exceptions.DBusException as e:
95+
if getattr(e, '_dbus_error_name', None) == 'org.freedesktop.DBus.Error.ServiceUnknown':
96+
raise NoUDisks2()
97+
raise
98+
99+
def device(self, device_node_path):
100+
device_node_path = os.path.realpath(device_node_path)
101+
devname = device_node_path.split('/')[-1]
102+
103+
# First we try a direct object path
104+
bd = self.bus.get_object('org.freedesktop.UDisks2',
105+
'/org/freedesktop/UDisks2/block_devices/%s'%devname)
106+
try:
107+
device = bd.Get(self.BLOCK, 'Device',
108+
dbus_interface='org.freedesktop.DBus.Properties')
109+
device = bytearray(device).replace(b'\x00', b'').decode('utf-8')
110+
except:
111+
device = None
112+
113+
if device == device_node_path:
114+
return bd
115+
116+
# Enumerate all devices known to UDisks
117+
devs = self.bus.get_object('org.freedesktop.UDisks2',
118+
'/org/freedesktop/UDisks2/block_devices')
119+
xml = devs.Introspect(dbus_interface='org.freedesktop.DBus.Introspectable')
120+
for dev in re.finditer(r'name=[\'"](.+?)[\'"]', type('')(xml)):
121+
bd = self.bus.get_object('org.freedesktop.UDisks2',
122+
'/org/freedesktop/UDisks2/block_devices/%s2'%dev.group(1))
123+
try:
124+
device = bd.Get(self.BLOCK, 'Device',
125+
dbus_interface='org.freedesktop.DBus.Properties')
126+
device = bytearray(device).replace(b'\x00', b'').decode('utf-8')
127+
except:
128+
device = None
129+
if device == device_node_path:
130+
return bd
131+
132+
raise ValueError('%r not known to UDisks2'%device_node_path)
133+
134+
def mount(self, device_node_path):
135+
d = self.device(device_node_path)
136+
mount_options = ['rw', 'noexec', 'nosuid',
137+
'nodev', 'uid=%d'%os.geteuid(), 'gid=%d'%os.getegid()]
138+
try:
139+
return str(d.Mount(
140+
{
141+
'auth.no_user_interaction':True,
142+
'options':','.join(mount_options)
143+
},
144+
dbus_interface=self.FILESYSTEM))
145+
except:
146+
# May be already mounted, check
147+
mp = node_mountpoint(str(device_node_path))
148+
if mp is None:
149+
raise
150+
return mp
151+
152+
def unmount(self, device_node_path):
153+
d = self.device(device_node_path)
154+
d.Unmount({'force':True, 'auth.no_user_interaction':True},
155+
dbus_interface=self.FILESYSTEM)
156+
157+
def drive_for_device(self, device):
158+
drive = device.Get(self.BLOCK, 'Drive',
159+
dbus_interface='org.freedesktop.DBus.Properties')
160+
return self.bus.get_object('org.freedesktop.UDisks2', drive)
161+
162+
def eject(self, device_node_path):
163+
drive = self.drive_for_device(self.device(device_node_path))
164+
drive.Eject({'auth.no_user_interaction':True},
165+
dbus_interface=self.DRIVE)
166+
167+
168+
def get_udisks(ver=None):
169+
if ver is None:
170+
try:
171+
u = UDisks2()
172+
except NoUDisks2:
173+
u = UDisks()
174+
return u
175+
return UDisks2() if ver == 2 else UDisks()
176+
177+
178+
def get_udisks1():
179+
u = None
180+
try:
181+
u = UDisks()
182+
except NoUDisks1:
183+
try:
184+
u = UDisks2()
185+
except NoUDisks2:
186+
pass
187+
if u is None:
188+
raise EnvironmentError('UDisks not available on your system')
189+
return u
190+
191+
192+
def mount(node_path):
193+
u = get_udisks1()
194+
u.mount(node_path)
195+
196+
197+
def eject(node_path):
198+
u = get_udisks1()
199+
u.eject(node_path)
200+
201+
202+
def umount(node_path):
203+
u = get_udisks1()
204+
u.unmount(node_path)
205+
206+
207+
def test_udisks(ver=None):
208+
import sys
209+
dev = sys.argv[1]
210+
print('Testing with node', dev)
211+
u = get_udisks(ver=ver)
212+
print('Using Udisks:', u.__class__.__name__)
213+
print('Mounted at:', u.mount(dev))
214+
print('Unmounting')
215+
u.unmount(dev)
216+
print('Mounting')
217+
u.mount(dev)
218+
print('Ejecting:')
219+
u.eject(dev)
220+
221+
if __name__ == '__main__':
222+
print('Run test here...')
223+
# test_udisks()

0 commit comments

Comments
 (0)