Comment 111 for bug 1396379

Revision history for this message
TJ (tj) wrote :

Has anyone actually tested the one-line fix in the patch listed under "Related branches" - there's a single line added to a python (script) file.

As it is a python script it is possible to patch that file directly on the installer medium once started when it is running in the copy-on-write file-system of the Try Ubuntu workflow.

The line to add is:

   self.preseed('partman-auto/disk', self.ui.get_grub_choice())

with the correct indentation (must match the surrounding indentation - spaces if spaces, tabs if tabs)

On a running host that file is:

$ dpkg -S ubi-partman.py
ubiquity: /usr/lib/ubiquity/plugins/ubi-partman.py

Or apply the patch file directly with something like:

$ wget -O /tmp/efisp.diff https://code.launchpad.net/~2bdkid/ubuntu/+source/ubiquity/+git/ubiquity/+merge/432828/+preview-diff/992168/+files/preview.diff
$ cd /usr/lib
$ sudo patch -p1 < /tmp/efisp.diff
can't find file to patch at input line 5
...
File to patch:
Skip this patch? [y]
Skipping patch
1 out of 1 hunk ignored
patching file ubiquity/plugins/ubi-partman.py
Hunk #1 succeeded at 3545 (offset -1 lines).

Since the patch also adds to the changelog file and that doesn't exist in the same location the first 'hunk' in the patch will cause warnings to be reported. Press [Enter] when asked "File to patch:" and then answer [y] to "Skip this patch?"

I've tested this in a virtual machine with 2 storage volumes where both have EFI-SP partitions and file-systems, and in the first I mocked up a windows boot entry, but that wasn't enough to fool the installer into thinking there is an existing OS to install alongside - as a result it only offers to "Erase..." or "Something else" so I cannot be sure the same issue would be triggered.

The patch (diff) shows the change to the code:

diff --git a/ubiquity/plugins/ubi-partman.py b/ubiquity/plugins/ubi-partman.py
index 8059446..9620555 100644
--- a/ubiquity/plugins/ubi-partman.py
+++ b/ubiquity/plugins/ubi-partman.py
@@ -3546,6 +3546,7 @@ class Page(plugin.Plugin):
     def ok_handler(self):
         if self.install_bootloader and not self.is_bootdev_preseeded():
             self.preseed('grub-installer/bootdev', self.ui.get_grub_choice())
+ self.preseed('partman-auto/disk', self.ui.get_grub_choice())

         if self.current_question.endswith('automatically_partition'):
             (autopartition_choice, self.extra_choice, method) = \