diff -Nru dell-recovery-1.30.1/build/lib/Dell/driver_gtk.py dell-recovery-1.31/build/lib/Dell/driver_gtk.py --- dell-recovery-1.30.1/build/lib/Dell/driver_gtk.py 2013-05-01 19:23:42.000000000 +0000 +++ dell-recovery-1.31/build/lib/Dell/driver_gtk.py 2014-03-18 01:22:46.000000000 +0000 @@ -104,7 +104,7 @@ def install_driver(self, widget): '''Installs a driver package. Activated when install is pressed''' - parent = self.widgets.get_object('driver_window') + transient_for = self.widgets.get_object('driver_window') args = (self.fname, self.rp) try: status = _("Preparing to install package...") @@ -117,17 +117,17 @@ *args) except dbus.DBusException as msg: logging.error(msg) - self.dbus_exception_handler(msg, parent) + self.dbus_exception_handler(msg, transient_for) self.toggle_spinner() return def package_installed(self, exit_status, msg): - parent = self.widgets.get_object('driver_window') + transient_for = self.widgets.get_object('driver_window') if exit_status != EXIT_SUCCESS: if not msg: msg = _("Package installation failed") logging.error(msg) - self.show_alert(Gtk.MessageType.ERROR, _("Package Install Failed"), msg , parent) + self.show_alert(Gtk.MessageType.ERROR, _("Package Install Failed"), msg , transient_for) self.toggle_spinner() return @@ -186,9 +186,9 @@ {'report_package_info': self.update_driver_gui}, self.fname) except dbus.DBusException as msg: - parent = self.widgets.get_object('driver_window') + transient_for = self.widgets.get_object('driver_window') logging.error(msg) - self.dbus_exception_handler(msg, parent) + self.dbus_exception_handler(msg, transient_for) def browse_clicked(self, widget): '''browse button clicked''' diff -Nru dell-recovery-1.30.1/build/lib/Dell/recovery_advanced_gtk.py dell-recovery-1.31/build/lib/Dell/recovery_advanced_gtk.py --- dell-recovery-1.30.1/build/lib/Dell/recovery_advanced_gtk.py 2012-05-22 18:18:37.000000000 +0000 +++ dell-recovery-1.31/build/lib/Dell/recovery_advanced_gtk.py 2014-03-18 01:22:46.000000000 +0000 @@ -73,11 +73,11 @@ OS media image. You will have the option to \ create an USB key or DVD image.")) - self.file_dialog = Gtk.FileChooserDialog("Choose Item", - None, - Gtk.FileChooserAction.OPEN, - (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, - Gtk.STOCK_OPEN, Gtk.ResponseType.OK)) + self.file_dialog = Gtk.FileChooserDialog(title = "Choose Item", + transient_for = None, + action = Gtk.FileChooserAction.OPEN) + self.file_dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, + Gtk.STOCK_OPEN, Gtk.ResponseType.OK) self.file_dialog.set_default_response(Gtk.ResponseType.OK) #setup transient windows @@ -344,8 +344,8 @@ {'report_iso_info': self.update_version_gui}, ret) except dbus.DBusException as msg: - parent = self.widgets.get_object('wizard') - self.dbus_exception_handler(msg, parent) + transient_for = self.widgets.get_object('wizard') + self.dbus_exception_handler(msg, transient_for) self.toggle_spinner_popup(False) self.builder_base_image = ret @@ -507,7 +507,7 @@ reply_handler=None, error_handler=None) - dialog = AptProgressDialog(trans, parent=wizard) + dialog = AptProgressDialog(trans, transient_for=wizard) dialog.run() super(AptProgressDialog, dialog).run() except dbus.exceptions.DBusException as msg: diff -Nru dell-recovery-1.30.1/build/lib/Dell/recovery_backend.py dell-recovery-1.31/build/lib/Dell/recovery_backend.py --- dell-recovery-1.30.1/build/lib/Dell/recovery_backend.py 2013-05-02 17:50:20.000000000 +0000 +++ dell-recovery-1.31/build/lib/Dell/recovery_backend.py 2014-03-18 01:22:46.000000000 +0000 @@ -933,9 +933,6 @@ self._reset_timeout() self._check_polkit_privilege(sender, conn, 'com.dell.recoverymedia.restore') logging.debug("enable_boot_to_restore") - - self._prepare_reboot("99_dell_recovery") - self._prepare_reboot("99_dell_recovery") @dbus.service.method(DBUS_INTERFACE_NAME, diff -Nru dell-recovery-1.30.1/build/lib/Dell/recovery_basic_gtk.py dell-recovery-1.31/build/lib/Dell/recovery_basic_gtk.py --- dell-recovery-1.30.1/build/lib/Dell/recovery_basic_gtk.py 2013-03-05 21:04:11.000000000 +0000 +++ dell-recovery-1.31/build/lib/Dell/recovery_basic_gtk.py 2014-03-18 01:22:46.000000000 +0000 @@ -109,7 +109,7 @@ if self.up and self.rp: return True - (self.up, self.rp) = find_partitions(self.up, self.rp) + (self.up, self.rp) = find_partitions() return self.rp @@ -126,8 +126,8 @@ self.rp) except dbus.DBusException as msg: self.toggle_spinner_popup(False) - parent = self.widgets.get_object('wizard') - self.dbus_exception_handler(msg, parent) + transient_for = self.widgets.get_object('wizard') + self.dbus_exception_handler(msg, transient_for) return finally: self.toggle_spinner_popup(False) @@ -180,9 +180,9 @@ *args) self.update_progress_gui(_("Opening Burner"), 1.00) except dbus.DBusException as msg: - parent = self.widgets.get_object('progress_dialog') + transient_for = self.widgets.get_object('progress_dialog') fallback = self.widgets.get_object('wizard') - self.dbus_exception_handler(msg, parent, fallback) + self.dbus_exception_handler(msg, transient_for, fallback) return self.burn() @@ -208,7 +208,7 @@ image has been stored under the filename:\n") + \ os.path.join(self.path, self.image) self.show_alert(Gtk.MessageType.INFO, header, body, - parent=self.widgets.get_object('progress_dialog')) + transient_for=self.widgets.get_object('progress_dialog')) self.destroy(None) @@ -222,7 +222,7 @@ inst = _("System does not appear to contain Dell factory installed \ partition layout.") self.show_alert(Gtk.MessageType.ERROR, header, inst, - parent=self.widgets.get_object('wizard')) + transient_for=self.widgets.get_object('wizard')) return if DellRecoveryToolGTK.top_button_clicked(self, widget): @@ -334,7 +334,7 @@ text = '' text += "" + _("Media Type: ") + '' + burn_type + '\n' if self.rp: - if not "/dev" in self.rp: + if not self.rp.startswith(b'/dev'): text += "" + _("Recovery Partition: ") + '' text += self.rp + '\n' else: diff -Nru dell-recovery-1.30.1/build/lib/Dell/recovery_common.py dell-recovery-1.31/build/lib/Dell/recovery_common.py --- dell-recovery-1.30.1/build/lib/Dell/recovery_common.py 2013-05-02 17:49:46.000000000 +0000 +++ dell-recovery-1.31/build/lib/Dell/recovery_common.py 2014-03-18 01:22:46.000000000 +0000 @@ -25,7 +25,7 @@ import dbus.mainloop.glib import subprocess -from gi.repository import GLib +from gi.repository import GLib, UDisks import os import shutil import re @@ -77,6 +77,9 @@ 'up.tgz' , ] +UP_LABELS = [ 'dellutility' ] +RP_LABELS = [ 'recovery', 'install', 'os' ] + ## ## ##Common Functions## ## ## @@ -238,115 +241,61 @@ Only use this method during bootstrap. args: 'up' or 'rp' """ - bus = dbus.SystemBus() recovery = {} - udisk_bus_name = 'org.freedesktop.UDisks' - dev_bus_name = 'org.freedesktop.UDisks.Device' - if partition_type == 'up': - labels = ['dellutility'] + labels = UP_LABELS elif partition_type == 'rp': - labels = ['recovery', 'install', 'os'] - try: - obj = bus.get_object(udisk_bus_name, '/org/freedesktop/UDisks') - iface = dbus.Interface(obj, udisk_bus_name) - devices = iface.EnumerateDevices() - for check_label in labels: - for device in devices: - obj = bus.get_object(udisk_bus_name, device) - dev = dbus.Interface(obj, 'org.freedesktop.DBus.Properties') - label = dev.Get(dev_bus_name, 'IdLabel') - - if check_label == label.lower(): - recovery["label" ] = label - recovery["device"] = dev.Get(dev_bus_name, 'DeviceFile') - recovery["fs" ] = dev.Get(dev_bus_name, 'IdType') - recovery["slave" ] = dev.Get(dev_bus_name, 'PartitionSlave') - recovery["number"] = dev.Get(dev_bus_name, 'PartitionNumber') - recovery["parent"] = dev.Get(dev_bus_name, 'PartitionSlave') - recovery["uuid"] = dev.Get(dev_bus_name, 'IdUuid') - parent_obj = bus.get_object(udisk_bus_name, recovery["parent"]) - parent_dev = dbus.Interface(parent_obj, 'org.freedesktop.DBus.Properties') - recovery["size_gb"] = parent_dev.Get(dev_bus_name, 'DeviceSize') \ - / 1000000000 - break - if recovery: - dev_obj = bus.get_object(udisk_bus_name, recovery["slave"]) - dev = dbus.Interface(dev_obj, 'org.freedesktop.DBus.Properties') - recovery["slave"] = dev.Get(dev_bus_name, 'DeviceFile') - break + labels = RP_LABELS - except dbus.DBusException as msg: - print("%s, UDisks Failed" % str(msg)) + udisks = UDisks.Client.new_sync(None) + manager = udisks.get_object_manager() + for item in manager.get_objects(): + block = item.get_block() + if not block: + continue + if block.get_cached_property('HintSystem').get_boolean(): + check_label = block.get_cached_property("IdLabel") + if not check_label: + continue + if check_label.get_string().lower() in labels: + partition = item.get_partition() + recovery["label"] = check_label.get_string() + recovery["device"] = block.get_cached_property("Device").get_bytestring() + recovery["fs"] = block.get_cached_property("IdType").get_string() + recovery["drive"] = block.get_cached_property("Drive").get_string() + recovery["number"] = partition.get_cached_property("Number").unpack() + recovery["uuid"] = block.get_cached_property("IdUUID").get_string() + recovery["size_gb"] = partition.get_cached_property("Size").unpack() / 1000000000 + break + #find parent slave node, used for dell-bootstrap + if "device" in recovery: + for item in manager.get_objects(): + table = item.get_partition_table() + if not table: + continue + block = item.get_block() + if not block: + continue + if block.get_cached_property("Drive").get_string() == recovery["drive"]: + recovery["slave"] = block.get_cached_property("Device").get_bytestring().decode('utf-8') + break return recovery -def find_partitions(utility, recovery): +def find_partitions(): """Searches the system for utility and recovery partitions""" - bus = dbus.SystemBus() - - try: - #first try to use udisks, if this fails, fall back to devkit-disks. - obj = bus.get_object('org.freedesktop.UDisks', '/org/freedesktop/UDisks') - iface = dbus.Interface(obj, 'org.freedesktop.UDisks') - devices = iface.EnumerateDevices() - for device in devices: - dev_obj = bus.get_object('org.freedesktop.UDisks', device) - dev = dbus.Interface(dev_obj, 'org.freedesktop.DBus.Properties') - - label = dev.Get('org.freedesktop.UDisks.Device', 'IdLabel').lower() - filesystem = dev.Get('org.freedesktop.Udisks.Device', 'IdType') - - if not utility and label == 'dellutility': - utility = dev.Get('org.freedesktop.UDisks.Device', 'DeviceFile') - elif not recovery and ((label == 'install' or label == 'os') and 'vfat' in filesystem) or \ - ('recovery' in label and 'ntfs' in filesystem): - recovery = dev.Get('org.freedesktop.Udisks.Device', 'DeviceFile') - return (utility, recovery) - except dbus.DBusException as msg: - print("%s, UDisks Failed" % str(msg)) - try: - #next try to use devkit-disks. if this fails, then we can fall back to hal - obj = bus.get_object('org.freedesktop.DeviceKit.Disks', '/org/freedesktop/DeviceKit/Disks') - iface = dbus.Interface(obj, 'org.freedesktop.DeviceKit.Disks') - devices = iface.EnumerateDevices() - for device in devices: - dev_obj = bus.get_object('org.freedesktop.DeviceKit.Disks', device) - dev = dbus.Interface(dev_obj, 'org.freedesktop.DBus.Properties') - - label = dev.Get('org.freedesktop.DeviceKit.Disks.Device', 'id-label') - filesystem = dev.Get('org.freedesktop.DeviceKit.Disks.Device', 'id-type') - - if not utility and 'DellUtility' in label: - utility = dev.Get('org.freedesktop.DeviceKit.Disks.Device', 'device-file') - elif not recovery and (('install' in label or 'OS' in label) and 'vfat' in filesystem) or \ - ('RECOVERY' in label and 'ntfs' in filesystem): - recovery = dev.Get('org.freedesktop.DeviceKit.Disks.Device', 'device-file') - return (utility, recovery) - - except dbus.DBusException as msg: - print("%s, DeviceKit-Disks Failed" % str(msg)) - - try: - obj = bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager') - iface = dbus.Interface(obj, 'org.freedesktop.Hal.Manager') - devices = iface.FindDeviceByCapability('volume') - - for device in devices: - dev_obj = bus.get_object('org.freedesktop.Hal', device) - dev = dbus.Interface(dev_obj, 'org.freedesktop.Hal.Device') - - label = dev.GetProperty('volume.label') - filesystem = dev.GetProperty('volume.fstype') - if not utility and 'DellUtility' in label: - utility = dev.GetProperty('block.device') - elif not recovery and (('install' in label or 'OS' in label) and 'vfat' in filesystem) or \ - ('RECOVERY' in label and 'ntfs' in filesystem): - recovery = dev.GetProperty('block.device') - return (utility, recovery) - except dbus.DBusException as msg: - print("%s, HAL Failed" % str(msg)) + utility = find_factory_partition_stats('up') + if 'device' in utility: + utility = utility['device'] + else: + utility = None + recovery = find_factory_partition_stats('rp') + if 'device' in recovery: + recovery = recovery['device'] + else: + recovery = None + return (utility, recovery) def find_burners(): """Checks for what utilities are available to burn with""" @@ -382,49 +331,24 @@ #If we have apps for DVD burning, check hardware if dvd: found_supported_dvdr = False - try: - bus = dbus.SystemBus() - #first try to use udisks, if this fails, fall back to devkit-disks. - obj = bus.get_object('org.freedesktop.UDisks', '/org/freedesktop/UDisks') - iface = dbus.Interface(obj, 'org.freedesktop.UDisks') - devices = iface.EnumerateDevices() - for device in devices: - obj = bus.get_object('org.freedesktop.UDisks', device) - dev = dbus.Interface(obj, 'org.freedesktop.DBus.Properties') - - supported_media = dev.Get('org.freedesktop.UDisks.Device', 'DriveMediaCompatibility') - for item in supported_media: - if 'optical_dvd_r' in item: - found_supported_dvdr = True - break - if found_supported_dvdr: - break - if not found_supported_dvdr: - dvd = None - return (dvd, usb) - except dbus.DBusException as msg: - print("%s, UDisks Failed burner parse" % str(msg)) - try: - #first try to use devkit-disks. if this fails, then, it's OK - obj = bus.get_object('org.freedesktop.DeviceKit.Disks', '/org/freedesktop/DeviceKit/Disks') - iface = dbus.Interface(obj, 'org.freedesktop.DeviceKit.Disks') - devices = iface.EnumerateDevices() - for device in devices: - obj = bus.get_object('org.freedesktop.DeviceKit.Disks', device) - dev = dbus.Interface(obj, 'org.freedesktop.DBus.Properties') - - supported_media = dev.Get('org.freedesktop.DeviceKit.Disks.Device', 'DriveMediaCompatibility') - for item in supported_media: - if 'optical_dvd_r' in item: - found_supported_dvdr = True - break - if found_supported_dvdr: + valid_media_types=[ 'optical_dvd_plus_r', 'optical_dvd_plus_r_dl', + 'optical_dvd_plus_rw', 'optical_dvd_r', + 'optical_dvd_ram', 'optical_dvd_rw' ] + udisks = UDisks.Client.new_sync(None) + manager = udisks.get_object_manager() + for item in manager.get_objects(): + drive = item.get_drive() + if not drive or not drive.get_cached_property("MediaRemovable"): + continue + compatibility = drive.get_cached_property("MediaCompatibility") + for media in valid_media_types: + if media in compatibility: + found_supported_dvdr = True break - if not found_supported_dvdr: - dvd = None - except dbus.DBusException as msg: - print("%s, device kit Failed burner parse" % str(msg)) - + if found_supported_dvdr: + break + if not found_supported_dvdr: + dvd = None return (dvd, usb) def match_system_device(bus, vendor, device): @@ -600,8 +524,7 @@ new_initrd_file = os.path.join(new_initrd_directory, 'initrd' + new_suffix) logging.debug("create_new_uuid: new initrd file: %s" % new_initrd_file) chain0 = subprocess.Popen(['find'], cwd=tmpdir, stdout=subprocess.PIPE) - chain1 = subprocess.Popen(['cpio', '--quiet', '--dereference', '-o', - '-H', 'newc'], + chain1 = subprocess.Popen(['cpio', '--quiet', '-o', '-H', 'newc'], cwd=tmpdir, stdin=chain0.stdout, stdout=subprocess.PIPE) with open(new_initrd_file, 'wb') as initrd_fd: @@ -621,24 +544,20 @@ chroot: chroot to launch commands in rp_mount: mountpoint to find partition# and install g2ldr install_mount: mountpoint to find target OS UUID''' - bus = dbus.SystemBus() - udisk_bus_name = 'org.freedesktop.UDisks' - dev_bus_name = 'org.freedesktop.UDisks.Device' uuid = '' partition = '-1' - #Find the UUID we are installing to - obj = bus.get_object(udisk_bus_name, '/org/freedesktop/UDisks') - iface = dbus.Interface(obj, udisk_bus_name) - devices = iface.EnumerateDevices() - for device in devices: - obj = bus.get_object(udisk_bus_name, device) - dev = dbus.Interface(obj, 'org.freedesktop.DBus.Properties') - mount = dev.Get(dev_bus_name, 'DeviceMountPaths') + udisks = UDisks.Client.new_sync(None) + manager = udisks.get_object_manager() + for item in manager.get_objects(): + filesystem = item.get_filesystem() + part = item.get_partition() + if not filesystem or not part: + continue + mount = filesystem.get_cached_property('MountPoints') if mount and install_mount and install_mount in mount: - uuid = dev.Get(dev_bus_name, 'IdUuid') - elif mount and rp_mount and rp_mount in mount: - partition = str(dev.Get(dev_bus_name, 'DeviceMinor')) + uuid = part.get_cached_property('UUID') + partition = part.get_cached_property("Number") #The file that the Windows BCD will chainload shutil.copy('/usr/lib/grub/i386-pc/g2ldr.mbr', rp_mount) diff -Nru dell-recovery-1.30.1/build/lib/Dell/recovery_gtk.py dell-recovery-1.31/build/lib/Dell/recovery_gtk.py --- dell-recovery-1.30.1/build/lib/Dell/recovery_gtk.py 2013-03-05 21:32:50.000000000 +0000 +++ dell-recovery-1.31/build/lib/Dell/recovery_gtk.py 2014-03-18 01:22:46.000000000 +0000 @@ -98,11 +98,11 @@ sys.exit(1) except Exception as msg: self.show_alert(Gtk.MessageType.ERROR, "Exception", str(msg), - parent=self.tool_widgets.get_object('tool_selector')) + transient_for=self.tool_widgets.get_object('tool_selector')) return self._dbus_iface - def dbus_exception_handler(self, msg, parent=None, fallback=None): + def dbus_exception_handler(self, msg, transient_for=None, fallback=None): """Common handler used for dbus type exceptions""" if msg.get_dbus_name() == 'org.freedesktop.DBus.Error.FileNotFound': text = _("Cannot connect to dbus") @@ -111,13 +111,13 @@ else: text = msg.get_dbus_message() - if not parent: - parent = self.tool_widgets.get_object('tool_selector') + if not transient_for: + transient_for = self.tool_widgets.get_object('tool_selector') - self.show_alert(Gtk.MessageType.ERROR, _("Exception"), text, parent) + self.show_alert(Gtk.MessageType.ERROR, _("Exception"), text, transient_for) if fallback: - parent.hide() + transient_for.hide() fallback.show() #### Callbacks ### @@ -151,12 +151,12 @@ #BIOS flash button elif widget == self.tool_widgets.get_object('flash_bios_button'): - file_dialog = Gtk.FileChooserDialog("Choose DOS BIOS Executable", - None, - Gtk.FileChooserAction.OPEN, - (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, - Gtk.STOCK_OPEN, Gtk.ResponseType.OK)) + file_dialog = Gtk.FileChooserDialog(title = "Choose DOS BIOS Executable", + transient_for = None, + action = Gtk.FileChooserAction.OPEN) file_dialog.set_default_response(Gtk.ResponseType.OK) + file_dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, + Gtk.STOCK_OPEN, Gtk.ResponseType.OK) file_filter = Gtk.FileFilter() file_filter.add_pattern("*.exe") file_filter.add_pattern("*.EXE") @@ -198,7 +198,7 @@ self.about_box.set_copyright(_("Copyright 2008-2012 Dell Inc.")) self.about_box.set_website("http://www.dell.com/ubuntu") self.about_box.set_authors(["Mario Limonciello"]) - self.about_box.set_destroy_with_parent(True) + self.about_box.set_destroy_with_transient_for(True) self.about_box.set_modal(True) self.about_box.set_transient_for(tool_selector) tool_selector.set_sensitive(False) @@ -216,15 +216,15 @@ self.tool_widgets.get_object('tool_selector').show() Gtk.main() - def show_alert(self, alert_type, header, body=None, parent=None): + def show_alert(self, alert_type, header, body=None, transient_for=None): """Displays an alert message""" dialog_hig = self.tool_widgets.get_object('dialog_hig') label_hig = self.tool_widgets.get_object('label_hig') image_hig = self.tool_widgets.get_object('image_hig') tool_selector = self.tool_widgets.get_object('tool_selector') - if parent is not None: - dialog_hig.set_transient_for(parent) + if transient_for is not None: + dialog_hig.set_transient_for(transient_for) else: dialog_hig.set_transient_for(tool_selector) diff -Nru dell-recovery-1.30.1/build/scripts-3.2/dell-driver-installer dell-recovery-1.31/build/scripts-3.2/dell-driver-installer --- dell-recovery-1.30.1/build/scripts-3.2/dell-driver-installer 2013-03-05 21:33:34.000000000 +0000 +++ dell-recovery-1.31/build/scripts-3.2/dell-driver-installer 2012-10-28 01:09:08.000000000 +0000 @@ -54,7 +54,7 @@ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) utility, recovery = find_partitions('', '') - args = (recovery, utility, parser_args.fname, 'driver') + args = (recovery, parser_args.fname, 'driver') tool = DriverGTK(*args) tool.run() diff -Nru dell-recovery-1.30.1/build/scripts-3.3/dell-driver-installer dell-recovery-1.31/build/scripts-3.3/dell-driver-installer --- dell-recovery-1.30.1/build/scripts-3.3/dell-driver-installer 2013-09-30 18:11:53.000000000 +0000 +++ dell-recovery-1.31/build/scripts-3.3/dell-driver-installer 2014-03-18 01:58:26.000000000 +0000 @@ -52,7 +52,7 @@ if __name__ == '__main__': import dbus.mainloop.glib dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - utility, recovery = find_partitions('', '') + utility, recovery = find_partitions() args = (recovery, utility, parser_args.fname, 'driver') tool = DriverGTK(*args) diff -Nru dell-recovery-1.30.1/build/scripts-3.3/dell-recovery dell-recovery-1.31/build/scripts-3.3/dell-recovery --- dell-recovery-1.30.1/build/scripts-3.3/dell-recovery 2013-09-30 18:11:53.000000000 +0000 +++ dell-recovery-1.31/build/scripts-3.3/dell-recovery 2014-03-18 01:58:26.000000000 +0000 @@ -40,8 +40,6 @@ usage = '%prog [options]' parser = optparse.OptionParser(usage=usage) parser.set_defaults( - up='', - rp='', version='', media="dvd", builder=False, @@ -53,10 +51,6 @@ ) parser.add_option('-c', '--check-version', dest='checkversion', action='store_true', help='Show the version information.') -parser.add_option('-u', '--up', dest='up', - help='Override detected utility partition with this file.') -parser.add_option('-r', '--rp', dest='rp', - help='Override detected recovery partition with this file.') parser.add_option('-v', '--override-version', dest='version', help='Override the automatic version number generation of this ISO.') parser.add_option('-m', '--media', dest='media', @@ -83,7 +77,7 @@ else: import dbus.mainloop.glib dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - utility, recovery = find_partitions(options.up,options.rp) + utility, recovery = find_partitions() #If we don't find an RP, assume builder mode. if not options.burn and not recovery and not options.builder: diff -Nru dell-recovery-1.30.1/build/scripts-3.4/dell-driver-installer dell-recovery-1.31/build/scripts-3.4/dell-driver-installer --- dell-recovery-1.30.1/build/scripts-3.4/dell-driver-installer 2014-02-20 15:07:19.000000000 +0000 +++ dell-recovery-1.31/build/scripts-3.4/dell-driver-installer 2014-03-18 01:58:24.000000000 +0000 @@ -52,7 +52,7 @@ if __name__ == '__main__': import dbus.mainloop.glib dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - utility, recovery = find_partitions('', '') + utility, recovery = find_partitions() args = (recovery, utility, parser_args.fname, 'driver') tool = DriverGTK(*args) diff -Nru dell-recovery-1.30.1/build/scripts-3.4/dell-recovery dell-recovery-1.31/build/scripts-3.4/dell-recovery --- dell-recovery-1.30.1/build/scripts-3.4/dell-recovery 2014-02-20 15:07:19.000000000 +0000 +++ dell-recovery-1.31/build/scripts-3.4/dell-recovery 2014-03-18 01:58:24.000000000 +0000 @@ -40,8 +40,6 @@ usage = '%prog [options]' parser = optparse.OptionParser(usage=usage) parser.set_defaults( - up='', - rp='', version='', media="dvd", builder=False, @@ -53,10 +51,6 @@ ) parser.add_option('-c', '--check-version', dest='checkversion', action='store_true', help='Show the version information.') -parser.add_option('-u', '--up', dest='up', - help='Override detected utility partition with this file.') -parser.add_option('-r', '--rp', dest='rp', - help='Override detected recovery partition with this file.') parser.add_option('-v', '--override-version', dest='version', help='Override the automatic version number generation of this ISO.') parser.add_option('-m', '--media', dest='media', @@ -83,7 +77,7 @@ else: import dbus.mainloop.glib dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - utility, recovery = find_partitions(options.up,options.rp) + utility, recovery = find_partitions() #If we don't find an RP, assume builder mode. if not options.burn and not recovery and not options.builder: diff -Nru dell-recovery-1.30.1/CHANGES dell-recovery-1.31/CHANGES --- dell-recovery-1.30.1/CHANGES 2014-02-20 15:06:58.000000000 +0000 +++ dell-recovery-1.31/CHANGES 2014-03-19 05:31:07.000000000 +0000 @@ -1,3 +1,17 @@ +dell-recovery (1.31) trusty; urgency=low + + * refresh grub2 patches for trusty grub2 2.02~beta2-7. + * fix some deprecated usage of python3 w/ gtk + * drop argument in find_partitions() + * Update to udisks2. Drop support for older udisks and devkit-disks + (LP: #1288253) + * debian/control: new standards version + * set booting kernel name to vmlinuz.efi now. + * drop old GRUB patches, only want to be booting to trusty+ now. + * disable dereference in building initrd. + + -- Mario Limonciello Wed, 19 Mar 2014 00:30:55 -0500 + dell-recovery (1.30.1) trusty; urgency=medium * Rewrite the python shebang path to /usr/bin/python3. diff -Nru dell-recovery-1.30.1/debian/changelog dell-recovery-1.31/debian/changelog --- dell-recovery-1.30.1/debian/changelog 2014-02-20 15:06:58.000000000 +0000 +++ dell-recovery-1.31/debian/changelog 2014-03-19 05:31:07.000000000 +0000 @@ -1,3 +1,17 @@ +dell-recovery (1.31) trusty; urgency=low + + * refresh grub2 patches for trusty grub2 2.02~beta2-7. + * fix some deprecated usage of python3 w/ gtk + * drop argument in find_partitions() + * Update to udisks2. Drop support for older udisks and devkit-disks + (LP: #1288253) + * debian/control: new standards version + * set booting kernel name to vmlinuz.efi now. + * drop old GRUB patches, only want to be booting to trusty+ now. + * disable dereference in building initrd. + + -- Mario Limonciello Wed, 19 Mar 2014 00:30:55 -0500 + dell-recovery (1.30.1) trusty; urgency=medium * Rewrite the python shebang path to /usr/bin/python3. diff -Nru dell-recovery-1.30.1/debian/control dell-recovery-1.31/debian/control --- dell-recovery-1.30.1/debian/control 2013-01-23 22:09:52.000000000 +0000 +++ dell-recovery-1.31/debian/control 2014-03-18 01:22:46.000000000 +0000 @@ -7,11 +7,11 @@ X-Python3-Version: >= 3.2 Homepage: http://linux.dell.com/ Vcs-Bzr: http://bazaar.launchpad.net/~dell-team/dell-recovery/trunk -Standards-Version: 3.9.3 +Standards-Version: 3.9.5 Package: dell-recovery Architecture: all -Depends: ${python3:Depends}, ${misc:Depends}, python3-dbus, python3-apt, gir1.2-gtk-3.0, policykit-1, uuid-runtime, udisks | devicekit-disks | hal, policykit-1-gnome, genisoimage, dpkg-repack, python-gobject (>= 2.28), python-debian, lzma | xz-utils (>= 5.1.1alpha+20120614-1) | xz-lzma, ttf-dejavu-core +Depends: ${python3:Depends}, ${misc:Depends}, python3-dbus, python3-apt, gir1.2-gtk-3.0, policykit-1, uuid-runtime, udisks2, policykit-1-gnome, genisoimage, dpkg-repack, python-gobject (>= 2.28), python-debian, lzma | xz-utils (>= 5.1.1alpha+20120614-1) | xz-lzma, fonts-dejavu-core Replaces: dell-artwork, dell-oobe Conflicts: dell-oobe Recommends: usb-creator-gtk, brasero | nautilus-cd-burner, lsb-release, python-aptdaemon.gtk3widgets, parted, python3-progressbar diff -Nru dell-recovery-1.30.1/Dell/driver_gtk.py dell-recovery-1.31/Dell/driver_gtk.py --- dell-recovery-1.30.1/Dell/driver_gtk.py 2013-05-01 19:23:42.000000000 +0000 +++ dell-recovery-1.31/Dell/driver_gtk.py 2014-03-18 01:22:46.000000000 +0000 @@ -104,7 +104,7 @@ def install_driver(self, widget): '''Installs a driver package. Activated when install is pressed''' - parent = self.widgets.get_object('driver_window') + transient_for = self.widgets.get_object('driver_window') args = (self.fname, self.rp) try: status = _("Preparing to install package...") @@ -117,17 +117,17 @@ *args) except dbus.DBusException as msg: logging.error(msg) - self.dbus_exception_handler(msg, parent) + self.dbus_exception_handler(msg, transient_for) self.toggle_spinner() return def package_installed(self, exit_status, msg): - parent = self.widgets.get_object('driver_window') + transient_for = self.widgets.get_object('driver_window') if exit_status != EXIT_SUCCESS: if not msg: msg = _("Package installation failed") logging.error(msg) - self.show_alert(Gtk.MessageType.ERROR, _("Package Install Failed"), msg , parent) + self.show_alert(Gtk.MessageType.ERROR, _("Package Install Failed"), msg , transient_for) self.toggle_spinner() return @@ -186,9 +186,9 @@ {'report_package_info': self.update_driver_gui}, self.fname) except dbus.DBusException as msg: - parent = self.widgets.get_object('driver_window') + transient_for = self.widgets.get_object('driver_window') logging.error(msg) - self.dbus_exception_handler(msg, parent) + self.dbus_exception_handler(msg, transient_for) def browse_clicked(self, widget): '''browse button clicked''' diff -Nru dell-recovery-1.30.1/Dell/recovery_advanced_gtk.py dell-recovery-1.31/Dell/recovery_advanced_gtk.py --- dell-recovery-1.30.1/Dell/recovery_advanced_gtk.py 2012-05-22 18:18:37.000000000 +0000 +++ dell-recovery-1.31/Dell/recovery_advanced_gtk.py 2014-03-18 01:22:46.000000000 +0000 @@ -73,11 +73,11 @@ OS media image. You will have the option to \ create an USB key or DVD image.")) - self.file_dialog = Gtk.FileChooserDialog("Choose Item", - None, - Gtk.FileChooserAction.OPEN, - (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, - Gtk.STOCK_OPEN, Gtk.ResponseType.OK)) + self.file_dialog = Gtk.FileChooserDialog(title = "Choose Item", + transient_for = None, + action = Gtk.FileChooserAction.OPEN) + self.file_dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, + Gtk.STOCK_OPEN, Gtk.ResponseType.OK) self.file_dialog.set_default_response(Gtk.ResponseType.OK) #setup transient windows @@ -344,8 +344,8 @@ {'report_iso_info': self.update_version_gui}, ret) except dbus.DBusException as msg: - parent = self.widgets.get_object('wizard') - self.dbus_exception_handler(msg, parent) + transient_for = self.widgets.get_object('wizard') + self.dbus_exception_handler(msg, transient_for) self.toggle_spinner_popup(False) self.builder_base_image = ret @@ -507,7 +507,7 @@ reply_handler=None, error_handler=None) - dialog = AptProgressDialog(trans, parent=wizard) + dialog = AptProgressDialog(trans, transient_for=wizard) dialog.run() super(AptProgressDialog, dialog).run() except dbus.exceptions.DBusException as msg: diff -Nru dell-recovery-1.30.1/Dell/recovery_backend.py dell-recovery-1.31/Dell/recovery_backend.py --- dell-recovery-1.30.1/Dell/recovery_backend.py 2013-05-02 17:50:20.000000000 +0000 +++ dell-recovery-1.31/Dell/recovery_backend.py 2014-03-18 01:22:46.000000000 +0000 @@ -933,9 +933,6 @@ self._reset_timeout() self._check_polkit_privilege(sender, conn, 'com.dell.recoverymedia.restore') logging.debug("enable_boot_to_restore") - - self._prepare_reboot("99_dell_recovery") - self._prepare_reboot("99_dell_recovery") @dbus.service.method(DBUS_INTERFACE_NAME, diff -Nru dell-recovery-1.30.1/Dell/recovery_basic_gtk.py dell-recovery-1.31/Dell/recovery_basic_gtk.py --- dell-recovery-1.30.1/Dell/recovery_basic_gtk.py 2013-03-05 21:04:11.000000000 +0000 +++ dell-recovery-1.31/Dell/recovery_basic_gtk.py 2014-03-18 01:22:46.000000000 +0000 @@ -109,7 +109,7 @@ if self.up and self.rp: return True - (self.up, self.rp) = find_partitions(self.up, self.rp) + (self.up, self.rp) = find_partitions() return self.rp @@ -126,8 +126,8 @@ self.rp) except dbus.DBusException as msg: self.toggle_spinner_popup(False) - parent = self.widgets.get_object('wizard') - self.dbus_exception_handler(msg, parent) + transient_for = self.widgets.get_object('wizard') + self.dbus_exception_handler(msg, transient_for) return finally: self.toggle_spinner_popup(False) @@ -180,9 +180,9 @@ *args) self.update_progress_gui(_("Opening Burner"), 1.00) except dbus.DBusException as msg: - parent = self.widgets.get_object('progress_dialog') + transient_for = self.widgets.get_object('progress_dialog') fallback = self.widgets.get_object('wizard') - self.dbus_exception_handler(msg, parent, fallback) + self.dbus_exception_handler(msg, transient_for, fallback) return self.burn() @@ -208,7 +208,7 @@ image has been stored under the filename:\n") + \ os.path.join(self.path, self.image) self.show_alert(Gtk.MessageType.INFO, header, body, - parent=self.widgets.get_object('progress_dialog')) + transient_for=self.widgets.get_object('progress_dialog')) self.destroy(None) @@ -222,7 +222,7 @@ inst = _("System does not appear to contain Dell factory installed \ partition layout.") self.show_alert(Gtk.MessageType.ERROR, header, inst, - parent=self.widgets.get_object('wizard')) + transient_for=self.widgets.get_object('wizard')) return if DellRecoveryToolGTK.top_button_clicked(self, widget): @@ -334,7 +334,7 @@ text = '' text += "" + _("Media Type: ") + '' + burn_type + '\n' if self.rp: - if not "/dev" in self.rp: + if not self.rp.startswith(b'/dev'): text += "" + _("Recovery Partition: ") + '' text += self.rp + '\n' else: diff -Nru dell-recovery-1.30.1/Dell/recovery_common.py dell-recovery-1.31/Dell/recovery_common.py --- dell-recovery-1.30.1/Dell/recovery_common.py 2013-05-02 17:49:46.000000000 +0000 +++ dell-recovery-1.31/Dell/recovery_common.py 2014-03-18 01:22:46.000000000 +0000 @@ -25,7 +25,7 @@ import dbus.mainloop.glib import subprocess -from gi.repository import GLib +from gi.repository import GLib, UDisks import os import shutil import re @@ -77,6 +77,9 @@ 'up.tgz' , ] +UP_LABELS = [ 'dellutility' ] +RP_LABELS = [ 'recovery', 'install', 'os' ] + ## ## ##Common Functions## ## ## @@ -238,115 +241,61 @@ Only use this method during bootstrap. args: 'up' or 'rp' """ - bus = dbus.SystemBus() recovery = {} - udisk_bus_name = 'org.freedesktop.UDisks' - dev_bus_name = 'org.freedesktop.UDisks.Device' - if partition_type == 'up': - labels = ['dellutility'] + labels = UP_LABELS elif partition_type == 'rp': - labels = ['recovery', 'install', 'os'] - try: - obj = bus.get_object(udisk_bus_name, '/org/freedesktop/UDisks') - iface = dbus.Interface(obj, udisk_bus_name) - devices = iface.EnumerateDevices() - for check_label in labels: - for device in devices: - obj = bus.get_object(udisk_bus_name, device) - dev = dbus.Interface(obj, 'org.freedesktop.DBus.Properties') - label = dev.Get(dev_bus_name, 'IdLabel') - - if check_label == label.lower(): - recovery["label" ] = label - recovery["device"] = dev.Get(dev_bus_name, 'DeviceFile') - recovery["fs" ] = dev.Get(dev_bus_name, 'IdType') - recovery["slave" ] = dev.Get(dev_bus_name, 'PartitionSlave') - recovery["number"] = dev.Get(dev_bus_name, 'PartitionNumber') - recovery["parent"] = dev.Get(dev_bus_name, 'PartitionSlave') - recovery["uuid"] = dev.Get(dev_bus_name, 'IdUuid') - parent_obj = bus.get_object(udisk_bus_name, recovery["parent"]) - parent_dev = dbus.Interface(parent_obj, 'org.freedesktop.DBus.Properties') - recovery["size_gb"] = parent_dev.Get(dev_bus_name, 'DeviceSize') \ - / 1000000000 - break - if recovery: - dev_obj = bus.get_object(udisk_bus_name, recovery["slave"]) - dev = dbus.Interface(dev_obj, 'org.freedesktop.DBus.Properties') - recovery["slave"] = dev.Get(dev_bus_name, 'DeviceFile') - break + labels = RP_LABELS - except dbus.DBusException as msg: - print("%s, UDisks Failed" % str(msg)) + udisks = UDisks.Client.new_sync(None) + manager = udisks.get_object_manager() + for item in manager.get_objects(): + block = item.get_block() + if not block: + continue + if block.get_cached_property('HintSystem').get_boolean(): + check_label = block.get_cached_property("IdLabel") + if not check_label: + continue + if check_label.get_string().lower() in labels: + partition = item.get_partition() + recovery["label"] = check_label.get_string() + recovery["device"] = block.get_cached_property("Device").get_bytestring() + recovery["fs"] = block.get_cached_property("IdType").get_string() + recovery["drive"] = block.get_cached_property("Drive").get_string() + recovery["number"] = partition.get_cached_property("Number").unpack() + recovery["uuid"] = block.get_cached_property("IdUUID").get_string() + recovery["size_gb"] = partition.get_cached_property("Size").unpack() / 1000000000 + break + #find parent slave node, used for dell-bootstrap + if "device" in recovery: + for item in manager.get_objects(): + table = item.get_partition_table() + if not table: + continue + block = item.get_block() + if not block: + continue + if block.get_cached_property("Drive").get_string() == recovery["drive"]: + recovery["slave"] = block.get_cached_property("Device").get_bytestring().decode('utf-8') + break return recovery -def find_partitions(utility, recovery): +def find_partitions(): """Searches the system for utility and recovery partitions""" - bus = dbus.SystemBus() - - try: - #first try to use udisks, if this fails, fall back to devkit-disks. - obj = bus.get_object('org.freedesktop.UDisks', '/org/freedesktop/UDisks') - iface = dbus.Interface(obj, 'org.freedesktop.UDisks') - devices = iface.EnumerateDevices() - for device in devices: - dev_obj = bus.get_object('org.freedesktop.UDisks', device) - dev = dbus.Interface(dev_obj, 'org.freedesktop.DBus.Properties') - - label = dev.Get('org.freedesktop.UDisks.Device', 'IdLabel').lower() - filesystem = dev.Get('org.freedesktop.Udisks.Device', 'IdType') - - if not utility and label == 'dellutility': - utility = dev.Get('org.freedesktop.UDisks.Device', 'DeviceFile') - elif not recovery and ((label == 'install' or label == 'os') and 'vfat' in filesystem) or \ - ('recovery' in label and 'ntfs' in filesystem): - recovery = dev.Get('org.freedesktop.Udisks.Device', 'DeviceFile') - return (utility, recovery) - except dbus.DBusException as msg: - print("%s, UDisks Failed" % str(msg)) - try: - #next try to use devkit-disks. if this fails, then we can fall back to hal - obj = bus.get_object('org.freedesktop.DeviceKit.Disks', '/org/freedesktop/DeviceKit/Disks') - iface = dbus.Interface(obj, 'org.freedesktop.DeviceKit.Disks') - devices = iface.EnumerateDevices() - for device in devices: - dev_obj = bus.get_object('org.freedesktop.DeviceKit.Disks', device) - dev = dbus.Interface(dev_obj, 'org.freedesktop.DBus.Properties') - - label = dev.Get('org.freedesktop.DeviceKit.Disks.Device', 'id-label') - filesystem = dev.Get('org.freedesktop.DeviceKit.Disks.Device', 'id-type') - - if not utility and 'DellUtility' in label: - utility = dev.Get('org.freedesktop.DeviceKit.Disks.Device', 'device-file') - elif not recovery and (('install' in label or 'OS' in label) and 'vfat' in filesystem) or \ - ('RECOVERY' in label and 'ntfs' in filesystem): - recovery = dev.Get('org.freedesktop.DeviceKit.Disks.Device', 'device-file') - return (utility, recovery) - - except dbus.DBusException as msg: - print("%s, DeviceKit-Disks Failed" % str(msg)) - - try: - obj = bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager') - iface = dbus.Interface(obj, 'org.freedesktop.Hal.Manager') - devices = iface.FindDeviceByCapability('volume') - - for device in devices: - dev_obj = bus.get_object('org.freedesktop.Hal', device) - dev = dbus.Interface(dev_obj, 'org.freedesktop.Hal.Device') - - label = dev.GetProperty('volume.label') - filesystem = dev.GetProperty('volume.fstype') - if not utility and 'DellUtility' in label: - utility = dev.GetProperty('block.device') - elif not recovery and (('install' in label or 'OS' in label) and 'vfat' in filesystem) or \ - ('RECOVERY' in label and 'ntfs' in filesystem): - recovery = dev.GetProperty('block.device') - return (utility, recovery) - except dbus.DBusException as msg: - print("%s, HAL Failed" % str(msg)) + utility = find_factory_partition_stats('up') + if 'device' in utility: + utility = utility['device'] + else: + utility = None + recovery = find_factory_partition_stats('rp') + if 'device' in recovery: + recovery = recovery['device'] + else: + recovery = None + return (utility, recovery) def find_burners(): """Checks for what utilities are available to burn with""" @@ -382,49 +331,24 @@ #If we have apps for DVD burning, check hardware if dvd: found_supported_dvdr = False - try: - bus = dbus.SystemBus() - #first try to use udisks, if this fails, fall back to devkit-disks. - obj = bus.get_object('org.freedesktop.UDisks', '/org/freedesktop/UDisks') - iface = dbus.Interface(obj, 'org.freedesktop.UDisks') - devices = iface.EnumerateDevices() - for device in devices: - obj = bus.get_object('org.freedesktop.UDisks', device) - dev = dbus.Interface(obj, 'org.freedesktop.DBus.Properties') - - supported_media = dev.Get('org.freedesktop.UDisks.Device', 'DriveMediaCompatibility') - for item in supported_media: - if 'optical_dvd_r' in item: - found_supported_dvdr = True - break - if found_supported_dvdr: - break - if not found_supported_dvdr: - dvd = None - return (dvd, usb) - except dbus.DBusException as msg: - print("%s, UDisks Failed burner parse" % str(msg)) - try: - #first try to use devkit-disks. if this fails, then, it's OK - obj = bus.get_object('org.freedesktop.DeviceKit.Disks', '/org/freedesktop/DeviceKit/Disks') - iface = dbus.Interface(obj, 'org.freedesktop.DeviceKit.Disks') - devices = iface.EnumerateDevices() - for device in devices: - obj = bus.get_object('org.freedesktop.DeviceKit.Disks', device) - dev = dbus.Interface(obj, 'org.freedesktop.DBus.Properties') - - supported_media = dev.Get('org.freedesktop.DeviceKit.Disks.Device', 'DriveMediaCompatibility') - for item in supported_media: - if 'optical_dvd_r' in item: - found_supported_dvdr = True - break - if found_supported_dvdr: + valid_media_types=[ 'optical_dvd_plus_r', 'optical_dvd_plus_r_dl', + 'optical_dvd_plus_rw', 'optical_dvd_r', + 'optical_dvd_ram', 'optical_dvd_rw' ] + udisks = UDisks.Client.new_sync(None) + manager = udisks.get_object_manager() + for item in manager.get_objects(): + drive = item.get_drive() + if not drive or not drive.get_cached_property("MediaRemovable"): + continue + compatibility = drive.get_cached_property("MediaCompatibility") + for media in valid_media_types: + if media in compatibility: + found_supported_dvdr = True break - if not found_supported_dvdr: - dvd = None - except dbus.DBusException as msg: - print("%s, device kit Failed burner parse" % str(msg)) - + if found_supported_dvdr: + break + if not found_supported_dvdr: + dvd = None return (dvd, usb) def match_system_device(bus, vendor, device): @@ -600,8 +524,7 @@ new_initrd_file = os.path.join(new_initrd_directory, 'initrd' + new_suffix) logging.debug("create_new_uuid: new initrd file: %s" % new_initrd_file) chain0 = subprocess.Popen(['find'], cwd=tmpdir, stdout=subprocess.PIPE) - chain1 = subprocess.Popen(['cpio', '--quiet', '--dereference', '-o', - '-H', 'newc'], + chain1 = subprocess.Popen(['cpio', '--quiet', '-o', '-H', 'newc'], cwd=tmpdir, stdin=chain0.stdout, stdout=subprocess.PIPE) with open(new_initrd_file, 'wb') as initrd_fd: @@ -621,24 +544,20 @@ chroot: chroot to launch commands in rp_mount: mountpoint to find partition# and install g2ldr install_mount: mountpoint to find target OS UUID''' - bus = dbus.SystemBus() - udisk_bus_name = 'org.freedesktop.UDisks' - dev_bus_name = 'org.freedesktop.UDisks.Device' uuid = '' partition = '-1' - #Find the UUID we are installing to - obj = bus.get_object(udisk_bus_name, '/org/freedesktop/UDisks') - iface = dbus.Interface(obj, udisk_bus_name) - devices = iface.EnumerateDevices() - for device in devices: - obj = bus.get_object(udisk_bus_name, device) - dev = dbus.Interface(obj, 'org.freedesktop.DBus.Properties') - mount = dev.Get(dev_bus_name, 'DeviceMountPaths') + udisks = UDisks.Client.new_sync(None) + manager = udisks.get_object_manager() + for item in manager.get_objects(): + filesystem = item.get_filesystem() + part = item.get_partition() + if not filesystem or not part: + continue + mount = filesystem.get_cached_property('MountPoints') if mount and install_mount and install_mount in mount: - uuid = dev.Get(dev_bus_name, 'IdUuid') - elif mount and rp_mount and rp_mount in mount: - partition = str(dev.Get(dev_bus_name, 'DeviceMinor')) + uuid = part.get_cached_property('UUID') + partition = part.get_cached_property("Number") #The file that the Windows BCD will chainload shutil.copy('/usr/lib/grub/i386-pc/g2ldr.mbr', rp_mount) diff -Nru dell-recovery-1.30.1/Dell/recovery_gtk.py dell-recovery-1.31/Dell/recovery_gtk.py --- dell-recovery-1.30.1/Dell/recovery_gtk.py 2013-03-05 21:32:50.000000000 +0000 +++ dell-recovery-1.31/Dell/recovery_gtk.py 2014-03-18 01:22:46.000000000 +0000 @@ -98,11 +98,11 @@ sys.exit(1) except Exception as msg: self.show_alert(Gtk.MessageType.ERROR, "Exception", str(msg), - parent=self.tool_widgets.get_object('tool_selector')) + transient_for=self.tool_widgets.get_object('tool_selector')) return self._dbus_iface - def dbus_exception_handler(self, msg, parent=None, fallback=None): + def dbus_exception_handler(self, msg, transient_for=None, fallback=None): """Common handler used for dbus type exceptions""" if msg.get_dbus_name() == 'org.freedesktop.DBus.Error.FileNotFound': text = _("Cannot connect to dbus") @@ -111,13 +111,13 @@ else: text = msg.get_dbus_message() - if not parent: - parent = self.tool_widgets.get_object('tool_selector') + if not transient_for: + transient_for = self.tool_widgets.get_object('tool_selector') - self.show_alert(Gtk.MessageType.ERROR, _("Exception"), text, parent) + self.show_alert(Gtk.MessageType.ERROR, _("Exception"), text, transient_for) if fallback: - parent.hide() + transient_for.hide() fallback.show() #### Callbacks ### @@ -151,12 +151,12 @@ #BIOS flash button elif widget == self.tool_widgets.get_object('flash_bios_button'): - file_dialog = Gtk.FileChooserDialog("Choose DOS BIOS Executable", - None, - Gtk.FileChooserAction.OPEN, - (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, - Gtk.STOCK_OPEN, Gtk.ResponseType.OK)) + file_dialog = Gtk.FileChooserDialog(title = "Choose DOS BIOS Executable", + transient_for = None, + action = Gtk.FileChooserAction.OPEN) file_dialog.set_default_response(Gtk.ResponseType.OK) + file_dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, + Gtk.STOCK_OPEN, Gtk.ResponseType.OK) file_filter = Gtk.FileFilter() file_filter.add_pattern("*.exe") file_filter.add_pattern("*.EXE") @@ -198,7 +198,7 @@ self.about_box.set_copyright(_("Copyright 2008-2012 Dell Inc.")) self.about_box.set_website("http://www.dell.com/ubuntu") self.about_box.set_authors(["Mario Limonciello"]) - self.about_box.set_destroy_with_parent(True) + self.about_box.set_destroy_with_transient_for(True) self.about_box.set_modal(True) self.about_box.set_transient_for(tool_selector) tool_selector.set_sensitive(False) @@ -216,15 +216,15 @@ self.tool_widgets.get_object('tool_selector').show() Gtk.main() - def show_alert(self, alert_type, header, body=None, parent=None): + def show_alert(self, alert_type, header, body=None, transient_for=None): """Displays an alert message""" dialog_hig = self.tool_widgets.get_object('dialog_hig') label_hig = self.tool_widgets.get_object('label_hig') image_hig = self.tool_widgets.get_object('image_hig') tool_selector = self.tool_widgets.get_object('tool_selector') - if parent is not None: - dialog_hig.set_transient_for(parent) + if transient_for is not None: + dialog_hig.set_transient_for(transient_for) else: dialog_hig.set_transient_for(tool_selector) diff -Nru dell-recovery-1.30.1/dell-driver-installer dell-recovery-1.31/dell-driver-installer --- dell-recovery-1.30.1/dell-driver-installer 2013-03-05 21:04:11.000000000 +0000 +++ dell-recovery-1.31/dell-driver-installer 2014-03-18 01:22:46.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Dell Driver Installer @@ -52,7 +52,7 @@ if __name__ == '__main__': import dbus.mainloop.glib dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - utility, recovery = find_partitions('', '') + utility, recovery = find_partitions() args = (recovery, utility, parser_args.fname, 'driver') tool = DriverGTK(*args) diff -Nru dell-recovery-1.30.1/dell-recovery dell-recovery-1.31/dell-recovery --- dell-recovery-1.30.1/dell-recovery 2012-05-22 18:13:29.000000000 +0000 +++ dell-recovery-1.31/dell-recovery 2014-03-18 01:22:46.000000000 +0000 @@ -40,8 +40,6 @@ usage = '%prog [options]' parser = optparse.OptionParser(usage=usage) parser.set_defaults( - up='', - rp='', version='', media="dvd", builder=False, @@ -53,10 +51,6 @@ ) parser.add_option('-c', '--check-version', dest='checkversion', action='store_true', help='Show the version information.') -parser.add_option('-u', '--up', dest='up', - help='Override detected utility partition with this file.') -parser.add_option('-r', '--rp', dest='rp', - help='Override detected recovery partition with this file.') parser.add_option('-v', '--override-version', dest='version', help='Override the automatic version number generation of this ISO.') parser.add_option('-m', '--media', dest='media', @@ -83,7 +77,7 @@ else: import dbus.mainloop.glib dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - utility, recovery = find_partitions(options.up,options.rp) + utility, recovery = find_partitions() #If we don't find an RP, assume builder mode. if not options.burn and not recovery and not options.builder: diff -Nru dell-recovery-1.30.1/grub/patches/quantal/dell-support.patch dell-recovery-1.31/grub/patches/quantal/dell-support.patch --- dell-recovery-1.30.1/grub/patches/quantal/dell-support.patch 2013-02-25 19:11:48.000000000 +0000 +++ dell-recovery-1.31/grub/patches/quantal/dell-support.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -This patch sets up the default directories to install to -the target the MBR of the first hard disk from C:\factory. - -It's analogous to calling grub-setup.exe like this: - -# grub-setup -d C:\factory -r "(//./PHYSICALDRIVE0/)" "//./PHYSICALDRIVE0/" - -After this patch, it's possible to just install like this: - -# grub-setup.exe - -Index: grub2-2.00/include/grub/emu/misc.h -=================================================================== ---- grub2-2.00.orig/include/grub/emu/misc.h 2012-02-09 17:22:27.000000000 -0600 -+++ grub2-2.00/include/grub/emu/misc.h 2013-02-25 12:08:02.553024206 -0600 -@@ -36,8 +36,12 @@ - /* NetBSD uses /boot for its boot block. */ - # define DEFAULT_DIRECTORY "/"GRUB_DIR_NAME - #else -+#ifdef __MINGW32__ -+# define DEFAULT_DIRECTORY "C:/factory" -+#else - # define DEFAULT_DIRECTORY "/"GRUB_BOOT_DIR_NAME"/"GRUB_DIR_NAME - #endif -+#endif - - #define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map" - -Index: grub2-2.00/util/grub-setup.c -=================================================================== ---- grub2-2.00.orig/util/grub-setup.c 2013-02-25 12:07:04.000000000 -0600 -+++ grub2-2.00/util/grub-setup.c 2013-02-25 12:56:56.933047545 -0600 -@@ -83,6 +83,8 @@ - * result. - */ - -+#define DELL_TARGET "//./PHYSICALDRIVE0/" -+ - #define DEFAULT_BOOT_FILE "boot.img" - #define DEFAULT_CORE_FILE "core.img" - #define CORE_IMG_IN_FS "setup_left_core_image_in_filesystem" -@@ -147,7 +149,7 @@ - { - char *boot_path, *core_path, *core_path_dev, *core_path_dev_full; - char *boot_img, *core_img; -- char *root = 0; -+ char *root = grub_util_get_grub_dev (DELL_TARGET); - size_t boot_size, core_size; - grub_uint16_t core_sectors; - grub_device_t root_dev = 0, dest_dev, core_dev; -@@ -247,13 +249,19 @@ - - sizeof (*block)); - grub_util_info ("root is `%s', dest is `%s'", root, dest); - -+ /* Open the root device and the destination device. */ -+ grub_util_info ("Opening root"); -+ root_dev = grub_device_open (root); -+ if (! root_dev) -+ grub_util_error ("%s", grub_errmsg); -+ - grub_util_info ("Opening dest"); - dest_dev = grub_device_open (dest); - if (! dest_dev) - grub_util_error ("%s", grub_errmsg); - - core_dev = dest_dev; -- -+/* - { - char **root_devices = grub_guess_root_devices (dir); - char **cur; -@@ -298,6 +306,7 @@ - grub_util_info ("guessed root_dev `%s' from " - "dir `%s'", root_dev->disk->name, dir); - } -+*/ - - grub_util_info ("setting the root device to `%s'", root); - if (grub_env_set ("root", root) != GRUB_ERR_NONE) -@@ -494,6 +503,13 @@ - - assert (nsec <= maxsec); - -+ /* Ignore failures in the embedding test */ -+ if (grub_errno != GRUB_ERR_NONE) -+ { -+ grub_errno = GRUB_ERR_NONE; -+ grub_util_warn("The embedding test declared a failure. This is normally non-fatal during WinPE, so it will be ignored."); -+ } -+ - /* Clean out the blocklists. */ - block = first_block; - while (block->len) -@@ -1071,9 +1087,11 @@ - break; - - case ARGP_KEY_NO_ARGS: -- fprintf (stderr, "%s", _("No device is specified.\n")); -- argp_usage (state); -+ fprintf(stderr, "Installing GRUB2 to `%s'\n", DELL_TARGET); -+ /* -+ argp_usage (state); - exit (1); -+ */ - break; - - default: -@@ -1151,7 +1169,10 @@ - grub_mdraid1x_init (); - grub_lvm_init (); - -- dest_dev = get_device_name (arguments.device); -+ if (arguments.device) -+ dest_dev = get_device_name (arguments.device); -+ else -+ dest_dev = grub_util_get_grub_dev (DELL_TARGET); - if (! dest_dev) - { - /* Possibly, the user specified an OS device file. */ -@@ -1193,5 +1214,6 @@ - free (root_dev); - free (dest_dev); - -+ fprintf (stderr, "%s", _("Completed successfully.\n")); - return 0; - } diff -Nru dell-recovery-1.30.1/grub/patches/quantal/mingw_compilation.patch dell-recovery-1.31/grub/patches/quantal/mingw_compilation.patch --- dell-recovery-1.30.1/grub/patches/quantal/mingw_compilation.patch 2013-02-25 15:12:08.000000000 +0000 +++ dell-recovery-1.31/grub/patches/quantal/mingw_compilation.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -This is a collection of patches that make the GRUB2 build work on mingw32. -These were explicitly rejected upstream due to needing rework. - -=== modified file 'grub2/grub-core/lib/crypto.c' -Index: grub2-2.00/grub-core/lib/crypto.c -=================================================================== ---- grub2-2.00.orig/grub-core/lib/crypto.c 2012-02-08 06:57:20.000000000 -0600 -+++ grub2-2.00/grub-core/lib/crypto.c 2013-02-24 21:47:41.618896677 -0600 -@@ -24,6 +24,12 @@ - #include - #include - -+/* mingw32 does not support termios as required -+ by GRUB_UTIL throughout this file*/ -+#ifdef __MINGW32__ -+#undef GRUB_UTIL -+#endif -+ - #ifdef GRUB_UTIL - #include - #include -Index: grub2-2.00/grub-core/disk/geli.c -=================================================================== ---- grub2-2.00.orig/grub-core/disk/geli.c 2012-03-08 06:49:11.000000000 -0600 -+++ grub2-2.00/grub-core/disk/geli.c 2013-02-24 21:47:41.618896677 -0600 -@@ -221,9 +221,11 @@ - if (fd < 0) - return NULL; - -+#if !defined(__MINGW32__) - s = grub_util_get_fd_size (fd, dev, &log_secsize); - s >>= log_secsize; - grub_util_fd_seek (fd, dev, (s << log_secsize) - 512); -+#endif - - uuid = xmalloc (GRUB_MD_SHA256->mdlen * 2 + 1); - if (grub_util_fd_read (fd, (void *) &hdr, 512) < 0) -Index: grub2-2.00/grub-core/gnulib/argp-fmtstream.c -=================================================================== ---- grub2-2.00.orig/grub-core/gnulib/argp-fmtstream.c 2012-02-29 06:41:40.000000000 -0600 -+++ grub2-2.00/grub-core/gnulib/argp-fmtstream.c 2013-02-24 22:25:18.030915606 -0600 -@@ -135,7 +135,7 @@ - s = mbrtowc (&wc, ptr, end - ptr, &ps); - if (s == (size_t) -1) - break; -- r += wcwidth (wc); -+ //r += wcwidth (wc); - ptr += s; - } - return r; -@@ -156,7 +156,7 @@ - s = mbrtowc (&wc, ptr, end - ptr, &ps); - if (s == (size_t) -1) - break; -- k = wcwidth (wc); -+ //k = wcwidth (wc); - if (k >= l) - break; - l -= k; -Index: grub2/include/grub/types.h -=================================================================== ---- grub2.orig/include/grub/types.h 2013-01-22 11:01:33.145372651 -0600 -+++ grub2/include/grub/types.h 2013-01-22 11:02:12.165371202 -0600 -@@ -40,6 +40,8 @@ - # endif - #endif /* ! GRUB_UTIL */ - -+//Disable these errors specifically for mingw64 compilation -+/* - #if GRUB_CPU_SIZEOF_VOID_P != GRUB_CPU_SIZEOF_LONG - ## error "This architecture is not supported because sizeof(void *) != sizeof(long)" - #endif -@@ -47,6 +49,7 @@ - #if GRUB_CPU_SIZEOF_VOID_P != 4 && GRUB_CPU_SIZEOF_VOID_P != 8 - # error "This architecture is not supported because sizeof(void *) != 4 and sizeof(void *) != 8" - #endif -+*/ - - #ifndef GRUB_TARGET_WORDSIZE - # if GRUB_TARGET_SIZEOF_VOID_P == 4 - diff -Nru dell-recovery-1.30.1/grub/patches/raring/dell-support.patch dell-recovery-1.31/grub/patches/raring/dell-support.patch --- dell-recovery-1.30.1/grub/patches/raring/dell-support.patch 2013-02-25 19:11:48.000000000 +0000 +++ dell-recovery-1.31/grub/patches/raring/dell-support.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -This patch sets up the default directories to install to -the target the MBR of the first hard disk from C:\factory. - -It's analogous to calling grub-setup.exe like this: - -# grub-setup -d C:\factory -r "(//./PHYSICALDRIVE0/)" "//./PHYSICALDRIVE0/" - -After this patch, it's possible to just install like this: - -# grub-setup.exe - -Index: grub2-2.00/include/grub/emu/misc.h -=================================================================== ---- grub2-2.00.orig/include/grub/emu/misc.h 2012-02-09 17:22:27.000000000 -0600 -+++ grub2-2.00/include/grub/emu/misc.h 2013-02-25 12:08:02.553024206 -0600 -@@ -36,8 +36,12 @@ - /* NetBSD uses /boot for its boot block. */ - # define DEFAULT_DIRECTORY "/"GRUB_DIR_NAME - #else -+#ifdef __MINGW32__ -+# define DEFAULT_DIRECTORY "C:/factory" -+#else - # define DEFAULT_DIRECTORY "/"GRUB_BOOT_DIR_NAME"/"GRUB_DIR_NAME - #endif -+#endif - - #define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map" - -Index: grub2-2.00/util/grub-setup.c -=================================================================== ---- grub2-2.00.orig/util/grub-setup.c 2013-02-25 12:07:04.000000000 -0600 -+++ grub2-2.00/util/grub-setup.c 2013-02-25 12:56:56.933047545 -0600 -@@ -83,6 +83,8 @@ - * result. - */ - -+#define DELL_TARGET "//./PHYSICALDRIVE0/" -+ - #define DEFAULT_BOOT_FILE "boot.img" - #define DEFAULT_CORE_FILE "core.img" - #define CORE_IMG_IN_FS "setup_left_core_image_in_filesystem" -@@ -147,7 +149,7 @@ - { - char *boot_path, *core_path, *core_path_dev, *core_path_dev_full; - char *boot_img, *core_img; -- char *root = 0; -+ char *root = grub_util_get_grub_dev (DELL_TARGET); - size_t boot_size, core_size; - grub_uint16_t core_sectors; - grub_device_t root_dev = 0, dest_dev, core_dev; -@@ -247,13 +249,19 @@ - - sizeof (*block)); - grub_util_info ("root is `%s', dest is `%s'", root, dest); - -+ /* Open the root device and the destination device. */ -+ grub_util_info ("Opening root"); -+ root_dev = grub_device_open (root); -+ if (! root_dev) -+ grub_util_error ("%s", grub_errmsg); -+ - grub_util_info ("Opening dest"); - dest_dev = grub_device_open (dest); - if (! dest_dev) - grub_util_error ("%s", grub_errmsg); - - core_dev = dest_dev; -- -+/* - { - char **root_devices = grub_guess_root_devices (dir); - char **cur; -@@ -298,6 +306,7 @@ - grub_util_info ("guessed root_dev `%s' from " - "dir `%s'", root_dev->disk->name, dir); - } -+*/ - - grub_util_info ("setting the root device to `%s'", root); - if (grub_env_set ("root", root) != GRUB_ERR_NONE) -@@ -494,6 +503,13 @@ - - assert (nsec <= maxsec); - -+ /* Ignore failures in the embedding test */ -+ if (grub_errno != GRUB_ERR_NONE) -+ { -+ grub_errno = GRUB_ERR_NONE; -+ grub_util_warn("The embedding test declared a failure. This is normally non-fatal during WinPE, so it will be ignored."); -+ } -+ - /* Clean out the blocklists. */ - block = first_block; - while (block->len) -@@ -1071,9 +1087,11 @@ - break; - - case ARGP_KEY_NO_ARGS: -- fprintf (stderr, "%s", _("No device is specified.\n")); -- argp_usage (state); -+ fprintf(stderr, "Installing GRUB2 to `%s'\n", DELL_TARGET); -+ /* -+ argp_usage (state); - exit (1); -+ */ - break; - - default: -@@ -1151,7 +1169,10 @@ - grub_mdraid1x_init (); - grub_lvm_init (); - -- dest_dev = get_device_name (arguments.device); -+ if (arguments.device) -+ dest_dev = get_device_name (arguments.device); -+ else -+ dest_dev = grub_util_get_grub_dev (DELL_TARGET); - if (! dest_dev) - { - /* Possibly, the user specified an OS device file. */ -@@ -1193,5 +1214,6 @@ - free (root_dev); - free (dest_dev); - -+ fprintf (stderr, "%s", _("Completed successfully.\n")); - return 0; - } diff -Nru dell-recovery-1.30.1/grub/patches/raring/mingw_compilation.patch dell-recovery-1.31/grub/patches/raring/mingw_compilation.patch --- dell-recovery-1.30.1/grub/patches/raring/mingw_compilation.patch 2013-02-25 15:12:08.000000000 +0000 +++ dell-recovery-1.31/grub/patches/raring/mingw_compilation.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -This is a collection of patches that make the GRUB2 build work on mingw32. -These were explicitly rejected upstream due to needing rework. - -=== modified file 'grub2/grub-core/lib/crypto.c' -Index: grub2-2.00/grub-core/lib/crypto.c -=================================================================== ---- grub2-2.00.orig/grub-core/lib/crypto.c 2012-02-08 06:57:20.000000000 -0600 -+++ grub2-2.00/grub-core/lib/crypto.c 2013-02-24 21:47:41.618896677 -0600 -@@ -24,6 +24,12 @@ - #include - #include - -+/* mingw32 does not support termios as required -+ by GRUB_UTIL throughout this file*/ -+#ifdef __MINGW32__ -+#undef GRUB_UTIL -+#endif -+ - #ifdef GRUB_UTIL - #include - #include -Index: grub2-2.00/grub-core/disk/geli.c -=================================================================== ---- grub2-2.00.orig/grub-core/disk/geli.c 2012-03-08 06:49:11.000000000 -0600 -+++ grub2-2.00/grub-core/disk/geli.c 2013-02-24 21:47:41.618896677 -0600 -@@ -221,9 +221,11 @@ - if (fd < 0) - return NULL; - -+#if !defined(__MINGW32__) - s = grub_util_get_fd_size (fd, dev, &log_secsize); - s >>= log_secsize; - grub_util_fd_seek (fd, dev, (s << log_secsize) - 512); -+#endif - - uuid = xmalloc (GRUB_MD_SHA256->mdlen * 2 + 1); - if (grub_util_fd_read (fd, (void *) &hdr, 512) < 0) -Index: grub2-2.00/grub-core/gnulib/argp-fmtstream.c -=================================================================== ---- grub2-2.00.orig/grub-core/gnulib/argp-fmtstream.c 2012-02-29 06:41:40.000000000 -0600 -+++ grub2-2.00/grub-core/gnulib/argp-fmtstream.c 2013-02-24 22:25:18.030915606 -0600 -@@ -135,7 +135,7 @@ - s = mbrtowc (&wc, ptr, end - ptr, &ps); - if (s == (size_t) -1) - break; -- r += wcwidth (wc); -+ //r += wcwidth (wc); - ptr += s; - } - return r; -@@ -156,7 +156,7 @@ - s = mbrtowc (&wc, ptr, end - ptr, &ps); - if (s == (size_t) -1) - break; -- k = wcwidth (wc); -+ //k = wcwidth (wc); - if (k >= l) - break; - l -= k; -Index: grub2/include/grub/types.h -=================================================================== ---- grub2.orig/include/grub/types.h 2013-01-22 11:01:33.145372651 -0600 -+++ grub2/include/grub/types.h 2013-01-22 11:02:12.165371202 -0600 -@@ -40,6 +40,8 @@ - # endif - #endif /* ! GRUB_UTIL */ - -+//Disable these errors specifically for mingw64 compilation -+/* - #if GRUB_CPU_SIZEOF_VOID_P != GRUB_CPU_SIZEOF_LONG - ## error "This architecture is not supported because sizeof(void *) != sizeof(long)" - #endif -@@ -47,6 +49,7 @@ - #if GRUB_CPU_SIZEOF_VOID_P != 4 && GRUB_CPU_SIZEOF_VOID_P != 8 - # error "This architecture is not supported because sizeof(void *) != 4 and sizeof(void *) != 8" - #endif -+*/ - - #ifndef GRUB_TARGET_WORDSIZE - # if GRUB_TARGET_SIZEOF_VOID_P == 4 - diff -Nru dell-recovery-1.30.1/grub/patches/trunk/dell-support.patch dell-recovery-1.31/grub/patches/trunk/dell-support.patch --- dell-recovery-1.30.1/grub/patches/trunk/dell-support.patch 2013-02-25 19:11:46.000000000 +0000 +++ dell-recovery-1.31/grub/patches/trunk/dell-support.patch 2014-03-18 01:22:46.000000000 +0000 @@ -9,47 +9,72 @@ # grub-setup.exe -Index: grub2-2.00/include/grub/emu/misc.h +Index: grub2-2.02~beta2/util/grub-setup.c =================================================================== ---- grub2-2.00.orig/include/grub/emu/misc.h 2012-02-09 17:22:27.000000000 -0600 -+++ grub2-2.00/include/grub/emu/misc.h 2013-02-25 12:08:02.553024206 -0600 -@@ -36,8 +36,12 @@ - /* NetBSD uses /boot for its boot block. */ - # define DEFAULT_DIRECTORY "/"GRUB_DIR_NAME - #else -+#ifdef __MINGW32__ -+# define DEFAULT_DIRECTORY "C:/factory" -+#else - # define DEFAULT_DIRECTORY "/"GRUB_BOOT_DIR_NAME"/"GRUB_DIR_NAME - #endif -+#endif +--- grub2-2.02~beta2.orig/util/grub-setup.c 2014-03-11 19:24:15.892737227 +0000 ++++ grub2-2.02~beta2/util/grub-setup.c 2014-03-11 19:24:15.884737226 +0000 +@@ -207,9 +207,11 @@ + break; - #define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map" + case ARGP_KEY_NO_ARGS: +- fprintf (stderr, "%s", _("No device is specified.\n")); +- argp_usage (state); ++ fprintf(stderr, "Installing GRUB2 to `%s'\n", DELL_TARGET); ++ /* ++ argp_usage (state); + exit (1); ++ */ + break; + + default: +@@ -286,7 +288,10 @@ + grub_mdraid1x_init (); + grub_lvm_init (); -Index: grub2-2.00/util/grub-setup.c +- dest_dev = get_device_name (arguments.device); ++ if (arguments.device) ++ dest_dev = get_device_name (arguments.device); ++ else ++ dest_dev = grub_util_get_grub_dev (DELL_TARGET); + if (! dest_dev) + { + /* Possibly, the user specified an OS device file. */ +@@ -329,5 +334,6 @@ + free (root_dev); + free (dest_dev); + ++ fprintf (stderr, "%s", _("Completed successfully.\n")); + return 0; + } +Index: grub2-2.02~beta2/include/grub/osdep/hostfile_windows.h =================================================================== ---- grub2-2.00.orig/util/grub-setup.c 2013-02-25 12:07:04.000000000 -0600 -+++ grub2-2.00/util/grub-setup.c 2013-02-25 12:56:56.933047545 -0600 -@@ -83,6 +83,8 @@ - * result. - */ +--- grub2-2.02~beta2.orig/include/grub/osdep/hostfile_windows.h 2014-03-11 19:24:15.892737227 +0000 ++++ grub2-2.02~beta2/include/grub/osdep/hostfile_windows.h 2014-03-11 19:29:25.852735843 +0000 +@@ -28,7 +28,8 @@ + #define GRUB_UTIL_FD_IS_VALID(x) ((x) != GRUB_UTIL_FD_INVALID) + #define GRUB_UTIL_FD_STAT_IS_FUNCTIONAL 0 +-#define DEFAULT_DIRECTORY "C:\\"GRUB_BOOT_DIR_NAME"\\"GRUB_DIR_NAME +#define DELL_TARGET "//./PHYSICALDRIVE0/" -+ - #define DEFAULT_BOOT_FILE "boot.img" - #define DEFAULT_CORE_FILE "core.img" - #define CORE_IMG_IN_FS "setup_left_core_image_in_filesystem" -@@ -147,7 +149,7 @@ ++#define DEFAULT_DIRECTORY "C:/factory" + #define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map" + + struct grub_util_fd_dirent +Index: grub2-2.02~beta2/util/setup.c +=================================================================== +--- grub2-2.02~beta2.orig/util/setup.c 2014-03-11 19:24:15.892737227 +0000 ++++ grub2-2.02~beta2/util/setup.c 2014-03-11 19:29:19.696736115 +0000 +@@ -255,7 +255,7 @@ { - char *boot_path, *core_path, *core_path_dev, *core_path_dev_full; - char *boot_img, *core_img; + char *core_path; + char *boot_img, *core_img, *boot_path; - char *root = 0; + char *root = grub_util_get_grub_dev (DELL_TARGET); size_t boot_size, core_size; + #ifdef GRUB_SETUP_BIOS grub_uint16_t core_sectors; - grub_device_t root_dev = 0, dest_dev, core_dev; -@@ -247,13 +249,19 @@ - - sizeof (*block)); +@@ -302,13 +302,19 @@ + - sizeof (*bl.block)); grub_util_info ("root is `%s', dest is `%s'", root, dest); + /* Open the root device and the destination device. */ @@ -69,15 +94,16 @@ { char **root_devices = grub_guess_root_devices (dir); char **cur; -@@ -298,6 +306,7 @@ +@@ -353,7 +359,7 @@ grub_util_info ("guessed root_dev `%s' from " "dir `%s'", root_dev->disk->name, dir); } +- +*/ - grub_util_info ("setting the root device to `%s'", root); if (grub_env_set ("root", root) != GRUB_ERR_NONE) -@@ -494,6 +503,13 @@ + grub_util_error ("%s", grub_errmsg); +@@ -524,6 +530,13 @@ assert (nsec <= maxsec); @@ -89,38 +115,5 @@ + } + /* Clean out the blocklists. */ - block = first_block; - while (block->len) -@@ -1071,9 +1087,11 @@ - break; - - case ARGP_KEY_NO_ARGS: -- fprintf (stderr, "%s", _("No device is specified.\n")); -- argp_usage (state); -+ fprintf(stderr, "Installing GRUB2 to `%s'\n", DELL_TARGET); -+ /* -+ argp_usage (state); - exit (1); -+ */ - break; - - default: -@@ -1151,7 +1169,10 @@ - grub_mdraid1x_init (); - grub_lvm_init (); - -- dest_dev = get_device_name (arguments.device); -+ if (arguments.device) -+ dest_dev = get_device_name (arguments.device); -+ else -+ dest_dev = grub_util_get_grub_dev (DELL_TARGET); - if (! dest_dev) - { - /* Possibly, the user specified an OS device file. */ -@@ -1193,5 +1214,6 @@ - free (root_dev); - free (dest_dev); - -+ fprintf (stderr, "%s", _("Completed successfully.\n")); - return 0; - } + bl.block = bl.first_block; + while (bl.block->len) diff -Nru dell-recovery-1.30.1/grub/patches/trunk/mingw_compilation.path dell-recovery-1.31/grub/patches/trunk/mingw_compilation.path --- dell-recovery-1.30.1/grub/patches/trunk/mingw_compilation.path 2013-02-25 15:12:08.000000000 +0000 +++ dell-recovery-1.31/grub/patches/trunk/mingw_compilation.path 2014-03-18 01:22:46.000000000 +0000 @@ -1,81 +1,20 @@ -This is a collection of patches that make the GRUB2 build work on mingw32. -These were explicitly rejected upstream due to needing rework. +Includes both patches from upstream to fix mingw complilation: +94cee4a4c201bb506377b2c26e072eee8cb19d6f +5ef569df5b359048ee55c5000e2679855cb87e06 -=== modified file 'grub2/grub-core/lib/crypto.c' -Index: grub2-2.00/grub-core/lib/crypto.c +Index: grub2-2.02~beta2/include/grub/osdep/hostfile_windows.h =================================================================== ---- grub2-2.00.orig/grub-core/lib/crypto.c 2012-02-08 06:57:20.000000000 -0600 -+++ grub2-2.00/grub-core/lib/crypto.c 2013-02-24 21:47:41.618896677 -0600 -@@ -24,6 +24,12 @@ - #include - #include +--- grub2-2.02~beta2.orig/include/grub/osdep/hostfile_windows.h 2014-03-11 19:42:08.840731935 +0000 ++++ grub2-2.02~beta2/include/grub/osdep/hostfile_windows.h 2014-03-11 19:43:12.360731732 +0000 +@@ -70,8 +70,11 @@ -+/* mingw32 does not support termios as required -+ by GRUB_UTIL throughout this file*/ -+#ifdef __MINGW32__ -+#undef GRUB_UTIL -+#endif -+ - #ifdef GRUB_UTIL - #include - #include -Index: grub2-2.00/grub-core/disk/geli.c -=================================================================== ---- grub2-2.00.orig/grub-core/disk/geli.c 2012-03-08 06:49:11.000000000 -0600 -+++ grub2-2.00/grub-core/disk/geli.c 2013-02-24 21:47:41.618896677 -0600 -@@ -221,9 +221,11 @@ - if (fd < 0) - return NULL; + #if defined (__MINGW32__) && !defined (__MINGW64__) -+#if !defined(__MINGW32__) - s = grub_util_get_fd_size (fd, dev, &log_secsize); - s >>= log_secsize; - grub_util_fd_seek (fd, dev, (s << log_secsize) - 512); ++/* 32 bit on Mingw-w64 already redefines them if _FILE_OFFSET_BITS=64 */ ++#ifndef _W64 + #define fseeko fseeko64 + #define ftello ftello64 +#endif - uuid = xmalloc (GRUB_MD_SHA256->mdlen * 2 + 1); - if (grub_util_fd_read (fd, (void *) &hdr, 512) < 0) -Index: grub2-2.00/grub-core/gnulib/argp-fmtstream.c -=================================================================== ---- grub2-2.00.orig/grub-core/gnulib/argp-fmtstream.c 2012-02-29 06:41:40.000000000 -0600 -+++ grub2-2.00/grub-core/gnulib/argp-fmtstream.c 2013-02-24 22:25:18.030915606 -0600 -@@ -135,7 +135,7 @@ - s = mbrtowc (&wc, ptr, end - ptr, &ps); - if (s == (size_t) -1) - break; -- r += wcwidth (wc); -+ //r += wcwidth (wc); - ptr += s; - } - return r; -@@ -156,7 +156,7 @@ - s = mbrtowc (&wc, ptr, end - ptr, &ps); - if (s == (size_t) -1) - break; -- k = wcwidth (wc); -+ //k = wcwidth (wc); - if (k >= l) - break; - l -= k; -Index: grub2/include/grub/types.h -=================================================================== ---- grub2.orig/include/grub/types.h 2013-01-22 11:01:33.145372651 -0600 -+++ grub2/include/grub/types.h 2013-01-22 11:02:12.165371202 -0600 -@@ -40,6 +40,8 @@ - # endif - #endif /* ! GRUB_UTIL */ - -+//Disable these errors specifically for mingw64 compilation -+/* - #if GRUB_CPU_SIZEOF_VOID_P != GRUB_CPU_SIZEOF_LONG - ## error "This architecture is not supported because sizeof(void *) != sizeof(long)" - #endif -@@ -47,6 +49,7 @@ - #if GRUB_CPU_SIZEOF_VOID_P != 4 && GRUB_CPU_SIZEOF_VOID_P != 8 - # error "This architecture is not supported because sizeof(void *) != 4 and sizeof(void *) != 8" #endif -+*/ - #ifndef GRUB_TARGET_WORDSIZE - # if GRUB_TARGET_SIZEOF_VOID_P == 4 - diff -Nru dell-recovery-1.30.1/grub/patches/trusty/dell-support.patch dell-recovery-1.31/grub/patches/trusty/dell-support.patch --- dell-recovery-1.30.1/grub/patches/trusty/dell-support.patch 1970-01-01 00:00:00.000000000 +0000 +++ dell-recovery-1.31/grub/patches/trusty/dell-support.patch 2014-03-18 01:22:46.000000000 +0000 @@ -0,0 +1,119 @@ +This patch sets up the default directories to install to +the target the MBR of the first hard disk from C:\factory. + +It's analogous to calling grub-setup.exe like this: + +# grub-setup -d C:\factory -r "(//./PHYSICALDRIVE0/)" "//./PHYSICALDRIVE0/" + +After this patch, it's possible to just install like this: + +# grub-setup.exe + +Index: grub2-2.02~beta2/util/grub-setup.c +=================================================================== +--- grub2-2.02~beta2.orig/util/grub-setup.c 2014-03-11 19:24:15.892737227 +0000 ++++ grub2-2.02~beta2/util/grub-setup.c 2014-03-11 19:24:15.884737226 +0000 +@@ -207,9 +207,11 @@ + break; + + case ARGP_KEY_NO_ARGS: +- fprintf (stderr, "%s", _("No device is specified.\n")); +- argp_usage (state); ++ fprintf(stderr, "Installing GRUB2 to `%s'\n", DELL_TARGET); ++ /* ++ argp_usage (state); + exit (1); ++ */ + break; + + default: +@@ -286,7 +288,10 @@ + grub_mdraid1x_init (); + grub_lvm_init (); + +- dest_dev = get_device_name (arguments.device); ++ if (arguments.device) ++ dest_dev = get_device_name (arguments.device); ++ else ++ dest_dev = grub_util_get_grub_dev (DELL_TARGET); + if (! dest_dev) + { + /* Possibly, the user specified an OS device file. */ +@@ -329,5 +334,6 @@ + free (root_dev); + free (dest_dev); + ++ fprintf (stderr, "%s", _("Completed successfully.\n")); + return 0; + } +Index: grub2-2.02~beta2/include/grub/osdep/hostfile_windows.h +=================================================================== +--- grub2-2.02~beta2.orig/include/grub/osdep/hostfile_windows.h 2014-03-11 19:24:15.892737227 +0000 ++++ grub2-2.02~beta2/include/grub/osdep/hostfile_windows.h 2014-03-11 19:29:25.852735843 +0000 +@@ -28,7 +28,8 @@ + #define GRUB_UTIL_FD_IS_VALID(x) ((x) != GRUB_UTIL_FD_INVALID) + #define GRUB_UTIL_FD_STAT_IS_FUNCTIONAL 0 + +-#define DEFAULT_DIRECTORY "C:\\"GRUB_BOOT_DIR_NAME"\\"GRUB_DIR_NAME ++#define DELL_TARGET "//./PHYSICALDRIVE0/" ++#define DEFAULT_DIRECTORY "C:/factory" + #define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map" + + struct grub_util_fd_dirent +Index: grub2-2.02~beta2/util/setup.c +=================================================================== +--- grub2-2.02~beta2.orig/util/setup.c 2014-03-11 19:24:15.892737227 +0000 ++++ grub2-2.02~beta2/util/setup.c 2014-03-11 19:29:19.696736115 +0000 +@@ -255,7 +255,7 @@ + { + char *core_path; + char *boot_img, *core_img, *boot_path; +- char *root = 0; ++ char *root = grub_util_get_grub_dev (DELL_TARGET); + size_t boot_size, core_size; + #ifdef GRUB_SETUP_BIOS + grub_uint16_t core_sectors; +@@ -302,13 +302,19 @@ + - sizeof (*bl.block)); + grub_util_info ("root is `%s', dest is `%s'", root, dest); + ++ /* Open the root device and the destination device. */ ++ grub_util_info ("Opening root"); ++ root_dev = grub_device_open (root); ++ if (! root_dev) ++ grub_util_error ("%s", grub_errmsg); ++ + grub_util_info ("Opening dest"); + dest_dev = grub_device_open (dest); + if (! dest_dev) + grub_util_error ("%s", grub_errmsg); + + core_dev = dest_dev; +- ++/* + { + char **root_devices = grub_guess_root_devices (dir); + char **cur; +@@ -353,7 +359,7 @@ + grub_util_info ("guessed root_dev `%s' from " + "dir `%s'", root_dev->disk->name, dir); + } +- ++*/ + grub_util_info ("setting the root device to `%s'", root); + if (grub_env_set ("root", root) != GRUB_ERR_NONE) + grub_util_error ("%s", grub_errmsg); +@@ -524,6 +530,13 @@ + + assert (nsec <= maxsec); + ++ /* Ignore failures in the embedding test */ ++ if (grub_errno != GRUB_ERR_NONE) ++ { ++ grub_errno = GRUB_ERR_NONE; ++ grub_util_warn("The embedding test declared a failure. This is normally non-fatal during WinPE, so it will be ignored."); ++ } ++ + /* Clean out the blocklists. */ + bl.block = bl.first_block; + while (bl.block->len) diff -Nru dell-recovery-1.30.1/grub/patches/trusty/mingw_compilation.path dell-recovery-1.31/grub/patches/trusty/mingw_compilation.path --- dell-recovery-1.30.1/grub/patches/trusty/mingw_compilation.path 1970-01-01 00:00:00.000000000 +0000 +++ dell-recovery-1.31/grub/patches/trusty/mingw_compilation.path 2014-03-18 01:22:46.000000000 +0000 @@ -0,0 +1,20 @@ +Includes both patches from upstream to fix mingw complilation: +94cee4a4c201bb506377b2c26e072eee8cb19d6f +5ef569df5b359048ee55c5000e2679855cb87e06 + +Index: grub2-2.02~beta2/include/grub/osdep/hostfile_windows.h +=================================================================== +--- grub2-2.02~beta2.orig/include/grub/osdep/hostfile_windows.h 2014-03-11 19:42:08.840731935 +0000 ++++ grub2-2.02~beta2/include/grub/osdep/hostfile_windows.h 2014-03-11 19:43:12.360731732 +0000 +@@ -70,8 +70,11 @@ + + #if defined (__MINGW32__) && !defined (__MINGW64__) + ++/* 32 bit on Mingw-w64 already redefines them if _FILE_OFFSET_BITS=64 */ ++#ifndef _W64 + #define fseeko fseeko64 + #define ftello ftello64 ++#endif + + #endif + diff -Nru dell-recovery-1.30.1/grub/recovery_partition.cfg dell-recovery-1.31/grub/recovery_partition.cfg --- dell-recovery-1.30.1/grub/recovery_partition.cfg 2012-06-18 20:49:50.000000000 +0000 +++ dell-recovery-1.31/grub/recovery_partition.cfg 2014-03-18 01:22:46.000000000 +0000 @@ -115,7 +115,7 @@ } menuentry "Single User Mode" { - linux /casper/vmlinuz boot=casper noprompt single $uuid_options $loop_options -- + linux /casper/vmlinuz.efi boot=casper noprompt single $uuid_options $loop_options -- initrd /casper/initrd.lz } @@ -125,7 +125,7 @@ menuentry "Automated Installation of #OS# (Default)" { set recordfail=1 if [ -n "${have_grubenv}" ]; then save_env -f /factory/grubenv recordfail; fi - linux /casper/vmlinuz $uuid_options $options $loop_options + linux /casper/vmlinuz.efi $uuid_options $options $loop_options initrd /casper/initrd.lz } diff -Nru dell-recovery-1.30.1/late/scripts/oem_config.sh dell-recovery-1.31/late/scripts/oem_config.sh --- dell-recovery-1.30.1/late/scripts/oem_config.sh 2012-05-22 18:13:29.000000000 +0000 +++ dell-recovery-1.31/late/scripts/oem_config.sh 2014-03-18 01:22:46.000000000 +0000 @@ -32,7 +32,7 @@ if [ "$1" = "early" ]; then DEVICE=$(python3 << EOF from Dell.recovery_common import find_partitions -print(find_partitions('','')[1]) +print(find_partitions()[1]) EOF ) mkdir -p $2 diff -Nru dell-recovery-1.30.1/po/dell-recovery.pot dell-recovery-1.31/po/dell-recovery.pot --- dell-recovery-1.30.1/po/dell-recovery.pot 2014-02-20 15:07:36.000000000 +0000 +++ dell-recovery-1.31/po/dell-recovery.pot 2014-03-19 05:31:13.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-02-20 15:07+0000\n" +"POT-Creation-Date: 2014-03-19 00:31-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -183,23 +183,23 @@ msgid "Adding in base image" msgstr "" -#: ../Dell/recovery_backend.py:1050 +#: ../Dell/recovery_backend.py:1047 msgid "Preparing nested image" msgstr "" -#: ../Dell/recovery_backend.py:1069 +#: ../Dell/recovery_backend.py:1066 msgid "Building Dell Utility Partition" msgstr "" -#: ../Dell/recovery_backend.py:1131 +#: ../Dell/recovery_backend.py:1128 msgid "Regenerating UUID / Rebuilding initramfs" msgstr "" -#: ../Dell/recovery_backend.py:1160 +#: ../Dell/recovery_backend.py:1157 msgid "Building GRUB core image" msgstr "" -#: ../Dell/recovery_backend.py:1285 +#: ../Dell/recovery_backend.py:1282 msgid "Building ISO" msgstr "" diff -Nru dell-recovery-1.30.1/ubiquity/dell-bootstrap.py dell-recovery-1.31/ubiquity/dell-bootstrap.py --- dell-recovery-1.30.1/ubiquity/dell-bootstrap.py 2013-03-05 21:06:36.000000000 +0000 +++ dell-recovery-1.31/ubiquity/dell-bootstrap.py 2014-03-18 01:22:46.000000000 +0000 @@ -3,7 +3,7 @@ # # «dell-bootstrap» - Ubiquity plugin for Dell Factory Process # -# Copyright (C) 2010-2011, Dell Inc. +# Copyright (C) 2010-2014, Dell Inc. # # Author: # - Mario Limonciello @@ -44,6 +44,7 @@ import tarfile import hashlib from apt.cache import Cache +from gi.repository import GLib, UDisks NAME = 'dell-bootstrap' BEFORE = 'language' @@ -80,6 +81,8 @@ RP_FILESYSTEM_QUESTION = 'dell-recovery/recovery_partition_filesystem' DRIVER_INSTALL_QUESTION = 'dell-recovery/disable-driver-install' +no_options = GLib.Variant('a{sv}', {}) + ####################### # Noninteractive Page # ####################### @@ -429,22 +432,13 @@ def disable_swap(self): """Disables any swap partitions in use""" - bus = dbus.SystemBus() - - udisk_obj = bus.get_object('org.freedesktop.UDisks', '/org/freedesktop/UDisks') - udisk_int = dbus.Interface(udisk_obj, 'org.freedesktop.UDisks') - devices = udisk_int.EnumerateDevices() - for device in devices: - dev_obj = bus.get_object('org.freedesktop.UDisks', device) - dev = dbus.Interface(dev_obj, 'org.freedesktop.DBus.Properties') - - #Find mounted swap - if dev.Get('org.freedesktop.UDisks.Device', 'IdType') == 'swap': - device = dev.Get('org.freedesktop.Udisks.Device', 'DeviceFile') - misc.execute_root('swapoff', device) - if misc is False: - raise RuntimeError("Error removing swap for device %s" % - device) + udisks = UDisks.Client.new_sync(None) + manager = udisks.get_object_manager() + for item in manager.get_objects(): + swap = item.get_swapspace() + if not swap: + continue + swap.call_stop_sync(no_options) def sleep_network(self): """Requests the network be disabled for the duration of install to @@ -682,31 +676,36 @@ def fixup_recovery_devices(self): """Discovers the first hard disk to install to""" - bus = dbus.SystemBus() disks = [] - - udisk_obj = bus.get_object('org.freedesktop.UDisks', '/org/freedesktop/UDisks') - udi = dbus.Interface(udisk_obj, 'org.freedesktop.UDisks') - devices = udi.EnumerateDevices() - for device in devices: - dev_obj = bus.get_object('org.freedesktop.UDisks', device) - dev = dbus.Interface(dev_obj, 'org.freedesktop.DBus.Properties') - - #Skip USB, Removable Disks, Partitions, External, Loopback, Readonly - if dev.Get('org.freedesktop.UDisks.Device', 'DriveConnectionInterface') == 'usb' or \ - dev.Get('org.freedesktop.UDisks.Device', 'DeviceIsRemovable') == 1 or \ - dev.Get('org.freedesktop.UDisks.Device', 'DeviceIsPartition') == 1 or \ - dev.Get('org.freedesktop.UDisks.Device', 'DeviceIsSystemInternal') == 0 or \ - dev.Get('org.freedesktop.UDisks.Device', 'DeviceIsLinuxLoop') == 1 or \ - dev.Get('org.freedesktop.UDisks.Device', 'DeviceIsReadOnly') == 1 : + udisks = UDisks.Client.new_sync(None) + manager = udisks.get_object_manager() + drive = None + for item in manager.get_objects(): + loop = item.get_loop() + block = item.get_block() + partition = item.get_partition() + if loop or \ + partition or \ + not block or \ + not block.get_cached_property("HintPartitionable").get_boolean(): continue - - #if we made it this far, add it - devicefile = dev.Get('org.freedesktop.Udisks.Device', 'DeviceFile') - devicemodel = dev.Get('org.freedesktop.Udisks.Device', 'DriveModel') - devicevendor = dev.Get('org.freedesktop.Udisks.Device', 'DriveVendor') - devicesize = dev.Get('org.freedesktop.Udisks.Device', 'DeviceSize') + + drive_obj = block.get_cached_property("Drive").get_string() + if drive_obj == '/': + continue + + drive = udisks.get_object(drive_obj).get_drive() + if not drive or \ + drive.get_cached_property("ConnectionBus").get_string() is 'usb' or \ + drive.get_cached_property("Removable").get_boolean() is True: + continue + + devicefile = block.get_cached_property("Device").get_bytestring().decode('utf-8') + devicemodel = drive.get_cached_property("Model").get_string() + devicevendor = drive.get_cached_property("Vendor").get_string() + devicesize = drive.get_cached_property("Size").unpack() devicesize_gb = "%i" % (devicesize / 1000000000) + disks.append([devicefile, devicesize, "%s GB %s %s (%s)" % (devicesize_gb, devicevendor, devicemodel, devicefile)]) #If multiple candidates were found, record in the logs @@ -1693,7 +1692,7 @@ self.target = target self.progress = progress - utility_part, rec_part = magic.find_partitions('', '') + utility_part, rec_part = magic.find_partitions() from ubiquity import install_misc to_install = [] diff -Nru dell-recovery-1.30.1/ubiquity/dell-recovery.py dell-recovery-1.31/ubiquity/dell-recovery.py --- dell-recovery-1.30.1/ubiquity/dell-recovery.py 2013-03-05 21:10:02.000000000 +0000 +++ dell-recovery-1.31/ubiquity/dell-recovery.py 2014-03-18 01:22:46.000000000 +0000 @@ -3,7 +3,7 @@ # # «dell-recovery» - OEM Config plugin for Dell-Recovery Media # -# Copyright (C) 2010, Dell Inc. +# Copyright (C) 2010-2014, Dell Inc. # # Author: # - Mario Limonciello @@ -45,7 +45,7 @@ def __init__(self, controller, *args, **kwargs): self.controller = controller - upart, rpart = magic.find_partitions('','') + upart, rpart = magic.find_partitions() dvd, usb = magic.find_burners() oem = 'UBIQUITY_OEM_USER_CONFIG' in os.environ self.genuine = magic.check_vendor() @@ -190,7 +190,7 @@ rec_type = progress.get('dell-recovery/destination') if rec_type != "none": dvd, usb = magic.find_burners() - upart, rpart = magic.find_partitions('', '') + upart, rpart = magic.find_partitions() self.index = 0 #build all the user's home directories a little earlier than normal