summaryrefslogtreecommitdiffstats
path: root/liveusb/creator.py
diff options
context:
space:
mode:
Diffstat (limited to 'liveusb/creator.py')
-rwxr-xr-xliveusb/creator.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/liveusb/creator.py b/liveusb/creator.py
index 0dbb4f6..6a3e071 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -1043,8 +1043,6 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
os.stat(tmp_syslinux).st_mode | stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
self.flush_buffers()
self.unmount_device()
- # XXX: use call_open_for_restore_sync to avoid needing write
- # access to the raw block device
self.popen('%s %s -d %s %s' % (
tmp_syslinux,
' '.join(self.syslinux_options()),
@@ -1233,13 +1231,18 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
% {path: mbr_path}))
def reset_mbr(self):
- parent = self.drive.get('parent', self._drive)
+ parent = parent = self.drive.get('parent', self._drive)
if parent is None:
parent = self._drive
+ parent_udi = self.drive['udi']
+ else:
+ parent_udi = self.drive['parent_udi']
+ parent_udi = str(parent_udi)
parent = str(parent)
if '/dev/loop' not in self.drive:
self.log.info(_('Resetting Master Boot Record of %s') % parent)
- obj = self._get_object()
+ self.log.debug(_('Resetting Master Boot Record of %s') % parent_udi)
+ obj = self._get_object(udi=parent_udi)
block = obj.props.block
write_to_block_device(block, self.extracted_mbr_content)
else: