Merge lp:~cyphermox/ubiquity/crypto-not-preseed into lp:ubiquity

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: 6264
Merged at revision: 6262
Proposed branch: lp:~cyphermox/ubiquity/crypto-not-preseed
Merge into: lp:ubiquity
Diff against target: 178 lines (+61/-26)
3 files modified
d-i/manifest (+3/-3)
debian/changelog (+10/-0)
ubiquity/plugins/ubi-partman.py (+48/-23)
To merge this branch: bzr merge lp:~cyphermox/ubiquity/crypto-not-preseed
Reviewer Review Type Date Requested Status
Barry Warsaw (community) Approve
Ubuntu Installer Team Pending
Review via email: mp+248609@code.launchpad.net

Description of the change

+ * ubiquity/plugins/ubi-partman.py: allow prompting for a missing passphrase
+ on preseeded installs, if they are requesting to setup crypto.
+ (LP: #1386131)

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

LGTM, though I admit to not being totally familiar with the code. See my inline comments though.

review: Approve
Revision history for this message
VEG (veg) wrote :

Please remove me from subscribers list of this ticket. I don't know how I got here. I haven't used this account for years, and suddenly I've started to receive many notifications from this ticket.
I can't unsubscribe by myself because there is no edit button http://veg.by/z/2015-02-05-00-59-52.png
Thanks.

Revision history for this message
VEG (veg) wrote :

I've found how to remove myself from subscribers list.
It's strange that I've been subscribed. I've even don't know what is “ubiquity” :)
Sorry to bother you.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'd-i/manifest'
2--- d-i/manifest 2015-01-28 19:33:47 +0000
3+++ d-i/manifest 2015-02-04 18:50:56 +0000
4@@ -6,12 +6,12 @@
5 console-setup 1.70ubuntu11
6 debian-installer-utils 1.109ubuntu1
7 flash-kernel 3.0~rc.4ubuntu53
8-grub-installer 1.78ubuntu23
9+grub-installer 1.78ubuntu24
10 hw-detect 1.95ubuntu4
11 localechooser 2.49ubuntu5
12 netcfg 1.119ubuntu2
13 partconf 1.46
14-partman-auto 118ubuntu3
15+partman-auto 118ubuntu5
16 partman-auto-crypto 22ubuntu1
17 partman-auto-loop 0ubuntu21
18 partman-auto-lvm 56ubuntu1
19@@ -20,7 +20,7 @@
20 partman-basicmethods 58
21 partman-btrfs 14ubuntu2
22 partman-crypto 78ubuntu1
23-partman-efi 25ubuntu7
24+partman-efi 62ubuntu1
25 partman-ext3 84ubuntu1
26 partman-jfs 45
27 partman-lvm 105
28
29=== modified file 'debian/changelog'
30--- debian/changelog 2015-02-02 23:50:45 +0000
31+++ debian/changelog 2015-02-04 18:50:56 +0000
32@@ -1,3 +1,13 @@
33+ubiquity (2.21.8) UNRELEASED; urgency=medium
34+
35+ * Automatic update of included source packages: grub-installer
36+ 1.78ubuntu24, partman-auto 118ubuntu5, partman-efi 62ubuntu1.
37+ * ubiquity/plugins/ubi-partman.py: allow prompting for a missing passphrase
38+ on preseeded installs, if they are requesting to setup crypto.
39+ (LP: #1386131)
40+
41+ -- Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com> Wed, 04 Feb 2015 10:45:32 -0500
42+
43 ubiquity (2.21.7) vivid; urgency=medium
44
45 * bin/ubiquity-dm: update to use the proper gsettings keys for the MATE
46
47=== modified file 'ubiquity/plugins/ubi-partman.py'
48--- ubiquity/plugins/ubi-partman.py 2015-01-23 12:18:37 +0000
49+++ ubiquity/plugins/ubi-partman.py 2015-02-04 18:50:56 +0000
50@@ -65,6 +65,9 @@
51 def __init__(self, *args, **kwargs):
52 plugin.PluginUI.__init__(self)
53
54+ def update_branded_strings(self):
55+ pass
56+
57 def show_page_advanced(self):
58 pass
59
60@@ -100,6 +103,9 @@
61 def get_grub_choice(self):
62 return misc.grub_default()
63
64+ def show_crypto_page(self):
65+ pass
66+
67 def get_crypto_keys(self):
68 pass
69
70@@ -200,6 +206,21 @@
71 # Define a list to save grub imformation
72 self.grub_options = []
73
74+ def update_branded_strings(self):
75+ release = misc.get_release()
76+
77+ crypto_desc_obj = getattr(self, 'crypto_description_2')
78+ text = self.controller.get_string(
79+ 'ubiquity/text/crypto_description_2')
80+ text = text.replace('${RELEASE}', release.name)
81+ crypto_desc_obj.set_label(text)
82+
83+ lvm_explanation_obj = getattr(self, 'partition_lvm_explanation')
84+ text = self.controller.get_string(
85+ 'ubiquity/text/partition_lvm_explanation')
86+ text = text.replace('${RELEASE}', release.name)
87+ lvm_explanation_obj.set_label(text)
88+
89 def plugin_get_current_page(self):
90 if self.current_page == self.page_ask:
91 self.plugin_is_install = self.part_ask_option_is_install()
92@@ -300,15 +321,8 @@
93 # TODO dmitrij.ledkov 2012-07-25 no way to go back and return
94 # to here? This needs to be addressed in the design document.
95 if crypto and use_device and self.current_page == self.page_ask:
96- self.set_page_title(
97- self.controller.get_string('ubiquity/text/crypto_label'))
98- self.current_page = self.page_crypto
99- self.move_crypto_widgets()
100- self.show_encryption_passphrase(crypto)
101- self.controller.go_to_page(self.current_page)
102- self.controller.toggle_next_button('install_button')
103+ self.show_crypto_page()
104 self.plugin_is_install = one_disk
105- self.info_loop(None)
106 return True
107
108 if (self.current_page == self.page_crypto and
109@@ -634,18 +648,6 @@
110 desc = self.controller.get_string('ubiquity/text/use_lvm_desc')
111 options['some_device_lvm'] = PartitioningOption(title, desc)
112
113- crypto_desc_obj = getattr(self, 'crypto_description_2')
114- text = self.controller.get_string(
115- 'ubiquity/text/crypto_description_2')
116- text = text.replace('${RELEASE}', release.name)
117- crypto_desc_obj.set_label(text)
118-
119- lvm_explanation_obj = getattr(self, 'partition_lvm_explanation')
120- text = self.controller.get_string(
121- 'ubiquity/text/partition_lvm_explanation')
122- text = text.replace('${RELEASE}', release.name)
123- lvm_explanation_obj.set_label(text)
124-
125 ticked = False
126 for option, name in option_to_widget:
127 opt_widget = getattr(self, name)
128@@ -1466,6 +1468,16 @@
129 self.partition_dialog_okbutton.set_sensitive(complete)
130 return complete
131
132+ def show_crypto_page(self):
133+ self.set_page_title(
134+ self.controller.get_string('ubiquity/text/crypto_label'))
135+ self.current_page = self.page_crypto
136+ self.move_crypto_widgets()
137+ self.show_encryption_passphrase(True)
138+ self.controller.go_to_page(self.current_page)
139+ self.controller.toggle_next_button('install_button')
140+ self.info_loop(None)
141+
142 def get_crypto_keys(self):
143 if self.info_loop(None):
144 return self.password.get_text()
145@@ -1621,6 +1633,8 @@
146 self.local_progress = False
147 self.swap_size = 0
148
149+ self.ui.update_branded_strings()
150+
151 self.install_bootloader = False
152 if (self.db.get('ubiquity/install_bootloader') == 'true' and
153 'UBIQUITY_NO_BOOTLOADER' not in os.environ):
154@@ -3122,10 +3136,21 @@
155 return True
156
157 elif question.startswith('partman-crypto/passphrase'):
158+ # Go forward rather than back in response to passphrase and
159+ # passphrase-again questions if the UI is not available but they
160+ # have been preseeded
161+ if not hasattr(self.ui, 'get_crypto_keys'):
162+ return self.db.fget(question, 'seen') == 'true'
163+
164+ do_preseed = True
165 if not self.ui.get_crypto_keys():
166- return self.db.fget(question, 'seen') == 'true'
167- self.preseed(question, self.ui.get_crypto_keys())
168- return True
169+ if hasattr(self.ui, 'show_crypto_page'):
170+ do_preseed = False
171+ self.ui.show_crypto_page()
172+
173+ if do_preseed:
174+ self.preseed(question, self.ui.get_crypto_keys())
175+ return True
176
177 elif question == 'partman-crypto/mainmenu':
178 if self.activating_crypto:

Subscribers

People subscribed via source and target branches

to status/vote changes: