usb-creator-hackers team mailing list archive
-
usb-creator-hackers team
-
Mailing list archive
-
Message #00163
[Merge] lp:~yuningdodo/usb-creator/usb-creator.lp1424915-check-for-iso9660 into lp:usb-creator
Yu Ning has proposed merging lp:~yuningdodo/usb-creator/usb-creator.lp1424915-check-for-iso9660 into lp:usb-creator.
Requested reviews:
usb-creator hackers (usb-creator-hackers)
Related bugs:
Bug #1424915 in usb-creator (Ubuntu): "dd an ubuntu iso to usbstick, then it can't be erased with usb-creator"
https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/1424915
For more details, see:
https://code.launchpad.net/~yuningdodo/usb-creator/usb-creator.lp1424915-check-for-iso9660/+merge/250718
To format an usbstick, which was previously dd'ed with an isohybrid ISO image, we need to format the whole drive instead of any partition. (LP: #1424915)
--
Your team usb-creator hackers is requested to review the proposed merge of lp:~yuningdodo/usb-creator/usb-creator.lp1424915-check-for-iso9660 into lp:usb-creator.
=== modified file 'bin/usb-creator-helper'
--- bin/usb-creator-helper 2014-09-02 20:12:12 +0000
+++ bin/usb-creator-helper 2015-02-24 07:11:04 +0000
@@ -226,6 +226,14 @@
udisks = UDisks.Client.new_sync(None)
dev = udisks.get_object(device)
parent_dev = _get_parent_object(udisks, device)
+ # Check if parent has the type iso9660, in such a case we should
+ # format the whole disk instead of the partition.
+ if parent_dev:
+ parent_block = parent_dev.get_block()
+ parent_id_type = parent_block.get_cached_property('IdType').get_string()
+ if parent_id_type == 'iso9660':
+ device = parent_dev.get_object_path()
+ dev = udisks.get_object(device)
if not allow_system_internal:
check_system_internal(dev)
=== modified file 'usbcreator/backends/udisks/backend.py'
--- usbcreator/backends/udisks/backend.py 2015-01-17 00:03:17 +0000
+++ usbcreator/backends/udisks/backend.py 2015-02-24 07:11:04 +0000
@@ -294,7 +294,8 @@
def format_ended(self, dev=None):
self.format_done(dev)
obj = self.udisks.get_object(dev)
- self._device_changed(obj)
+ if obj:
+ self._device_changed(obj)
self.format_ended_cb()
def format_failed(self, message, dev=None):
Follow ups