diff -Nru dell-recovery-1.47/CHANGES dell-recovery-1.48/CHANGES --- dell-recovery-1.47/CHANGES 2016-04-13 16:31:53.000000000 +0000 +++ dell-recovery-1.48/CHANGES 2016-04-14 22:14:31.000000000 +0000 @@ -1,3 +1,16 @@ +dell-recovery (1.48) xenial; urgency=medium + + [ Shih-Yuan Lee ] + * Don't set BootNext for 'ubuntu' boot entry. (LP: #1564236) (#7) + + [ Kevin Rustin Wang ] + * Fix swap deleting not working properly + + [ Mario Limonciello ] + * cleanup whitespace + + -- Mario Limonciello Thu, 14 Apr 2016 17:14:09 -0500 + dell-recovery (1.47) xenial; urgency=medium [ Mario Limonciello ] diff -Nru dell-recovery-1.47/debian/changelog dell-recovery-1.48/debian/changelog --- dell-recovery-1.47/debian/changelog 2016-04-13 16:31:53.000000000 +0000 +++ dell-recovery-1.48/debian/changelog 2016-04-14 22:14:31.000000000 +0000 @@ -1,3 +1,16 @@ +dell-recovery (1.48) xenial; urgency=medium + + [ Shih-Yuan Lee ] + * Don't set BootNext for 'ubuntu' boot entry. (LP: #1564236) (#7) + + [ Kevin Rustin Wang ] + * Fix swap deleting not working properly + + [ Mario Limonciello ] + * cleanup whitespace + + -- Mario Limonciello Thu, 14 Apr 2016 17:14:09 -0500 + dell-recovery (1.47) xenial; urgency=medium [ Mario Limonciello ] diff -Nru dell-recovery-1.47/po/dell-recovery.pot dell-recovery-1.48/po/dell-recovery.pot --- dell-recovery-1.47/po/dell-recovery.pot 2016-04-13 22:13:29.000000000 +0000 +++ dell-recovery-1.48/po/dell-recovery.pot 2016-04-14 22:14:43.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-04-13 17:13-0500\n" +"POT-Creation-Date: 2016-04-14 17:14-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff -Nru dell-recovery-1.47/ubiquity/dell-bootstrap.py dell-recovery-1.48/ubiquity/dell-bootstrap.py --- dell-recovery-1.47/ubiquity/dell-bootstrap.py 2016-04-11 20:38:39.000000000 +0000 +++ dell-recovery-1.48/ubiquity/dell-bootstrap.py 2016-04-14 22:13:51.000000000 +0000 @@ -433,7 +433,7 @@ #on small disks or big mem, don't look for extended or delete swap. swap_part = EFI_SWAP_PARTITION os_part = EFI_OS_PARTITION - + # check dual boot or not try: if self.db.get('dell-recovery/dual_boot')=='true': @@ -442,45 +442,38 @@ os_part,swap_part = self.dual_partition_num(os_label) except debconf.DebconfError as err: self.log(str(err)) - + if self.test_swap(): - swap_part = '' + swap_part = '' #remove extras for number in (os_part,swap_part): if number.isdigit(): remove = misc.execute_root('parted', '-s', self.device, 'rm', number) if remove is False: self.log("Error removing partition number: %s on %s (this may be normal)'" % (number, self.device)) - #refresh = misc.execute_root('partx', '-d', '--nr', number, self.device) - #if refresh is False: - #self.log("Error updating partition %s for kernel device %s (this may be normal)'" % (number, self.device)) - - def dual_partition_num(self,label): + refresh = misc.execute_root('partx', '-d', '--nr', number, self.device) + if refresh is False: + self.log("Error updating partition %s for kernel device %s (this may be normal)'" % (number, self.device)) + + def dual_partition_num(self,label): #remove UBUNTU patition for dual boot ##OS num + os_part = '' + swap_part = '' digits = re.compile('\d+') try: - os_path = magic.fetch_output(['readlink','/dev/disk/by-label/'+label]).split('\n') + os_path = magic.fetch_output(['readlink','/dev/disk/by-label/'+label]).split('\n') except Exception as err: self.log('os_path command is executed failed, the error is %s'%str(err)) - + os_part = digits.search(os_path[0].split('/')[-1]).group() - ## if found OS partition num , restore it into debconf for install use - if os_part: - try: - self.db.set('dell-recovery/os_partition',self.device+os_part) - except debconf.DebconfError as err: - self.log(str(err)) - else: - os_part = EFI_OS_PARTITION - ##swap num - swap_part = EFI_SWAP_PARTITION + with misc.raised_privileges(): partitions = magic.fetch_output(['parted','-s',self.device,'print']).split('\n') for line in partitions: - if 'swap' in line: - swap_part = line.split()[0] - + if 'linux-swap' in line: + swap_part = line.split()[0] + return os_part,swap_part def explode_sdr(self): @@ -830,15 +823,6 @@ self.handle_exception(err) self.cancel_handler() - # Always put 'ubuntu' in BootNext if any - with misc.raised_privileges(): - bootmgr_output = magic.fetch_output(['efibootmgr', '-v']).split('\n') - for line in bootmgr_output: - bootnum = '' - if line.startswith('Boot') and 'ubuntu' in line: - bootnum = line.split('Boot')[1].replace('*', '').split()[0] - misc.execute_root('efibootmgr', '-n', bootnum) - return (['/usr/share/ubiquity/dell-bootstrap'], [RECOVERY_TYPE_QUESTION]) def ok_handler(self): @@ -1154,15 +1138,6 @@ if add is False: raise RuntimeError("Error adding efi entry to %s%s" % (self.device, esp_part)) - #find new entry and put it in BootNext - with misc.raised_privileges(): - bootmgr_output = magic.fetch_output(['efibootmgr', '-v']).split('\n') - for line in bootmgr_output: - bootnum = '' - if line.startswith('Boot') and 'ubuntu' in line: - bootnum = line.split('Boot')[1].replace('*', '').split()[0] - misc.execute_root('efibootmgr', '-v', '-n', bootnum) - ##clean up ESP mount misc.execute_root('umount', '/mnt/efi') @@ -1330,15 +1305,7 @@ self.progress = progress rec_part = magic.find_partition() - - #Determine if we label partition when dual boot - try: - if progress.get('dell-recovery/dual_boot')=='true': - num = progress.get('dell-recovery/os_partition') - misc.execute_root('e2label',num,'UBUNTU') - except Exception: - pass - + from ubiquity import install_misc to_install = [] to_remove = []