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
1diff --git a/debian/changelog b/debian/changelog
2index 739798c..828aa0c 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,10 +1,18 @@
6 ubiquity (20.10.10) UNRELEASED; urgency=medium
7
8+<<<<<<< debian/changelog
9 [ Didier Roche ]
10 [ Jean-Baptiste Lallement ]
11 * AD integration for GTK UI.
12
13 -- Jean-Baptiste Lallement <jean-baptiste.lallement@ubuntu.com> Tue, 25 Aug 2020 10:06:29 +0200
14+=======
15+ * Do not try to keep installed software when reinstalling Ubuntu as the
16+ process was error prone (LP: 1152399) and did not provide a quailty
17+ experience. (LP: #1798369)
18+
19+ -- Brian Murray <brian@ubuntu.com> Wed, 02 Sep 2020 11:39:49 -0700
20+>>>>>>> debian/changelog
21
22 ubiquity (20.10.9) groovy; urgency=medium
23
24diff --git a/debian/control b/debian/control
25index 4c9c8dc..50f4599 100644
26--- a/debian/control
27+++ b/debian/control
28@@ -77,7 +77,6 @@ Vcs-Browser: https://code.launchpad.net/~ubuntu-installer/ubiquity/+git/ubiquity
29 Package: ubiquity
30 Architecture: any
31 Depends: adduser,
32- apt-clone,
33 cryptsetup,
34 dbus-x11,
35 dpkg-repack,
36diff --git a/debian/ubiquity.templates b/debian/ubiquity.templates
37index eb6d724..248716a 100644
38--- a/debian/ubiquity.templates
39+++ b/debian/ubiquity.templates
40@@ -656,6 +656,7 @@ Template: ubiquity/install/bootloader
41 Type: text
42 _Description: Configuring boot loader...
43
44+<<<<<<< debian/ubiquity.templates
45 Template: ubiquity/install/activedirectory
46 Type: text
47 _Description: Configuring Active Directory...
48@@ -668,6 +669,8 @@ Template: ubiquity/install/apt_clone_restore
49 Type: text
50 _Description: Restoring previously installed packages...
51
52+=======
53+>>>>>>> debian/ubiquity.templates
54 Template: ubiquity/install/installing
55 Type: text
56 _Description: Installing additional packages...
57@@ -767,6 +770,7 @@ _Description: Error copying bluetooth configuration
58 continue, but the bluetooth configuration will have to be set up again in the
59 installed system.
60
61+<<<<<<< debian/ubiquity.templates
62 Template: ubiquity/install/broken_apt_clone
63 Type: error
64 _Description: Error restoring installed applications
65@@ -782,6 +786,8 @@ _Description: Error configuring connection to Active Directory
66 <a href="https://discourse.ubuntu.com/t/service-sssd/11579">ubuntu.com/activedirectory</a>
67 for help.
68
69+=======
70+>>>>>>> debian/ubiquity.templates
71 Template: ubiquity/install/md5_check
72 Type: boolean
73 Default: true
74@@ -1397,7 +1403,7 @@ Type: text
75 # CURDISTRO is a variable substituted into this string, and may be 'Ubuntu 10.10'
76 _Description: Reinstall ${CURDISTRO}
77 Documents, music, and other personal files will be kept. Installed software
78- will be kept where possible. System-wide settings will be cleared.
79+ and system-wide settings will be cleared.
80
81 Template: ubiquity/partitioner/multiple_os_format
82 Type: text
83@@ -1650,6 +1656,7 @@ _Description:
84 Template: ubiquity/zfs_keystore_key
85 Type: password
86 _Description: Key to secure the keystore on ZFS installations
87+<<<<<<< debian/ubiquity.templates
88
89 Template: ubiquity/login_use_directory
90 Type: text
91@@ -1718,3 +1725,5 @@ _Description: That name already exists on the network.
92 Template: ubiquity/text/domain_connection_error
93 Type: text
94 _Description: Failed to connect to domain.
95+=======
96+>>>>>>> debian/ubiquity.templates
97diff --git a/gui/gtk/stepPartAsk.ui b/gui/gtk/stepPartAsk.ui
98index 01b70e6..8159d06 100644
99--- a/gui/gtk/stepPartAsk.ui
100+++ b/gui/gtk/stepPartAsk.ui
101@@ -207,7 +207,7 @@
102 <property name="margin_left">24</property>
103 <property name="xalign">0</property>
104 <property name="yalign">0</property>
105- <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>
106+ <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>
107 <property name="use_markup">True</property>
108 <property name="wrap">True</property>
109 </object>
110diff --git a/partman/finish.d/_numbers b/partman/finish.d/_numbers
111index 4ea14a2..6b9ef8a 100644
112--- a/partman/finish.d/_numbers
113+++ b/partman/finish.d/_numbers
114@@ -1,2 +1 @@
115-01 apt_clone_save
116 01 remove_os_prober_cache
117diff --git a/partman/finish.d/apt_clone_save b/partman/finish.d/apt_clone_save
118deleted file mode 100755
119index bca5e3d..0000000
120--- a/partman/finish.d/apt_clone_save
121+++ /dev/null
122@@ -1,70 +0,0 @@
123-#!/bin/sh
124-set -e
125-
126-. /lib/partman/lib/base.sh
127-
128-mountpoint="$(mktemp -d)"
129-root=
130-var=
131-
132-fail () {
133- if [ -n "$var" ] && [ -e "$mountpoint/var" ]; then
134- umount "$mountpoint/var" || true
135- fi
136- if [ -e "$mountpoint" ]; then
137- umount "$mountpoint" && rmdir "$mountpoint" || true
138- fi
139- db_progress STOP
140- # TODO input an error question.
141- exit 1
142-}
143-
144-for dev in $DEVICES/*; do
145- [ -d "$dev" ] || continue
146- cd $dev
147- open_dialog PARTITIONS
148- while { read_line num id size type fs path name; [ "$id" ]; }; do
149- [ -f "$id/method" ] || continue
150- [ -f "$id/use_filesystem" ] || continue
151- [ -f "$id/mountpoint" ] || continue
152- [ "$fs" != free ] || continue
153- [ -f "$id/format" ] && continue
154- [ -f "$id/formatted" ] && continue
155- if [ "$(cat "$id/mountpoint")" = "/" ]; then
156- root="$path"
157- elif [ "$(cat "$id/mountpoint")" = "/var" ]; then
158- var="$path"
159- fi
160- done
161- close_dialog
162-done
163-
164-if [ -z "$root" ]; then
165- # The partition is going to be formatted; there's nothing to preserve.
166- exit 0
167-fi
168-
169-db_progress START 0 1 ubiquity/install/title
170-db_progress INFO ubiquity/install/apt_clone_save
171-
172-mount "$root" "$mountpoint"
173-[ -n "$var" ] && mount "$var" "$mountpoint/var"
174-
175-working="$mountpoint/ubiquity-apt-clone"
176-
177-mkdir -p "$working"
178-if ! apt-clone clone --with-dpkg-repack --source "$mountpoint" "$working"; then
179- # TODO: if the above fails, ask a debconf error question.
180- fail
181-fi
182-
183-db_progress STEP 1
184-
185-if [ -n "$var" ] && [ -e "$mountpoint/var" ]; then
186- umount "$mountpoint/var" || true
187-fi
188-if [ -e "$mountpoint" ]; then
189- umount "$mountpoint" && rmdir "$mountpoint" || true
190-fi
191-
192-db_progress STOP
193diff --git a/scripts/plugininstall.py b/scripts/plugininstall.py
194index 434fd3b..48e7491 100755
195--- a/scripts/plugininstall.py
196+++ b/scripts/plugininstall.py
197@@ -251,17 +251,6 @@ class Install(install_misc.InstallBase):
198 if 'UBIQUITY_OEM_USER_CONFIG' not in os.environ:
199 self.install_restricted_extras()
200
201- self.db.progress('INFO', 'ubiquity/install/apt_clone_restore')
202- try:
203- self.apt_clone_restore()
204- except Exception:
205- syslog.syslog(
206- syslog.LOG_WARNING,
207- 'Could not restore packages from the previous install:')
208- for line in traceback.format_exc().split('\n'):
209- syslog.syslog(syslog.LOG_WARNING, line)
210- self.db.input('critical', 'ubiquity/install/broken_apt_clone')
211- self.db.go()
212 try:
213 self.copy_network_config()
214 except Exception:
215@@ -1579,31 +1568,6 @@ class Install(install_misc.InstallBase):
216 for line in installed:
217 print(line, file=fp)
218
219- def apt_clone_restore(self):
220- if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
221- return
222- import lsb_release
223- working = self.target_file('ubiquity-apt-clone')
224- working = os.path.join(working,
225- 'apt-clone-state-%s.tar.gz' % os.uname()[1])
226- codename = lsb_release.get_distro_information()['CODENAME']
227- if not os.path.exists(working):
228- return
229- install_misc.chroot_setup(self.target)
230- binds = ("/proc", "/sys", "/dev", "/run")
231- try:
232- for bind in binds:
233- misc.execute('mount', '--bind', bind, self.target + bind)
234- restore_cmd = [
235- 'apt-clone', 'restore-new-distro',
236- working, codename, '--destination', self.target]
237- subprocess.check_call(
238- restore_cmd, preexec_fn=install_misc.debconf_disconnect)
239- finally:
240- install_misc.chroot_cleanup(self.target)
241- for bind in binds:
242- misc.execute('umount', '-f', self.target + bind)
243-
244 def copy_network_config(self):
245 if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
246 return
247@@ -1774,12 +1738,6 @@ class Install(install_misc.InstallBase):
248 print(oem_id, file=oem_id_file)
249 except (debconf.DebconfError, IOError):
250 pass
251- try:
252- path = self.target_file('ubiquity-apt-clone')
253- if os.path.exists(path):
254- shutil.move(path, self.target_file('var/log/installer'))
255- except IOError:
256- pass
257
258 def save_random_seed(self):
259 """Save random seed to the target system.

Subscribers

People subscribed via source and target branches