Merge ~brian-murray/ubiquity:remove-apt-clone into ubiquity:master

Proposed by Brian Murray
Status: Merged
Merged at revision: b2da79fa7388697923cabf44c9d4da99f517da41
Proposed branch: ~brian-murray/ubiquity:remove-apt-clone
Merge into: ubiquity:master
Diff against target: 259 lines (+19/-116) (has conflicts)
7 files modified
debian/changelog (+8/-0)
debian/control (+0/-1)
debian/ubiquity.templates (+10/-1)
dev/null (+0/-70)
gui/gtk/stepPartAsk.ui (+1/-1)
partman/finish.d/_numbers (+0/-1)
scripts/plugininstall.py (+0/-42)
Conflict in debian/changelog
Conflict in debian/ubiquity.templates
Reviewer Review Type Date Requested Status
Brian Murray (community) Needs Resubmitting
Jean-Baptiste Lallement Needs Fixing
Michael Hudson-Doyle Approve
Review via email: mp+390185@code.launchpad.net

Description of the change

This removes the feature "keep installed software" when reinstalling Ubuntu as it is broken and has been for quite a long time. Additionally, even were it to work it would likely only keep a small subset of software the user has installed and subsequently would provide a bad user experience.

I'm sure I got everything but it's possible I may have removed too much so take a careful look.

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

This looks good, it seems to me that you've removed enough but not too much. Two little comments.

