Skip to content

Instantly share code, notes, and snippets.

@chihchun
Created April 22, 2020 04:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chihchun/6dd74af2e9b61b51223627312a06cc6b to your computer and use it in GitHub Desktop.
Save chihchun/6dd74af2e9b61b51223627312a06cc6b to your computer and use it in GitHub Desktop.
diff --git a/Dell/recovery_backend.py b/Dell/recovery_backend.py
index bd5161d..f32abad 100644
--- a/Dell/recovery_backend.py
+++ b/Dell/recovery_backend.py
@@ -43,7 +43,7 @@ from Dell.recovery_common import (DOMAIN, LOCALEDIR,
walk_cleanup, create_new_uuid, white_tree,
black_tree, fetch_output, check_version,
DBUS_BUS_NAME, DBUS_INTERFACE_NAME,
- RestoreFailed, CreateFailed, find_partition,
+ RestoreFailed, CreateFailed,
regenerate_md5sum, PermissionDeniedByPolicy)
from Dell.recovery_threading import ProgressByPulse, ProgressBySize
from Dell.recovery_xml import BTOxml
@@ -776,21 +776,6 @@ arch %s, distributor_str %s, bto_platform %s" % (bto_version, distributor, relea
logging.debug("Validation complete: valid %s" % valid)
self.report_package_info(valid, description, error_warning)
- #The funcution is used to recovery Dell Hybrid Client
- @dbus.service.method(DBUS_INTERFACE_NAME,
- in_signature = 'b', out_signature = '', sender_keyword = 'sender',
- connection_keyword = 'conn')
- def enable_boot_to_restore_dhc(self, reboot, sender=None, conn=None):
- """Enables the default one-time boot option to be recovery"""
- self._reset_timeout()
- recovery=find_partition().decode('utf-8')
- mntdir=self.request_mount(recovery, 'rw', sender,conn)
- f=os.path.join(mntdir,'.dhc_flag')
- with open(f,'w'):
- pass
- logging.debug("enable_boot_to_restore_dhc:reboot=%s" % reboot)
- self._prepare_reboot("99_dell_recovery", reboot)
-
@dbus.service.method(DBUS_INTERFACE_NAME,
in_signature = 'b', out_signature = '', sender_keyword = 'sender',
connection_keyword = 'conn')
diff --git a/Dell/recovery_common.py b/Dell/recovery_common.py
index b0f798b..33f294e 100644
--- a/Dell/recovery_common.py
+++ b/Dell/recovery_common.py
@@ -151,64 +151,6 @@ def check_family(test):
return True
return False
-def check_install_dhc_id():
- """The function is used to detect machine's ID for install DHC flow"""
- path = '/sys/class/dmi/id/modalias'
- if not os.path.exists(path):
- return False
- with open(path, 'rb') as rfd:
- value = rfd.read().strip()
- if not value:
- return False
- for top in [ISO_MOUNT, CDROM_MOUNT]:
- if os.path.isdir(top):
- plat_conf=os.path.join(top, "dhc", "platform_list", "install-id.conf")
- if not os.path.exists(plat_conf):
- continue
- lines=[line.rstrip('\n') for line in open(plat_conf)]
- for i in range(len(lines)):
- if lines[i] in str(value):
- return True
- return False
-
-def check_recovery_dhc_id():
- """The function is used to detect machine's ID for recovery DHC flow,"""
- path = '/sys/class/dmi/id/modalias'
- if not os.path.exists(path):
- return False
- with open(path, 'rb') as rfd:
- value = rfd.read().strip()
- if not value:
- return False
- top="/var/lib/dhc"
- plat_conf=os.path.join(top, "recovery-id.conf")
- if not os.path.exists(plat_conf):
- return False
- lines=[line.rstrip('\n') for line in open(plat_conf)]
- for i in range(len(lines)):
- if lines[i] in str(value):
- return True
- return False
-
-def check_for_restore_command():
- """The function is used to detect ID for using recovery Dell Hybrid Client command flow,"""
- path = '/sys/class/dmi/id/modalias'
- if not os.path.exists(path):
- return False
- with open(path, 'rb') as rfd:
- value = rfd.read().strip()
- if not value:
- return False
- tops=[ '/var/lib/dhc/install-id.conf', '/var/lib/dhc/recovery-id.conf' ]
- for top in tops:
- if not os.path.exists(top):
- continue
- lines=[line.rstrip('\n') for line in open(top)]
- for i in range(len(lines)):
- if lines[i] in str(value):
- return True
- return False
-
def check_vendor():
"""Checks to make sure that the app is running on Dell HW"""
path = '/sys/class/dmi/id/'
@@ -588,7 +530,10 @@ def create_new_uuid(old_initrd_directory, old_casper_directory,
#Detect compression
lines = ''
- root = os.path.join(tmpdir, 'main', 'conf', 'initramfs.conf')
+ if os.path.isdir(os.path.join(tmpdir, 'main')):
+ root = os.path.join(tmpdir, 'main', 'conf', 'initramfs.conf')
+ else:
+ root = os.path.join(tmpdir, 'conf', 'initramfs.conf')
with open(root, 'r') as rfd:
lines = rfd.readlines()
new_compression = ''
diff --git a/Dell/recovery_gtk.py b/Dell/recovery_gtk.py
index ea3ff0d..caf8aaf 100644
--- a/Dell/recovery_gtk.py
+++ b/Dell/recovery_gtk.py
@@ -34,7 +34,7 @@ from gi.repository import Gtk,GLib
from Dell.recovery_common import (DOMAIN, LOCALEDIR, UIDIR, SVGDIR, DBUS_INTERFACE_NAME,
DBUS_BUS_NAME, dbus_sync_call_signal_wrapper,
- PermissionDeniedByPolicy, check_version, check_recovery_dhc_id)
+ PermissionDeniedByPolicy, check_version)
#Translation support
from gettext import gettext as _
@@ -62,17 +62,13 @@ class DellRecoveryToolGTK:
#if running in driver install mode, hide other stuff
if mode == 'driver':
- for item in ['restore_system', 'build_os_media', 'restore_system_dhc']:
+ for item in ['restore_system', 'build_os_media']:
action_objects(self.tool_widgets, item, 'hide')
action_objects(self.tool_widgets, 'install_drivers', 'show')
else:
#hide restore from HDD unless there is a recovery partition
if not (recovery and os.path.exists('/etc/grub.d/99_dell_recovery')):
action_objects(self.tool_widgets, 'restore_system', 'hide')
- action_objects(self.tool_widgets, 'restore_system_dhc', 'hide')
- else:
- if not check_recovery_dhc_id():
- action_objects(self.tool_widgets, 'restore_system_dhc', 'hide')
#about dialog
self.about_box = None
@@ -145,16 +141,6 @@ class DellRecoveryToolGTK:
self.destroy()
except dbus.DBusException as msg:
self.dbus_exception_handler(msg)
- else:
- try:
- dbus_sync_call_signal_wrapper(self.backend(),
- "enable_boot_to_restore_dhc",
- {},
- False)
- subprocess.Popen(["gnome-session-quit", "--reboot"])
- self.destroy()
- except dbus.DBusException as msg:
- self.dbus_exception_handler(msg)
tool_selector.set_sensitive(True)
return False
diff --git a/debian/changelog b/debian/changelog
index 2b3d77f..c3241d9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,19 +1,3 @@
-dell-recovery (1.64) focal; urgency=medium
-
- [ Mario Limonciello ]
- * Update VCS URL to proper upstream URL
- * downgrade python requirement to 3.6 to allow bionic to work (Fixes: #87)
- * trivial: remove duplicated dependencies
- * update documentation
-
- [ Alex Tu ]
- * add dependencies for FDE
-
- [ chris Li Q ]
- * Add Dell Hybrid Client support
-
- -- Mario Limonciello <mario.limonciello@dell.com> Tue, 24 Mar 2020 08:38:04 -0500
-
dell-recovery (1.63) eoan; urgency=medium
[ Shih-Yuan Lee (FourDollars) ]
diff --git a/debian/dell-recovery.templates b/debian/dell-recovery.templates
index b52eb72..6a70047 100644
--- a/debian/dell-recovery.templates
+++ b/debian/dell-recovery.templates
@@ -64,18 +64,6 @@ Template: ubiquity/text/hdd_warning_label
Type: text
_Description: WARNING: All personal files and changes will be lost.
-Template: ubiquity/text/dhc_automated_recovery
-Type: text
-_Description: Install Dell Hybrid Client
-
-Template: ubiquity/text/dhc_automated_info
-Type: text
-_Description: This will rebuild all recovery, and OS partitions.
-
-Template: ubiquity/text/dhc_automated_warning_label
-Type: text
-_Description: WARNING: All personal files and changes will be lost.
-
Template: ubiquity/text/automated_recovery
Type: text
_Description: Restore entire hard drive.
diff --git a/dell-restore-system b/dell-restore-system
index 13ad88f..0948e5b 100644
--- a/dell-restore-system
+++ b/dell-restore-system
@@ -23,7 +23,7 @@
from Dell.recovery_common import (find_partition, check_version, DBUS_INTERFACE_NAME,
DBUS_BUS_NAME, dbus_sync_call_signal_wrapper,
- PermissionDeniedByPolicy, check_for_restore_command)
+ PermissionDeniedByPolicy)
import optparse
import os
import subprocess
@@ -40,8 +40,6 @@ parser.add_option('-c', '--check-version', dest='checkversion', action='store_tr
help='Show the version information.')
parser.add_option('-y', '--yes', dest='yes', action='store_true',
help="Restore the system without user's confirmation.")
-parser.add_option('-d', '--dhc', dest='dhc', action='store_true',
- help="Restore the system with Dell Hybrid Client without user's confirmation")
(options, args) = parser.parse_args()
if __name__ == '__main__':
@@ -69,26 +67,17 @@ if __name__ == '__main__':
for item in (autostart, reminder):
if os.path.exists(item):
os.remove(item)
- #Add option '-d' to support restore os with Dell Hybrid Client for some platforms
+
#invoke dbus to restore the system
try:
bus = dbus.SystemBus()
dbus_iface = dbus.Interface(bus.get_object(DBUS_BUS_NAME,
'/RecoveryMedia'),
DBUS_INTERFACE_NAME)
- if options.dhc:
- if check_for_restore_command():
- dbus_sync_call_signal_wrapper(dbus_iface,
- "enable_boot_to_restore_dhc",
- {},
- True)
- else:
- print("Sorry, you machine is not support the '-d' option, because your machine model is not belong to install Dell Hybrid Client series, you can try 'dell-restore-system -y' to restore os, thanks.")
- else:
- dbus_sync_call_signal_wrapper(dbus_iface,
- "enable_boot_to_restore",
- {},
- True)
+ dbus_sync_call_signal_wrapper(dbus_iface,
+ "enable_boot_to_restore",
+ {},
+ True)
except dbus.DBusException as ex:
if ex.get_dbus_name() == 'org.freedesktop.DBus.Error.FileNotFound':
text = _("Cannot connect to dbus")
diff --git a/gtk/tool_selector.ui b/gtk/tool_selector.ui
index 31e4ce5..96640d9 100644
--- a/gtk/tool_selector.ui
+++ b/gtk/tool_selector.ui
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
<interface>
- <!-- interface-requires gtk+ 3.0 -->
+ <!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="dialog_hig">
<property name="can_focus">False</property>
<property name="border_width">6</property>
@@ -9,9 +8,6 @@
<property name="resizable">False</property>
<property name="window_position">center-always</property>
<property name="type_hint">dialog</property>
- <child>
- <placeholder/>
- </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox6">
<property name="visible">True</property>
@@ -30,6 +26,7 @@
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -59,7 +56,7 @@
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="stock">gtk-dialog-error</property>
- <property name="icon_size">6</property>
+ <property name="icon-size">6</property>
</object>
<packing>
<property name="expand">False</property>
@@ -105,9 +102,6 @@
<property name="window_position">center</property>
<property name="icon_name">dell-dvd</property>
<signal name="destroy" handler="destroy" swapped="no"/>
- <child>
- <placeholder/>
- </child>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
@@ -164,33 +158,22 @@
<object class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">5</property>
+ <property name="n_rows">4</property>
<property name="n_columns">3</property>
<property name="row_spacing">10</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
<child>
<object class="GtkLabel" id="build_os_media_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
<property name="xpad">15</property>
<property name="label" translatable="yes">This will create OS Recovery Media that can be used to restore the computer to its factory shipped state. You will have the option to create an USB key or DVD image.</property>
<property name="wrap">True</property>
<property name="width_chars">40</property>
- <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
<property name="y_options">GTK_EXPAND</property>
</packing>
</child>
@@ -198,11 +181,11 @@
<object class="GtkLabel" id="restore_system_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
<property name="xpad">15</property>
<property name="label" translatable="yes">This will restore the system to the factory shipped state using the recovery partition stored on the hard drive.</property>
<property name="wrap">True</property>
<property name="width_chars">40</property>
- <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -212,22 +195,6 @@
<property name="y_options">GTK_EXPAND</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="restore_system_dhc_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xpad">15</property>
- <property name="label" translatable="yes">This will restore the system with Dell Hybrid Client to the factory shipped state using the recovery partition stored on the hard drive.</property>
- <property name="wrap">True</property>
- <property name="width_chars">40</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="y_options">GTK_EXPAND</property>
- </packing>
- </child>
<child>
<object class="GtkButton" id="build_os_media_button">
<property name="label" translatable="yes">Build OS Media</property>
@@ -235,15 +202,14 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<signal name="clicked" handler="top_button_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options"/>
- <property name="y_options"/>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
</packing>
</child>
<child>
@@ -253,6 +219,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<signal name="clicked" handler="top_button_clicked" swapped="no"/>
</object>
<packing>
@@ -260,24 +227,8 @@
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
- <property name="x_options"/>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="restore_system_dhc_button">
- <property name="label" translatable="yes">Restore Dell Hybrid Client</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <signal name="clicked" handler="top_button_clicked" swapped="no"/>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_options"/>
- <property name="y_options"/>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
</packing>
</child>
<child>
@@ -289,10 +240,8 @@
<property name="icon_name">drive-harddisk</property>
</object>
<packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options"/>
- <property name="y_options"/>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
</packing>
</child>
<child>
@@ -302,43 +251,29 @@
<property name="xpad">15</property>
<property name="pixel_size">48</property>
<property name="icon_name">view-refresh</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
- <property name="x_options"/>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="restore_system_dhc_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xpad">15</property>
- <property name="pixel_size">48</property>
- <property name="icon_name">view-refresh</property>
- <property name="icon_size">1</property>
- </object>
- <packing>
- <property name="x_options"/>
- <property name="y_options"/>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="install_drivers_label">
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
<property name="xpad">15</property>
<property name="label" translatable="yes">This will install a Dell driver package that you downloaded from the Internet.</property>
<property name="wrap">True</property>
<property name="width_chars">40</property>
- <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="y_options">GTK_EXPAND</property>
</packing>
</child>
@@ -350,10 +285,10 @@
<property name="icon_name">network-server</property>
</object>
<packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options"/>
- <property name="y_options"/>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
</packing>
</child>
<child>
@@ -362,15 +297,16 @@
<property name="use_action_appearance">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<signal name="clicked" handler="top_button_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options"/>
- <property name="y_options"/>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
</packing>
</child>
</object>
diff --git a/late/chroot_scripts/03-ubuntu-drivers.sh b/late/chroot_scripts/03-ubuntu-drivers.sh
index f02e43b..db513a9 100755
--- a/late/chroot_scripts/03-ubuntu-drivers.sh
+++ b/late/chroot_scripts/03-ubuntu-drivers.sh
@@ -12,14 +12,14 @@ done
if [ -n "$UBUNTU_DRIVERS_BLACKLIST" ]; then
echo "UBUNTU_DRIVERS_BLACKLIST: $UBUNTU_DRIVERS_BLACKLIST"
fi
-for pkg in $(ubuntu-drivers list); do
- if dpkg-query -W -f='${Status}\n' "$pkg" | grep "install ok installed" >/dev/null 2>&1; then
+for pkg in `ubuntu-drivers list`; do
+ if dpkg-query -W $pkg >/dev/null 2>&1; then
echo "$pkg has been installed."
else
- if [ -n "$UBUNTU_DRIVERS_BLACKLIST" ] && echo "$UBUNTU_DRIVERS_BLACKLIST" | grep "$pkg" >/dev/null 2>&1; then
+ if [ -n "$UBUNTU_DRIVERS_BLACKLIST" ] && echo "$UBUNTU_DRIVERS_BLACKLIST" | grep $pkg >/dev/null 2>&1; then
echo "Won't install '$pkg' listed in UBUNTU_DRIVERS_BLACKLIST"
else
- apt-get install --yes "$pkg"
+ apt-get install --yes $pkg
fi
fi
done
diff --git a/ubiquity/dell-bootstrap.py b/ubiquity/dell-bootstrap.py
index bf4b6e8..2733734 100644
--- a/ubiquity/dell-bootstrap.py
+++ b/ubiquity/dell-bootstrap.py
@@ -92,19 +92,10 @@ class PageNoninteractive(PluginUI):
"""Empty skeleton function for the non-interactive UI"""
pass
- def dhc_populate_devices(self, devices):
- """Empty skeleton function for the non-interactive UI"""
- pass
-
def set_advanced(self, item, value):
"""Empty skeleton function for the non-interactive UI"""
pass
- def dhc_set_advanced(self, item, value):
- """Empty skeleton function for the non-interactive UI"""
- pass
-
-
############
# GTK Page #
############
@@ -122,7 +113,7 @@ class PageGtk(PluginUI):
self.efi = False
with misc.raised_privileges():
self.genuine = magic.check_vendor()
- self.install_dhc_id = magic.check_install_dhc_id()
+
if not oem:
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
@@ -140,9 +131,6 @@ class PageGtk(PluginUI):
self.hdd_recovery = builder.get_object('hdd_recovery')
self.hdd_recovery_box = builder.get_object('hdd_recovery_box')
self.hidden_radio = builder.get_object('hidden_radio')
- self.dhc_automated_recovery = builder.get_object('dhc_automated_recovery')
- self.dhc_automated_recovery_box = builder.get_object('dhc_automated_recovery_box')
- self.dhc_automated_combobox = builder.get_object('dhc_hard_drive_combobox')
self.info_box = builder.get_object('info_box')
self.info_spinner = Gtk.Spinner()
builder.get_object('info_spinner_box').add(self.info_spinner)
@@ -174,15 +162,6 @@ class PageGtk(PluginUI):
self.automated_recovery.set_sensitive(False)
self.interactive_recovery.set_sensitive(False)
self.controller.allow_go_forward(False)
- #if machine ID is match DHC machine id, then only show install Dell Hybrid Client option,otherwise show normal ubuntu option
- if self.install_dhc_id:
- self.automated_recovery_box.hide()
- self.automated_recovery.set_sensitive(False)
- self.interactive_recovery_box.hide()
- self.interactive_recovery.set_sensitive(False)
- else:
- self.dhc_automated_recovery_box.hide()
- self.dhc_automated_recovery.set_sensitive(False)
self.toggle_progress()
return self.plugin_widgets
@@ -197,8 +176,6 @@ class PageGtk(PluginUI):
"""Returns the type of recovery to do from GUI"""
if self.automated_recovery.get_active():
return "automatic"
- elif self.dhc_automated_recovery.get_active():
- return "dhc"
elif self.interactive_recovery.get_active():
return "interactive"
else:
@@ -214,16 +191,6 @@ class PageGtk(PluginUI):
size = model.get_value(iterator, 1)
return (device, size)
- def dhc_get_selected_device(self):
- """copy normal install ubuntu func to returns the selected device from the GUI for DHC"""
- device = size = ''
- model = self.dhc_automated_combobox.get_model()
- iterator = self.dhc_automated_combobox.get_active_iter()
- if iterator is not None:
- device = model.get_value(iterator, 0)
- size = model.get_value(iterator, 1)
- return (device, size)
-
def set_type(self, value, stage):
"""Sets the type of recovery to do in GUI"""
if not self.genuine:
@@ -232,8 +199,6 @@ class PageGtk(PluginUI):
if value == "automatic":
self.automated_recovery.set_active(True)
- elif value == "dhc":
- self.dhc_automated_recovery.set_active(True)
elif value == "interactive":
self.interactive_recovery.set_active(True)
elif value == "factory":
@@ -245,16 +210,13 @@ class PageGtk(PluginUI):
self.hdd_recovery_box.show()
self.interactive_recovery_box.hide()
self.automated_recovery_box.hide()
- self.dhc_automated_recovery_box.hide()
self.interactive_recovery.set_sensitive(False)
self.automated_recovery.set_sensitive(False)
- self.dhc_automated_recovery.set_sensitive(False)
def toggle_type(self, widget):
"""Allows the user to go forward after they've made a selection'"""
self.controller.allow_go_forward(True)
self.automated_combobox.set_sensitive(self.automated_recovery.get_active())
- self.dhc_automated_combobox.set_sensitive(self.dhc_automated_recovery.get_active())
def show_dialog(self, which, data = None):
"""Shows a dialog"""
@@ -263,14 +225,12 @@ class PageGtk(PluginUI):
self.controller.get_string('ubiquity/imported/cancel'))
self.controller.allow_go_forward(False)
self.automated_recovery_box.hide()
- self.dhc_automated_recovery_box.hide()
self.interactive_recovery_box.hide()
self.info_box.show_all()
self.info_spinner.start()
self.toggle_progress()
elif which == "forward":
self.automated_recovery_box.hide()
- self.dhc_automated_recovery_box.hide()
self.interactive_recovery_box.hide()
self.toggle_progress()
else:
@@ -293,18 +253,6 @@ class PageGtk(PluginUI):
#default to the first item active (it should be sorted anyway)
self.automated_combobox.set_active(0)
- def dhc_populate_devices(self, devices):
- """Feeds a selection of devices into the GUI
- devices should be an array of 3 column arrays
- """
- #populate the devices
- liststore = self.dhc_automated_combobox.get_model()
- for device in devices:
- liststore.append(device)
-
- #default to the first item active (it should be sorted anyway)
- self.dhc_automated_combobox.set_active(0)
-
## ##
## Advanced GUI options ##
## ##
@@ -361,7 +309,6 @@ class Page(Plugin):
self.preseed_config = ''
self.rp_builder = None
self.disk_size = None
- self.rec_type=None
self.stage = 1
Plugin.__init__(self, frontend, db, ui)
@@ -849,7 +796,7 @@ class Page(Plugin):
self.log("selected device %s %d" % (device, size))
return Plugin.ok_handler(self)
-
+
def report_progress(self, info, percent):
"""Reports to the frontend an update about th progress"""
self.frontend.debconf_progress_info(info)
@@ -866,7 +813,7 @@ class Page(Plugin):
try:
# User recovery - need to copy RP
- if rec_type == "automatic" or rec_type == "dhc" or \
+ if rec_type == "automatic" or \
(rec_type == "factory" and self.stage == 1):
if not (rec_type == "factory" and self.stage == 1):
@@ -886,9 +833,7 @@ class Page(Plugin):
self.mem,
self.efi,
self.preseed_config,
- size_thread,
- self.rec_type)
- self.rp_builder.rec_type=self.ui.get_type()
+ size_thread)
self.rp_builder.exit = self.exit_ui_loops
self.rp_builder.status = self.report_progress
self.rp_builder.start()
@@ -914,7 +859,7 @@ class Page(Plugin):
except Exception as err:
#For interactive types of installs show an error then reboot
#Otherwise, just reboot the system
- if rec_type == "automatic" or rec_type == "dhc" or rec_type == "interactive" or \
+ if rec_type == "automatic" or rec_type == "interactive" or \
('UBIQUITY_DEBUG' in os.environ and 'UBIQUITY_ONLY' in os.environ):
self.handle_exception(err)
self.cancel_handler()
@@ -943,7 +888,7 @@ class Page(Plugin):
############################
class RPbuilder(Thread):
"""The recovery partition builder worker thread"""
- def __init__(self, device, size, mem, efi, preseed_config, sizing_thread, rec_type):
+ def __init__(self, device, size, mem, efi, preseed_config, sizing_thread):
self.device = device
self.device_size = size
self.mem = mem
@@ -952,7 +897,6 @@ class RPbuilder(Thread):
self.exception = None
self.file_size_thread = sizing_thread
self.xml_obj = BTOxml()
- self.rec_type=rec_type
Thread.__init__(self)
def build_rp(self, cushion=600):
@@ -1054,12 +998,6 @@ manually to proceed.")
uuid = item.split('=')[1]
break
- with misc.raised_privileges():
- if self.rec_type=='dhc':
- f=os.path.join('/mnt','.dhc_flag')
- with open(f,'w'):
- pass
-
#read in any old seed
seed = os.path.join('/mnt', 'preseed', 'dell-recovery.seed')
keys = magic.parse_seed(seed)
@@ -1339,7 +1277,7 @@ class Install(InstallPlugin):
recovery_type = 'hdd'
#if wyse mode is on (dell-recovery/mode == 'wyse'), set the recovery_type to be 'factory'
#as Wyse platforms will always skip the "Restore OS Linux partition" dialog
- if self.db.get('dell-recovery/wyse_mode') == 'true' or magic.check_family(b"wyse") or magic.check_install_dhc_id() or magic.check_recovery_dhc_id():
+ if self.db.get('dell-recovery/wyse_mode') == 'true' or magic.check_family(b"wyse"):
recovery_type = 'factory'
#create 99_dell_recovery grub
magic.create_grub_entries(self.target, recovery_type)
diff --git a/ubiquity/stepDellBootstrap.ui b/ubiquity/stepDellBootstrap.ui
index 1335e7b..635bd46 100644
--- a/ubiquity/stepDellBootstrap.ui
+++ b/ubiquity/stepDellBootstrap.ui
@@ -11,9 +11,6 @@
<property name="window_position">center</property>
<property name="type_hint">dialog</property>
<property name="deletable">False</property>
- <child>
- <placeholder/>
- </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox7">
<property name="visible">True</property>
@@ -66,9 +63,9 @@
<object class="GtkLabel" id="runtime_details_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Runtime Details&lt;/b&gt;</property>
<property name="use_markup">True</property>
- <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -80,8 +77,8 @@
<object class="GtkLabel" id="version_detail">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">version</property>
<property name="xalign">0</property>
+ <property name="label" translatable="yes">version</property>
</object>
<packing>
<property name="expand">True</property>
@@ -93,8 +90,8 @@
<object class="GtkLabel" id="mountpoint_detail">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">mount</property>
<property name="xalign">0</property>
+ <property name="label" translatable="yes">mount</property>
</object>
<packing>
<property name="expand">True</property>
@@ -106,8 +103,8 @@
<object class="GtkLabel" id="memory_detail">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">memory</property>
<property name="xalign">0</property>
+ <property name="label" translatable="yes">memory</property>
</object>
<packing>
<property name="expand">True</property>
@@ -214,11 +211,11 @@
<object class="GtkLabel" id="bootstrap_information_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
<property name="label" translatable="yes">This Dell Recovery Media can be used to restore the original factory software.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -230,11 +227,11 @@
<object class="GtkLabel" id="bootstrap_warning_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;It is recommended you back up all important data before running this tool.&lt;/b&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -267,7 +264,7 @@
<object class="GtkHBox" id="hdd_recovery_box">
<property name="can_focus">False</property>
<child>
- <object class="GtkImage" id="image1">
+ <object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixel_size">48</property>
@@ -280,7 +277,7 @@
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox3">
+ <object class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
@@ -303,7 +300,7 @@
</packing>
</child>
<child>
- <object class="GtkAlignment" id="alignment1">
+ <object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">25</property>
@@ -312,120 +309,11 @@
<property name="width_request">600</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">This will rebuild all OS and swap partitions to factory defaults.</property>
- <property name="use_markup">True</property>
- <property name="wrap">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="left_padding">25</property>
- <child>
- <object class="GtkLabel" id="hdd_warning_label">
- <property name="width_request">600</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">&lt;b&gt;WARNING: &lt;/b&gt;All personal files and changes will be lost.</property>
+ <property name="label" translatable="yes">This will rebuild all OS and swap partitions to factory defaults.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <object class="GtkHBox" id="dhc_automated_recovery_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkImage" id="image3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixel_size">48</property>
- <property name="icon_name">distributor-logo</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">5</property>
- <child>
- <object class="GtkRadioButton" id="dhc_automated_recovery">
- <property name="label" translatable="yes">Install Dell Hybrid Client</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="xalign">0.5</property>
- <property name="draw_indicator">True</property>
- <property name="group">automated_recovery</property>
- <signal name="toggled" handler="toggle_type" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment8">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="xscale">0</property>
- <property name="left_padding">25</property>
- <child>
- <object class="GtkComboBox" id="dhc_hard_drive_combobox">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">False</property>
- <property name="model">hard_drive_liststore</property>
- <child>
- <object class="GtkCellRendererText" id="cellrenderertext2"/>
- <attributes>
- <attribute name="text">2</attribute>
- </attributes>
- </child>
</object>
</child>
</object>
@@ -436,56 +324,29 @@
</packing>
</child>
<child>
- <object class="GtkAlignment" id="alignment9">
+ <object class="GtkAlignment" id="alignment5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">25</property>
<child>
- <object class="GtkLabel" id="dhc_automated_info">
+ <object class="GtkLabel" id="hdd_warning_label">
<property name="width_request">600</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">This will rebuild all recovery, and OS partitions.</property>
- <property name="use_markup">True</property>
- <property name="wrap">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment10">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="left_padding">25</property>
- <child>
- <object class="GtkLabel" id="dhc_automated_warning_label">
- <property name="width_request">600</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;WARNING: &lt;/b&gt;All personal files and changes will be lost.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">2</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
</object>
<packing>
<property name="expand">True</property>
@@ -497,7 +358,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -569,7 +430,7 @@
</packing>
</child>
<child>
- <object class="GtkAlignment" id="alignment4">
+ <object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">25</property>
@@ -578,11 +439,11 @@
<property name="width_request">600</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
<property name="label" translatable="yes">This will rebuild all recovery, and OS partitions.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
</object>
</child>
</object>
@@ -593,7 +454,7 @@
</packing>
</child>
<child>
- <object class="GtkAlignment" id="alignment7">
+ <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">25</property>
@@ -602,11 +463,11 @@
<property name="width_request">600</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;WARNING: &lt;/b&gt;All personal files and changes will be lost.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
</object>
</child>
</object>
@@ -627,7 +488,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
@@ -635,7 +496,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkImage" id="image4">
+ <object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixel_size">48</property>
@@ -648,7 +509,7 @@
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox7">
+ <object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
@@ -672,7 +533,7 @@
</packing>
</child>
<child>
- <object class="GtkAlignment" id="alignment11">
+ <object class="GtkAlignment" id="alignment4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">25</property>
@@ -681,11 +542,11 @@
<property name="width_request">600</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
<property name="label" translatable="yes">e.g. Disk encryption, partitions resizing..etc.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
</object>
</child>
</object>
@@ -696,7 +557,7 @@
</packing>
</child>
<child>
- <object class="GtkAlignment" id="alignment12">
+ <object class="GtkAlignment" id="alignment9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">25</property>
@@ -705,11 +566,11 @@
<property name="width_request">600</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
<property name="label" translatable="yes">WARNING: No recovery feature included.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
</object>
</child>
</object>
@@ -730,7 +591,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
- <property name="position">4</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
@@ -746,14 +607,14 @@
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
- <property name="position">5</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="error_box">
<property name="can_focus">False</property>
<child>
- <object class="GtkImage" id="image6">
+ <object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixel_size">48</property>
@@ -769,10 +630,10 @@
<object class="GtkLabel" id="genuine_bootstrap_warning_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0.05000000074505806</property>
<property name="label" translatable="yes">&lt;b&gt;ERROR:&lt;/b&gt; This recovery media only functions on Dell or Alienware systems.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- <property name="xalign">0.05000000074505806</property>
</object>
<packing>
<property name="expand">True</property>
@@ -784,7 +645,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
- <property name="position">6</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -795,11 +656,11 @@
<object class="GtkLabel" id="status_warning_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Building Recovery Partition&lt;/b&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -811,11 +672,11 @@
<object class="GtkLabel" id="status_info_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;NOTE:&lt;/b&gt; Please be patient, this may take a while.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -827,11 +688,11 @@
<object class="GtkLabel" id="status_restart_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
<property name="label" translatable="yes">Your system will restart automatically several times.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
</object>
<packing>
<property name="expand">True</property>
@@ -857,21 +718,9 @@
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
- <property name="position">7</property>
+ <property name="position">5</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
</object>
<packing>
<property name="expand">True</property>
@@ -880,14 +729,14 @@
</packing>
</child>
</object>
- <object class="GtkImage" id="image7">
+ <object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="icon_name">gnome-session-reboot</property>
</object>
- <object class="GtkImage" id="image8">
+ <object class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment