[Bug 1396379] Re: installer uses first EFI system partition found even when directed otherwise

TJ 1396379 at bugs.launchpad.net
Thu May 4 08:03:54 UTC 2023


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) = \

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1396379

Title:
  installer uses first EFI system partition found even when directed
  otherwise

Status in grub-efi-amd64-signed package in Ubuntu:
  Confirmed
Status in ubiquity package in Ubuntu:
  Fix Released
Status in grub-efi-amd64-signed source package in Jammy:
  Confirmed
Status in ubiquity source package in Jammy:
  Confirmed

Bug description:
  (k)ubuntu 14.04.1
  package version: 2.02~beta2-9ubuntu1

  i installed ubuntu on my external hard disk, where i also have a previously installed fedora system. i also have a windows
  (efi-booted) system in the internal hard disk.

  at install time via ubiquity i get all grub configuration files in the first EFI-labelled partition (i.e. /dev/sda2 in my case) instead of the one i selected (/dev/sdb1).
  later i changed my fstab mounting /boot/efi on /dev/sdb1 and tried to reinstall grub package (apt-get install --reinstall grub-efi-amd64); now all grub configuration files are in the rigt place, but booting from the external hard disk still shows the fedora grub installation, while selectin the internal hard disk from the bios menu shows a submenu listing ubuntu and windows.
  explicitly installing grub in the correct disk (grub-install /dev/sdb; grub-mkconfig -o /boot/efi/EFI/ubuntu/grub.cfg) has no effect, nor it has running efibootmgr (efibootmgr -c --disk /dev/sdb --part 1).

  expected results: grub shoud have been installed in the disk/partition i chose;
  actual results: ubuntu always chooses the first disk to install grub on.

  Note that this is not just about the dummy grub install location
  selector that is not used in EFI mode, but configuring one partition
  as do not use, and the other as ESP in the manual partitioning screen.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub-efi-amd64-signed/+bug/1396379/+subscriptions




More information about the foundations-bugs mailing list