(I haven't tested this btw)

review: Approve
Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for the feedback. I'll make one of the changes you suggested. Incidentally, how could I go about testing my ubiquity changes?

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

> Thanks for the feedback. I'll make one of the changes you suggested.

Thanks. Your comments make sense to me.

> Incidentally, how could I go about testing my ubiquity changes?

The usual way I do it is build my branch into debs (locally or in a ppa), boot into "try mode", install the new debs, then run ubiquity (or "ubiquity --debug") in a terminal.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I built the package and tested your patch. Nothing to report. Reinstallation as described in the bug attached works fine.

Regarding the MP, there is just one update missing in ubiquity.templates cf comments inline.

review: Needs Fixing
Revision history for this message
Brian Murray (brian-murray) wrote :

> I built the package and tested your patch. Nothing to report. Reinstallation
> as described in the bug attached works fine.
>
> Regarding the MP, there is just one update missing in ubiquity.templates cf
> comments inline.

Thanks for testing this, I've updated ubiquity.templates.

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 739798c..828aa0c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,18 @@
1ubiquity (20.10.10) UNRELEASED; urgency=medium1ubiquity (20.10.10) UNRELEASED; urgency=medium
22
3<<<<<<< debian/changelog
3 [ Didier Roche ]4 [ Didier Roche ]
4 [ Jean-Baptiste Lallement ]5 [ Jean-Baptiste Lallement ]
5 * AD integration for GTK UI.6 * AD integration for GTK UI.
67
7 -- Jean-Baptiste Lallement <jean-baptiste.lallement@ubuntu.com> Tue, 25 Aug 2020 10:06:29 +02008 -- Jean-Baptiste Lallement <jean-baptiste.lallement@ubuntu.com> Tue, 25 Aug 2020 10:06:29 +0200
9=======
10 * Do not try to keep installed software when reinstalling Ubuntu as the
11 process was error prone (LP: 1152399) and did not provide a quailty
12 experience. (LP: #1798369)
13
14 -- Brian Murray <brian@ubuntu.com> Wed, 02 Sep 2020 11:39:49 -0700
15>>>>>>> debian/changelog
816
9ubiquity (20.10.9) groovy; urgency=medium17ubiquity (20.10.9) groovy; urgency=medium
1018
diff --git a/debian/control b/debian/control
index 4c9c8dc..50f4599 100644
--- a/debian/control
+++ b/debian/control
@@ -77,7 +77,6 @@ Vcs-Browser: https://code.launchpad.net/~ubuntu-installer/ubiquity/+git/ubiquity
77Package: ubiquity77Package: ubiquity
78Architecture: any78Architecture: any
79Depends: adduser,79Depends: adduser,
80 apt-clone,
81 cryptsetup,80 cryptsetup,
82 dbus-x11,81 dbus-x11,
83 dpkg-repack,82 dpkg-repack,
diff --git a/debian/ubiquity.templates b/debian/ubiquity.templates
index eb6d724..248716a 100644
--- a/debian/ubiquity.templates
+++ b/debian/ubiquity.templates
@@ -656,6 +656,7 @@ Template: ubiquity/install/bootloader
656Type: text656Type: text
657_Description: Configuring boot loader...657_Description: Configuring boot loader...
658658
659<<<<<<< debian/ubiquity.templates
659Template: ubiquity/install/activedirectory660Template: ubiquity/install/activedirectory
660Type: text661Type: text
661_Description: Configuring Active Directory...662_Description: Configuring Active Directory...
@@ -668,6 +669,8 @@ Template: ubiquity/install/apt_clone_restore
668Type: text669Type: text
669_Description: Restoring previously installed packages...670_Description: Restoring previously installed packages...
670671
672=======
673>>>>>>> debian/ubiquity.templates
671Template: ubiquity/install/installing674Template: ubiquity/install/installing
672Type: text675Type: text
673_Description: Installing additional packages...676_Description: Installing additional packages...
@@ -767,6 +770,7 @@ _Description: Error copying bluetooth configuration
767 continue, but the bluetooth configuration will have to be set up again in the770 continue, but the bluetooth configuration will have to be set up again in the
768 installed system.771 installed system.
769772
773<<<<<<< debian/ubiquity.templates
770Template: ubiquity/install/broken_apt_clone774Template: ubiquity/install/broken_apt_clone
771Type: error775Type: error
772_Description: Error restoring installed applications776_Description: Error restoring installed applications
@@ -782,6 +786,8 @@ _Description: Error configuring connection to Active Directory
782 <a href="https://discourse.ubuntu.com/t/service-sssd/11579">ubuntu.com/activedirectory</a>786 <a href="https://discourse.ubuntu.com/t/service-sssd/11579">ubuntu.com/activedirectory</a>
783 for help.787 for help.
784788
789=======
790>>>>>>> debian/ubiquity.templates
785Template: ubiquity/install/md5_check791Template: ubiquity/install/md5_check
786Type: boolean792Type: boolean
787Default: true793Default: true
@@ -1397,7 +1403,7 @@ Type: text
1397# CURDISTRO is a variable substituted into this string, and may be 'Ubuntu 10.10'1403# CURDISTRO is a variable substituted into this string, and may be 'Ubuntu 10.10'
1398_Description: Reinstall ${CURDISTRO}1404_Description: Reinstall ${CURDISTRO}
1399 Documents, music, and other personal files will be kept. Installed software1405 Documents, music, and other personal files will be kept. Installed software
1400 will be kept where possible. System-wide settings will be cleared.1406 and system-wide settings will be cleared.
14011407
1402Template: ubiquity/partitioner/multiple_os_format1408Template: ubiquity/partitioner/multiple_os_format
1403Type: text1409Type: text
@@ -1650,6 +1656,7 @@ _Description:
1650Template: ubiquity/zfs_keystore_key1656Template: ubiquity/zfs_keystore_key
1651Type: password1657Type: password
1652_Description: Key to secure the keystore on ZFS installations1658_Description: Key to secure the keystore on ZFS installations
1659<<<<<<< debian/ubiquity.templates
16531660
1654Template: ubiquity/login_use_directory1661Template: ubiquity/login_use_directory
1655Type: text1662Type: text
@@ -1718,3 +1725,5 @@ _Description: That name already exists on the network.
1718Template: ubiquity/text/domain_connection_error1725Template: ubiquity/text/domain_connection_error
1719Type: text1726Type: text
1720_Description: Failed to connect to domain.1727_Description: Failed to connect to domain.
1728=======
1729>>>>>>> debian/ubiquity.templates
diff --git a/gui/gtk/stepPartAsk.ui b/gui/gtk/stepPartAsk.ui
index 01b70e6..8159d06 100644
--- a/gui/gtk/stepPartAsk.ui
+++ b/gui/gtk/stepPartAsk.ui
@@ -207,7 +207,7 @@
207 <property name="margin_left">24</property>207 <property name="margin_left">24</property>
208 <property name="xalign">0</property>208 <property name="xalign">0</property>
209 <property name="yalign">0</property>209 <property name="yalign">0</property>
210 <property name="label" translatable="yes">&lt;span size="small"&gt;Documents, music, and other personal files will be kept. Installed software will be kept where possible. System-wide settings will be cleared.&lt;/span&gt;</property>210 <property name="label" translatable="yes">&lt;span size="small"&gt;Documents, music, and other personal files will be kept. Installed software and system-wide settings will be cleared.&lt;/span&gt;</property>
211 <property name="use_markup">True</property>211 <property name="use_markup">True</property>
212 <property name="wrap">True</property>212 <property name="wrap">True</property>
213 </object>213 </object>
diff --git a/partman/finish.d/_numbers b/partman/finish.d/_numbers
index 4ea14a2..6b9ef8a 100644
--- a/partman/finish.d/_numbers
+++ b/partman/finish.d/_numbers
@@ -1,2 +1 @@
101 apt_clone_save
201 remove_os_prober_cache101 remove_os_prober_cache
diff --git a/partman/finish.d/apt_clone_save b/partman/finish.d/apt_clone_save
3deleted file mode 1007552deleted file mode 100755
index bca5e3d..0000000
--- a/partman/finish.d/apt_clone_save
+++ /dev/null
@@ -1,70 +0,0 @@
1#!/bin/sh
2set -e
3
4. /lib/partman/lib/base.sh
5
6mountpoint="$(mktemp -d)"
7root=
8var=
9
10fail () {
11 if [ -n "$var" ] && [ -e "$mountpoint/var" ]; then
12 umount "$mountpoint/var" || true
13 fi
14 if [ -e "$mountpoint" ]; then
15 umount "$mountpoint" && rmdir "$mountpoint" || true
16 fi
17 db_progress STOP
18 # TODO input an error question.
19 exit 1
20}
21
22for dev in $DEVICES/*; do
23 [ -d "$dev" ] || continue
24 cd $dev
25 open_dialog PARTITIONS
26 while { read_line num id size type fs path name; [ "$id" ]; }; do
27 [ -f "$id/method" ] || continue
28 [ -f "$id/use_filesystem" ] || continue
29 [ -f "$id/mountpoint" ] || continue
30 [ "$fs" != free ] || continue
31 [ -f "$id/format" ] && continue
32 [ -f "$id/formatted" ] && continue
33 if [ "$(cat "$id/mountpoint")" = "/" ]; then
34 root="$path"
35 elif [ "$(cat "$id/mountpoint")" = "/var" ]; then
36 var="$path"
37 fi
38 done
39 close_dialog
40done
41
42if [ -z "$root" ]; then
43 # The partition is going to be formatted; there's nothing to preserve.
44 exit 0
45fi
46
47db_progress START 0 1 ubiquity/install/title
48db_progress INFO ubiquity/install/apt_clone_save
49
50mount "$root" "$mountpoint"
51[ -n "$var" ] && mount "$var" "$mountpoint/var"
52
53working="$mountpoint/ubiquity-apt-clone"
54
55mkdir -p "$working"
56if ! apt-clone clone --with-dpkg-repack --source "$mountpoint" "$working"; then
57 # TODO: if the above fails, ask a debconf error question.
58 fail
59fi
60
61db_progress STEP 1
62
63if [ -n "$var" ] && [ -e "$mountpoint/var" ]; then
64 umount "$mountpoint/var" || true
65fi
66if [ -e "$mountpoint" ]; then
67 umount "$mountpoint" && rmdir "$mountpoint" || true
68fi
69
70db_progress STOP
diff --git a/scripts/plugininstall.py b/scripts/plugininstall.py
index 434fd3b..48e7491 100755
--- a/scripts/plugininstall.py
+++ b/scripts/plugininstall.py
@@ -251,17 +251,6 @@ class Install(install_misc.InstallBase):
251 if 'UBIQUITY_OEM_USER_CONFIG' not in os.environ:251 if 'UBIQUITY_OEM_USER_CONFIG' not in os.environ:
252 self.install_restricted_extras()252 self.install_restricted_extras()
253253
254 self.db.progress('INFO', 'ubiquity/install/apt_clone_restore')
255 try:
256 self.apt_clone_restore()
257 except Exception:
258 syslog.syslog(
259 syslog.LOG_WARNING,
260 'Could not restore packages from the previous install:')
261 for line in traceback.format_exc().split('\n'):
262 syslog.syslog(syslog.LOG_WARNING, line)
263 self.db.input('critical', 'ubiquity/install/broken_apt_clone')
264 self.db.go()
265 try:254 try:
266 self.copy_network_config()255 self.copy_network_config()
267 except Exception:256 except Exception:
@@ -1579,31 +1568,6 @@ class Install(install_misc.InstallBase):
1579 for line in installed:1568 for line in installed:
1580 print(line, file=fp)1569 print(line, file=fp)
15811570
1582 def apt_clone_restore(self):
1583 if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
1584 return
1585 import lsb_release
1586 working = self.target_file('ubiquity-apt-clone')
1587 working = os.path.join(working,
1588 'apt-clone-state-%s.tar.gz' % os.uname()[1])
1589 codename = lsb_release.get_distro_information()['CODENAME']
1590 if not os.path.exists(working):
1591 return
1592 install_misc.chroot_setup(self.target)
1593 binds = ("/proc", "/sys", "/dev", "/run")
1594 try:
1595 for bind in binds:
1596 misc.execute('mount', '--bind', bind, self.target + bind)
1597 restore_cmd = [
1598 'apt-clone', 'restore-new-distro',
1599 working, codename, '--destination', self.target]
1600 subprocess.check_call(
1601 restore_cmd, preexec_fn=install_misc.debconf_disconnect)
1602 finally:
1603 install_misc.chroot_cleanup(self.target)
1604 for bind in binds:
1605 misc.execute('umount', '-f', self.target + bind)
1606
1607 def copy_network_config(self):1571 def copy_network_config(self):
1608 if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:1572 if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
1609 return1573 return
@@ -1774,12 +1738,6 @@ class Install(install_misc.InstallBase):
1774 print(oem_id, file=oem_id_file)1738 print(oem_id, file=oem_id_file)
1775 except (debconf.DebconfError, IOError):1739 except (debconf.DebconfError, IOError):
1776 pass1740 pass
1777 try:
1778 path = self.target_file('ubiquity-apt-clone')
1779 if os.path.exists(path):
1780 shutil.move(path, self.target_file('var/log/installer'))
1781 except IOError:
1782 pass
17831741
1784 def save_random_seed(self):1742 def save_random_seed(self):
1785 """Save random seed to the target system.1743 """Save random seed to the target system.

Subscribers

People subscribed via source and target branches