diff -Nru dell-recovery-1.63/CHANGES dell-recovery-1.64/CHANGES --- dell-recovery-1.63/CHANGES 2019-10-15 15:44:03.000000000 +0000 +++ dell-recovery-1.64/CHANGES 2020-03-24 13:38:04.000000000 +0000 @@ -1,3 +1,19 @@ +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 Tue, 24 Mar 2020 08:38:04 -0500 + dell-recovery (1.63) eoan; urgency=medium [ Shih-Yuan Lee (FourDollars) ] diff -Nru dell-recovery-1.63/debian/changelog dell-recovery-1.64/debian/changelog --- dell-recovery-1.63/debian/changelog 2019-10-15 15:44:03.000000000 +0000 +++ dell-recovery-1.64/debian/changelog 2020-03-24 13:38:04.000000000 +0000 @@ -1,3 +1,19 @@ +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 Tue, 24 Mar 2020 08:38:04 -0500 + dell-recovery (1.63) eoan; urgency=medium [ Shih-Yuan Lee (FourDollars) ] diff -Nru dell-recovery-1.63/debian/control dell-recovery-1.64/debian/control --- dell-recovery-1.63/debian/control 2019-10-15 15:44:02.000000000 +0000 +++ dell-recovery-1.64/debian/control 2020-03-24 13:35:54.000000000 +0000 @@ -11,9 +11,9 @@ pyflakes3, lsb-release, gnu-efi (>= 3.0.2) -X-Python3-Version: >= 3.7 -Homepage: http://github.com/superm1/dell-recovery -Vcs-Git: http://github.com/superm1/dell-recovery +X-Python3-Version: >= 3.6 +Homepage: http://github.com/dell/dell-recovery +Vcs-Git: http://github.com/dell/dell-recovery Standards-Version: 4.4.0 Package: dell-recovery @@ -35,17 +35,19 @@ Replaces: dell-artwork, dell-oobe Conflicts: dell-oobe Recommends: cryptsetup, + cryptsetup-bin, dvd+rw-tools, isolinux, lsb-release, lvm2, + mokutil, mdadm (>> 4.1~rc1-2), parted, python3-progressbar, ttf-dejavu, usb-creator-gtk, wodim, - xorriso + xorriso, Enhances: oem-config-gtk, ubiquity-frontend-gtk Suggests: grub-pc Description: Dell Recovery Media Creation Package diff -Nru dell-recovery-1.63/debian/dell-recovery.templates dell-recovery-1.64/debian/dell-recovery.templates --- dell-recovery-1.63/debian/dell-recovery.templates 2019-10-15 15:33:54.000000000 +0000 +++ dell-recovery-1.64/debian/dell-recovery.templates 2020-03-24 13:35:55.000000000 +0000 @@ -64,6 +64,18 @@ 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 -Nru dell-recovery-1.63/Dell/recovery_backend.py dell-recovery-1.64/Dell/recovery_backend.py --- dell-recovery-1.63/Dell/recovery_backend.py 2019-10-15 15:44:02.000000000 +0000 +++ dell-recovery-1.64/Dell/recovery_backend.py 2020-03-24 13:35:55.000000000 +0000 @@ -43,7 +43,7 @@ walk_cleanup, create_new_uuid, white_tree, black_tree, fetch_output, check_version, DBUS_BUS_NAME, DBUS_INTERFACE_NAME, - RestoreFailed, CreateFailed, + RestoreFailed, CreateFailed, find_partition, regenerate_md5sum, PermissionDeniedByPolicy) from Dell.recovery_threading import ProgressByPulse, ProgressBySize from Dell.recovery_xml import BTOxml @@ -776,6 +776,21 @@ 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 -Nru dell-recovery-1.63/Dell/recovery_common.py dell-recovery-1.64/Dell/recovery_common.py --- dell-recovery-1.63/Dell/recovery_common.py 2019-10-15 15:44:02.000000000 +0000 +++ dell-recovery-1.64/Dell/recovery_common.py 2020-03-24 13:35:55.000000000 +0000 @@ -151,6 +151,64 @@ 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/' diff -Nru dell-recovery-1.63/Dell/recovery_gtk.py dell-recovery-1.64/Dell/recovery_gtk.py --- dell-recovery-1.63/Dell/recovery_gtk.py 2019-10-15 15:44:02.000000000 +0000 +++ dell-recovery-1.64/Dell/recovery_gtk.py 2020-03-24 13:35:55.000000000 +0000 @@ -34,7 +34,7 @@ from Dell.recovery_common import (DOMAIN, LOCALEDIR, UIDIR, SVGDIR, DBUS_INTERFACE_NAME, DBUS_BUS_NAME, dbus_sync_call_signal_wrapper, - PermissionDeniedByPolicy, check_version) + PermissionDeniedByPolicy, check_version, check_recovery_dhc_id) #Translation support from gettext import gettext as _ @@ -62,13 +62,17 @@ #if running in driver install mode, hide other stuff if mode == 'driver': - for item in ['restore_system', 'build_os_media']: + for item in ['restore_system', 'build_os_media', 'restore_system_dhc']: 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 @@ -138,6 +142,16 @@ {}, False) subprocess.Popen(["gnome-session-quit", "--reboot"]) + 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) diff -Nru dell-recovery-1.63/dell-restore-system dell-recovery-1.64/dell-restore-system --- dell-recovery-1.63/dell-restore-system 2017-09-19 14:06:19.000000000 +0000 +++ dell-recovery-1.64/dell-restore-system 2020-03-24 13:35:55.000000000 +0000 @@ -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) + PermissionDeniedByPolicy, check_for_restore_command) import optparse import os import subprocess @@ -40,6 +40,8 @@ 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__': @@ -67,17 +69,26 @@ 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) - dbus_sync_call_signal_wrapper(dbus_iface, - "enable_boot_to_restore", - {}, - True) + 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) except dbus.DBusException as ex: if ex.get_dbus_name() == 'org.freedesktop.DBus.Error.FileNotFound': text = _("Cannot connect to dbus") diff -Nru dell-recovery-1.63/gtk/tool_selector.ui dell-recovery-1.64/gtk/tool_selector.ui --- dell-recovery-1.63/gtk/tool_selector.ui 2017-08-15 16:16:53.000000000 +0000 +++ dell-recovery-1.64/gtk/tool_selector.ui 2020-03-24 13:35:55.000000000 +0000 @@ -1,6 +1,7 @@ + - + False 6 @@ -8,6 +9,9 @@ False center-always dialog + + + True @@ -26,7 +30,6 @@ True True True - False True @@ -56,7 +59,7 @@ 0 0 gtk-dialog-error - 6 + 6 False @@ -103,6 +106,9 @@ dell-dvd + + + True False @@ -158,22 +164,33 @@ True False - 4 + 5 3 10 + + + + + + + + + True False - 0 15 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. True 40 + 0 2 3 + 2 + 3 GTK_EXPAND @@ -181,11 +198,11 @@ True False - 0 15 This will restore the system to the factory shipped state using the recovery partition stored on the hard drive. True 40 + 0 2 @@ -196,20 +213,37 @@ + + True + False + 15 + This will restore the system with Dell Hybrid Client to the factory shipped state using the recovery partition stored on the hard drive. + True + 40 + 0 + + + 2 + 3 + GTK_EXPAND + + + Build OS Media False True True True - False 1 2 - - + 2 + 3 + + @@ -219,7 +253,6 @@ True True True - False @@ -227,8 +260,24 @@ 2 1 2 - - + + + + + + + Restore Dell Hybrid Client + False + True + True + True + + + + 1 + 2 + + @@ -240,8 +289,10 @@ drive-harddisk - - + 2 + 3 + + @@ -251,29 +302,43 @@ 15 48 view-refresh - 1 + 1 1 2 - - + + + + + + + True + False + 15 + 48 + view-refresh + 1 + + + + False - 0 15 This will install a Dell driver package that you downloaded from the Internet. True 40 + 0 2 3 - 2 - 3 + 3 + 4 GTK_EXPAND @@ -285,10 +350,10 @@ network-server - 2 - 3 - - + 3 + 4 + + @@ -297,16 +362,15 @@ False True True - False 1 2 - 2 - 3 - - + 3 + 4 + + diff -Nru dell-recovery-1.63/installation_flow.md dell-recovery-1.64/installation_flow.md --- dell-recovery-1.63/installation_flow.md 1970-01-01 00:00:00.000000000 +0000 +++ dell-recovery-1.64/installation_flow.md 2020-03-24 13:35:55.000000000 +0000 @@ -0,0 +1,60 @@ +Although the installer for Dell recovery media is the same as standard Ubuntu (*ubiquity*), the installation flow varies. + +# Standard Ubuntu installation +A standard Ubuntu installation from a USB key only has one installation *phase*. The user is prompted for installation options such as disk, timezone, keyboard and username and installation runs in the background. + +When the install is complete, upon rebooting the machine they are brought to a Ubuntu login screen and can use the computer. + +# *Standard* OEM installation +A standard OEM Ubuntu installation will be preseeded to operate in an automated fashion. Any questions that are not answered in the preseeding process will be prompted by the GUI. After installation is finished, the system will either be shut down or rebooted into **OEM-Config mode**. + +In **OEM-Config mode** the user will be prompted for questions that might not be the same as those preseeded. For example, Keyboard layout, Timezone or Language. + +After completing OEM-Config, the user is brought to an Ubuntu login screen. + +# Dell OEM installation +The Dell OEM installation is split across ***three** distinct phases*. +It is split this way to be able to support an archicture with a factory recovery partition on the hard disk. +This factory recovery partition is used both for Dell manufacturing as well as for customer based recovery. + +## Phase 1: Prepare partitions and content +The first phase prepares the disk and loads the recovery partition content onto it. This can be approached from 3 different methods. + +### Dell factory + +1. In the Dell factory we integrate with existing manufacturing tools, and these tools create initial partition layout (ESP and Recovery partition) and load the content onto the disk. + +2. Other manufacturing tools also configure next boot (`BootOrder`/`BootNext` variables) +3. Other manufacturing tools control reboot cycle. +4. On the next boot we’ll boot directly into phase 2. + +### Customer USB recovery + +1. If customer boots up USB recovery disk, it will come to a prompt selecting which disk to use to install to. +2. Customer presses next, and disk is wiped, content copied to ESP and recovery partition +3. Boot variables set for next boot +4. System automatically reboots into phase 2. + +### Customer HDD recovery + +1. GUI tool is offered in OS that will change grub next boot option to a recovery option we left to boot recovery partition. +2. Customer can also interrupt GRUB silent menu to select this option. +3. Customer agrees to wipe content. +4. System continues to phase 2. + + +## Phase 2: Install Ubuntu +This part of the installation is fully automated. The OS is booted from the recovery partition and the Ubiquity installer will launch. + +Ubiquity will create additional partitions to install into, and all files will be copied in. Any applicable drivers and updated packages distributed in `/debs` of the recovery partition will be installed by Ubiquity and dell-recovery plugins. + +After Ubiquity finishes, a set of post-install scripts provided by Dell in the `/scripts` directory of the recovery partition will run to complete the install. + +When this phase is run during manufacturing, the system will return to Dell manufacturing process. + +## Phase 3: Out of box experience +In a Dell manufactured machine, this is the first phase that a customer will actually see. + +As with standard OEM installation, the customer will select the Language, Timezone, Keyboard Layout, a username and a password. + +However specific to the Dell OEM install an additional page will prompt to create USB recovery media to use in the event of a failure. diff -Nru dell-recovery-1.63/modifying_factory_image.md dell-recovery-1.64/modifying_factory_image.md --- dell-recovery-1.63/modifying_factory_image.md 2017-08-15 16:17:19.000000000 +0000 +++ dell-recovery-1.64/modifying_factory_image.md 2020-03-24 13:35:55.000000000 +0000 @@ -5,7 +5,7 @@ Development purposes -- -For development purposes, additional `.deb` packages can be placed onto a USB stick with a factory image already written to it. +For development purposes, additional `.deb` packages can be placed onto a USB stick with a factory image already written to it if the USB stick is formatted as FAT32. 1. Create the directories `debs/main` on the USB stick if they don't already exist. 2. Copy all .deb packages and their dependencies into the `debs/main` directory on the USB disk. @@ -14,15 +14,15 @@ -- To write these packages into a new ISO image, the **Dell Recovery** tool needs to be executed in *builder* mode. In *builder* mode it can take an existing factory ISO image and modify it. -From an Ubuntu machine, execute: +From an Ubuntu machine with `dell-recovery` installed, execute: `# dell-recovery --builder` The GUI will ask for an existing factory ISO image. -On the (driver) FISH packages page, additional .deb files can be selected. +On the (driver) FISH packages page, additional `.deb` files can be selected. If you have a lot of packages, alternatively a command line version is available -that all .deb packages can be declared in a newline delimitted text file. +that all `.deb` packages can be declared in a newline delimitted text file. `# /usr/share/dell/bin/dell-bto-autobuilder` diff -Nru dell-recovery-1.63/po/dell-recovery.pot dell-recovery-1.64/po/dell-recovery.pot --- dell-recovery-1.63/po/dell-recovery.pot 2019-05-10 18:21:50.000000000 +0000 +++ dell-recovery-1.64/po/dell-recovery.pot 2020-03-24 13:38:04.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-06 14:23-0500\n" +"POT-Creation-Date: 2020-03-24 08:39-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,24 +17,24 @@ "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: ../Dell/recovery_gtk.py:104 +#: ../Dell/recovery_gtk.py:108 msgid "Cannot connect to dbus" msgstr "" -#: ../Dell/recovery_gtk.py:106 +#: ../Dell/recovery_gtk.py:110 msgid "Permission Denied" msgstr "" -#: ../Dell/recovery_gtk.py:113 +#: ../Dell/recovery_gtk.py:117 msgid "Exception" msgstr "" -#: ../Dell/recovery_gtk.py:158 ../gtk/dell-recovery-media.desktop.in.h:1 +#: ../Dell/recovery_gtk.py:173 ../gtk/dell-recovery-media.desktop.in.h:1 #: ../gtk/tool_selector.ui.h:2 msgid "Dell Recovery" msgstr "" -#: ../Dell/recovery_gtk.py:159 +#: ../Dell/recovery_gtk.py:174 msgid "Copyright 2008-2012 Dell Inc." msgstr "" @@ -50,51 +50,51 @@ msgid "Building Base image" msgstr "" -#: ../Dell/recovery_basic_gtk.py:179 +#: ../Dell/recovery_basic_gtk.py:181 msgid "Opening Burner" msgstr "" -#: ../Dell/recovery_basic_gtk.py:204 +#: ../Dell/recovery_basic_gtk.py:206 msgid "Recovery Media Creation Process Complete" msgstr "" -#: ../Dell/recovery_basic_gtk.py:205 +#: ../Dell/recovery_basic_gtk.py:207 msgid "" "If you would like to archive another copy, the generated image has been " "stored under the filename:\n" msgstr "" -#: ../Dell/recovery_basic_gtk.py:219 +#: ../Dell/recovery_basic_gtk.py:221 msgid "Unable to proceed" msgstr "" -#: ../Dell/recovery_basic_gtk.py:220 +#: ../Dell/recovery_basic_gtk.py:222 msgid "" "System does not appear to contain Dell factory installed partition layout." msgstr "" -#: ../Dell/recovery_basic_gtk.py:331 +#: ../Dell/recovery_basic_gtk.py:334 msgid "Image File" msgstr "" -#: ../Dell/recovery_basic_gtk.py:333 +#: ../Dell/recovery_basic_gtk.py:336 msgid "Media Type: " msgstr "" -#: ../Dell/recovery_basic_gtk.py:336 ../Dell/recovery_basic_gtk.py:339 +#: ../Dell/recovery_basic_gtk.py:339 ../Dell/recovery_basic_gtk.py:342 msgid "Recovery Partition: " msgstr "" -#: ../Dell/recovery_basic_gtk.py:340 +#: ../Dell/recovery_basic_gtk.py:343 msgid "Included" msgstr "" #. wizard.resize(400,400) -#: ../Dell/recovery_advanced_gtk.py:69 +#: ../Dell/recovery_advanced_gtk.py:63 msgid " (BTO Image Builder Mode)" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:71 +#: ../Dell/recovery_advanced_gtk.py:65 msgid "" "This will integrate a Dell OEM FID framework & driver package set into a " "customized OS media image. You will have the option to create an USB key or " @@ -102,84 +102,84 @@ msgstr "" #. insert builder pages in reverse order -#: ../Dell/recovery_advanced_gtk.py:90 +#: ../Dell/recovery_advanced_gtk.py:84 msgid "Application Packages" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:91 +#: ../Dell/recovery_advanced_gtk.py:85 msgid "Driver Packages" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:92 +#: ../Dell/recovery_advanced_gtk.py:86 msgid "FID Content" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:93 +#: ../Dell/recovery_advanced_gtk.py:87 msgid "Base OS Image" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:167 +#: ../Dell/recovery_advanced_gtk.py:161 msgid "Builder Summary" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:168 +#: ../Dell/recovery_advanced_gtk.py:162 msgid "Base Image Distributor" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:170 +#: ../Dell/recovery_advanced_gtk.py:164 msgid "Base Image Release" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:173 +#: ../Dell/recovery_advanced_gtk.py:167 msgid "BTO Base Image" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:176 +#: ../Dell/recovery_advanced_gtk.py:170 msgid "Base Image" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:179 +#: ../Dell/recovery_advanced_gtk.py:173 msgid "Application" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:180 +#: ../Dell/recovery_advanced_gtk.py:174 msgid "Driver" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:186 +#: ../Dell/recovery_advanced_gtk.py:180 msgid "Packages" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:192 +#: ../Dell/recovery_advanced_gtk.py:186 msgid "Inject Dell Recovery Package" msgstr "" #. update gui -#: ../Dell/recovery_advanced_gtk.py:202 +#: ../Dell/recovery_advanced_gtk.py:196 msgid "Assembling Image Components" msgstr "" -#: ../Dell/recovery_advanced_gtk.py:442 +#: ../Dell/recovery_advanced_gtk.py:431 msgid "All SRVs must be filled to proceed." msgstr "" -#: ../Dell/recovery_backend.py:346 +#: ../Dell/recovery_backend.py:332 msgid "Processing FISH packages" msgstr "" -#: ../Dell/recovery_backend.py:469 +#: ../Dell/recovery_backend.py:456 msgid "Adding in base image" msgstr "" -#: ../Dell/recovery_backend.py:1034 +#: ../Dell/recovery_backend.py:903 msgid "Preparing nested image" msgstr "" -#: ../Dell/recovery_backend.py:1105 +#: ../Dell/recovery_backend.py:1000 msgid "Regenerating UUID / Rebuilding initramfs" msgstr "" -#: ../Dell/recovery_backend.py:1206 +#: ../Dell/recovery_backend.py:1126 msgid "Building ISO" msgstr "" @@ -231,10 +231,6 @@ msgid "System policy prohibits changing network without user consent" msgstr "" -#: ../gtk/dell-driver-installer.desktop.in.h:1 -msgid "Dell Driver Installer" -msgstr "" - #: ../gtk/recovery_media_creator.ui.h:1 msgid "Cancel Recovery Media Creator" msgstr "" @@ -342,39 +338,35 @@ msgstr "" #: ../gtk/builder.ui.h:16 -msgid "Install dpkg-repack" -msgstr "" - -#: ../gtk/builder.ui.h:17 msgid "" "Any add-on drivers or applications that need to be integrated into the image " "can be added here." msgstr "" -#: ../gtk/builder.ui.h:18 +#: ../gtk/builder.ui.h:17 msgid "" "The BTO FID framework is the first thing injected into a base vanilla " "image. If you are generating from an existing BTO compatible image, you may " "use the built-in framework." msgstr "" -#: ../gtk/builder.ui.h:19 +#: ../gtk/builder.ui.h:18 msgid "FID framework built into BTO image" msgstr "" -#: ../gtk/builder.ui.h:20 +#: ../gtk/builder.ui.h:19 msgid "FID Framework enclosed in debian package" msgstr "" -#: ../gtk/builder.ui.h:21 +#: ../gtk/builder.ui.h:20 msgid "Selected Overlay Details:" msgstr "" -#: ../gtk/builder.ui.h:22 +#: ../gtk/builder.ui.h:21 msgid "SRV Entry" msgstr "" -#: ../gtk/builder.ui.h:23 +#: ../gtk/builder.ui.h:22 msgid "Please enter the SRV to use:" msgstr "" @@ -396,20 +388,30 @@ msgstr "" #: ../gtk/tool_selector.ui.h:6 -msgid "Build OS Media" +msgid "" +"This will restore the system with Dell Hybrid Client to the factory shipped " +"state using the recovery partition stored on the hard drive." msgstr "" #: ../gtk/tool_selector.ui.h:7 -msgid "Restore System" +msgid "Build OS Media" msgstr "" #: ../gtk/tool_selector.ui.h:8 +msgid "Restore System" +msgstr "" + +#: ../gtk/tool_selector.ui.h:9 +msgid "Restore Dell Hybrid Client" +msgstr "" + +#: ../gtk/tool_selector.ui.h:10 msgid "" "This will install a Dell driver package that you downloaded from the " "Internet." msgstr "" -#: ../gtk/tool_selector.ui.h:9 +#: ../gtk/tool_selector.ui.h:11 msgid "Install Drivers" msgstr "" diff -Nru dell-recovery-1.63/README.md dell-recovery-1.64/README.md --- dell-recovery-1.63/README.md 2017-09-08 17:16:48.000000000 +0000 +++ dell-recovery-1.64/README.md 2020-03-24 13:35:55.000000000 +0000 @@ -8,32 +8,39 @@ In builder mode, the tool allows modifying the source of the base image, the source of the framework, as well as injection of additional content. +# Tool Modes + End User Mode --- When a customer receives a Dell machine that has been factory shipped -with Linux, there will be an icon in the unity program list to launch this -tool. They will only be asked what type of media they would like to create. +with Linux, there will be an icon available in GNOME shell to launch this +tool. They will be prompted for what type of media they would like to create. -OEM Config mode +Out of box experience mode --- -If a DVD burner or USB port is found on the machine, they will be offered -to create media in end user mode from OOBE (OEM Config) +If a DVD burner or USB port is found on the machine, customers will be offered +to create media at the end of the out of box experience. -Builder Mode +Media builder mode --- -In builder mode, the user will be offered a variety of options that allow them to create ISOs based upon different -snapshots of release upon standard Ubuntu media. +In builder mode, the user will be offered a variety of options that allow them to create ISOs based upon +different snapshots of release upon standard Ubuntu media. The latest information on how to use builder mode will be documented within the integrated help dialog. +# Flow + +Due to the nature of including a recovery partition, the installation flow varies from the standard Ubuntu +installation. +It is further documented [here](installation_flow.md). Ubiquity --- -Dell recovery is built with an integrated Ubiquity plugin. It is branched with each Ubuntu release and has code -that will tightly integrate with Ubiquity for factory installation. Documentation for all of the features -in Ubiquity mode and how to create packages to support it are stored outside of the dell-recovery tree. +Dell recovery is built with an integrated Ubiquity plugin. It is branched with each Ubuntu LTS release and +has code that will tightly integrate with Ubiquity for factory installation. Documentation for all of the +features in Ubiquity mode and how to create packages to support it are stored outside of the dell-recovery +tree. Modifying a factory image --- -Information about how to modify a factory image are available here: -https://github.com/dell/dell-recovery/blob/master/modifying_factory_image.md +Information about how to modify a factory image are available [here](modifying_factory_image.md). diff -Nru dell-recovery-1.63/ubiquity/dell-bootstrap.py dell-recovery-1.64/ubiquity/dell-bootstrap.py --- dell-recovery-1.63/ubiquity/dell-bootstrap.py 2019-10-15 15:44:02.000000000 +0000 +++ dell-recovery-1.64/ubiquity/dell-bootstrap.py 2020-03-24 13:35:55.000000000 +0000 @@ -92,10 +92,19 @@ """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 # ############ @@ -113,7 +122,7 @@ 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 @@ -131,6 +140,9 @@ 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) @@ -162,6 +174,15 @@ 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 @@ -176,6 +197,8 @@ """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: @@ -191,6 +214,16 @@ 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: @@ -199,6 +232,8 @@ 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": @@ -210,13 +245,16 @@ 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""" @@ -225,12 +263,14 @@ 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: @@ -253,6 +293,18 @@ #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 ## ## ## @@ -309,6 +361,7 @@ self.preseed_config = '' self.rp_builder = None self.disk_size = None + self.rec_type=None self.stage = 1 Plugin.__init__(self, frontend, db, ui) @@ -796,7 +849,7 @@ 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) @@ -813,7 +866,7 @@ try: # User recovery - need to copy RP - if rec_type == "automatic" or \ + if rec_type == "automatic" or rec_type == "dhc" or \ (rec_type == "factory" and self.stage == 1): if not (rec_type == "factory" and self.stage == 1): @@ -833,7 +886,9 @@ self.mem, self.efi, self.preseed_config, - size_thread) + size_thread, + self.rec_type) + self.rp_builder.rec_type=self.ui.get_type() self.rp_builder.exit = self.exit_ui_loops self.rp_builder.status = self.report_progress self.rp_builder.start() @@ -859,7 +914,7 @@ 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 == "interactive" or \ + if rec_type == "automatic" or rec_type == "dhc" or rec_type == "interactive" or \ ('UBIQUITY_DEBUG' in os.environ and 'UBIQUITY_ONLY' in os.environ): self.handle_exception(err) self.cancel_handler() @@ -888,7 +943,7 @@ ############################ class RPbuilder(Thread): """The recovery partition builder worker thread""" - def __init__(self, device, size, mem, efi, preseed_config, sizing_thread): + def __init__(self, device, size, mem, efi, preseed_config, sizing_thread, rec_type): self.device = device self.device_size = size self.mem = mem @@ -897,6 +952,7 @@ 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): @@ -998,6 +1054,12 @@ 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) @@ -1277,7 +1339,7 @@ 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"): + 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(): recovery_type = 'factory' #create 99_dell_recovery grub magic.create_grub_entries(self.target, recovery_type) diff -Nru dell-recovery-1.63/ubiquity/stepDellBootstrap.ui dell-recovery-1.64/ubiquity/stepDellBootstrap.ui --- dell-recovery-1.63/ubiquity/stepDellBootstrap.ui 2019-10-15 15:33:54.000000000 +0000 +++ dell-recovery-1.64/ubiquity/stepDellBootstrap.ui 2020-03-24 13:35:55.000000000 +0000 @@ -11,6 +11,9 @@ center dialog False + + + True @@ -63,9 +66,9 @@ True False - 0 <b>Runtime Details</b> True + 0 False @@ -77,8 +80,8 @@ True False - 0 version + 0 True @@ -90,8 +93,8 @@ True False - 0 mount + 0 True @@ -103,8 +106,8 @@ True False - 0 memory + 0 True @@ -211,11 +214,11 @@ True False - 0 - 0 This Dell Recovery Media can be used to restore the original factory software. True True + 0 + 0 False @@ -227,11 +230,11 @@ True False - 0 - 0 <b>It is recommended you back up all important data before running this tool.</b> True True + 0 + 0 False @@ -264,7 +267,7 @@ False - + True False 48 @@ -277,7 +280,7 @@ - + True False 5 @@ -300,7 +303,7 @@ - + True False 25 @@ -309,11 +312,11 @@ 600 True False - 0 - 0 This will rebuild all OS and swap partitions to factory defaults. True True + 0 + 0 @@ -324,7 +327,7 @@ - + True False 25 @@ -333,11 +336,11 @@ 600 True False - 0 - 0 <b>WARNING: </b>All personal files and changes will be lost. True True + 0 + 0 @@ -362,6 +365,142 @@ + + + + + True + False + + + True + False + 48 + distributor-logo + + + False + False + 0 + + + + + True + False + 5 + + + Install Dell Hybrid Client + False + True + True + False + 0.5 + True + automated_recovery + + + + False + False + 0 + + + + + True + False + 0 + 0 + 25 + + + True + False + False + hard_drive_liststore + + + + 2 + + + + + + + False + False + 1 + + + + + True + False + 25 + + + 600 + True + False + This will rebuild all recovery, and OS partitions. + True + True + 0 + 0 + + + + + False + False + 2 + + + + + True + False + 25 + + + 600 + True + False + <b>WARNING: </b>All personal files and changes will be lost. + True + True + 0 + 0 + + + + + False + False + 3 + + + + + + + + True + True + 1 + + + + + True + False + 2 + + + True False @@ -430,7 +569,7 @@ - + True False 25 @@ -439,11 +578,11 @@ 600 True False - 0 - 0 This will rebuild all recovery, and OS partitions. True True + 0 + 0 @@ -454,7 +593,7 @@ - + True False 25 @@ -463,11 +602,11 @@ 600 True False - 0 - 0 <b>WARNING: </b>All personal files and changes will be lost. True True + 0 + 0 @@ -488,7 +627,7 @@ True False - 1 + 3 @@ -496,7 +635,7 @@ True False - + True False 48 @@ -509,7 +648,7 @@ - + True False 5 @@ -533,7 +672,7 @@ - + True False 25 @@ -542,11 +681,11 @@ 600 True False - 0 - 0 e.g. Disk encryption, partitions resizing..etc. True True + 0 + 0 @@ -557,7 +696,7 @@ - + True False 25 @@ -566,11 +705,11 @@ 600 True False - 0 - 0 WARNING: No recovery feature included. True True + 0 + 0 @@ -591,7 +730,7 @@ True False - 2 + 4 @@ -607,14 +746,14 @@ True False - 3 + 5 False - + True False 48 @@ -630,10 +769,10 @@ True False - 0.05000000074505806 <b>ERROR:</b> This recovery media only functions on Dell or Alienware systems. True True + 0.05000000074505806 True @@ -645,7 +784,7 @@ True False - 4 + 6 @@ -656,11 +795,11 @@ True False - 0 - 0 <b>Building Recovery Partition</b> True True + 0 + 0 False @@ -672,11 +811,11 @@ True False - 0 - 0 <b>NOTE:</b> Please be patient, this may take a while. True True + 0 + 0 False @@ -688,11 +827,11 @@ True False - 0 - 0 Your system will restart automatically several times. True True + 0 + 0 True @@ -718,9 +857,21 @@ True False - 5 + 7 + + + + + + + + + + + + True @@ -729,14 +880,14 @@ - + True False 0 0 gnome-session-reboot - + True False 0 diff -Nru dell-recovery-1.63/.vscode/settings.json dell-recovery-1.64/.vscode/settings.json --- dell-recovery-1.63/.vscode/settings.json 1970-01-01 00:00:00.000000000 +0000 +++ dell-recovery-1.64/.vscode/settings.json 2019-10-03 03:53:46.000000000 +0000 @@ -0,0 +1,4 @@ +{ + "python.linting.enabled": true, + "python.linting.pylintEnabled": true +} \ No newline at end of file