GNU bug report logs

#47889 [installer image] grub-install efi fails getting canonical path to /boot/efi on dos-formatted disk

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Full log

Message #37 received at 47889@debbugs.gnu.org (full text, mbox, reply):

Received: (at 47889) by debbugs.gnu.org; 25 Apr 2021 14:16:06 +0000
From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 25 10:16:06 2021
Received: from localhost ([127.0.0.1]:43369 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1lafYM-0003yy-4S
	for submit@debbugs.gnu.org; Sun, 25 Apr 2021 10:16:06 -0400
Received: from eggs.gnu.org ([209.51.188.92]:46080)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <othacehe@gnu.org>) id 1lafYK-0003yG-IL
 for 47889@debbugs.gnu.org; Sun, 25 Apr 2021 10:16:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:36867)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <othacehe@gnu.org>)
 id 1lafYE-0001ya-Jn; Sun, 25 Apr 2021 10:15:58 -0400
Received: from [2a01:e0a:19b:d9a0:9576:8bbf:4795:82ee] (port=56634 helo=meije)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <othacehe@gnu.org>)
 id 1lafYE-0005ve-6U; Sun, 25 Apr 2021 10:15:58 -0400
From: Mathieu Othacehe <othacehe@gnu.org>
To: Ludovic Courtès <ludo@gnu.org>
Subject: Re: bug#47889: [installer image] grub-install efi fails getting
 canonical path to /boot/efi on dos-formatted disk
References: <20210419092928.p426llfdlvb5ay3z@pelzflorian.localdomain>
 <878s5a1m9k.fsf@gnu.org>
 <20210422143651.fwdrrqmcw225eh23@pelzflorian.localdomain>
 <87im4ds2su.fsf@gnu.org>
Date: Sun, 25 Apr 2021 16:15:56 +0200
In-Reply-To: <87im4ds2su.fsf@gnu.org> ("Ludovic Courtès"'s message of "Fri, 23 Apr 2021 12:39:13 +0200")
Message-ID: <87eeeyv49v.fsf@gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 47889
Cc: "pelzflorian \(Florian Pelz\)" <pelzflorian@pelzflorian.de>,
 47889@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -3.3 (---)
Hello,

> I’m not entirely sure how it decides between GPT and DOS, though;
> Mathieu?
>
> We should add UEFI installation tests using OVMF.

I could reproduce this issue with the following steps:

--8<---------------cut here---------------start------------->8---
qemu-img create -f qcow2 guix-system.img 50G
qemu-system-x86_64 -m 1024 -bios $(guix build ovmf)/share/firmware/ovmf_x64.bin -cdrom /gnu/store/<lastest-image.iso> -hda guix-system.img
Choose the msdos disk type in the auto-partitioning installer partitioning menu.
--8<---------------cut here---------------end--------------->8---

When using the auto-partitioning, the installer probes the selected
installation device type. If it has no type, like with my reproducer, it
asks whether to use msdos or gpt.

If the disk is already using an msdos or gpt layout, it is preserved.

Then, the auto-partitioning considers erroneously that ESP partitions
are not supported on msdos disks with the following code snippet:

--8<---------------cut here---------------start------------->8---
(and (not has-extended?) ;not msdos?
                 (if (efi-installation?)
                     (and (not esp-partition)
                          (user-partition
                           (fs-type 'fat32)
                           (esp? #t)
                           (size new-esp-size)
                           (mount-point (default-esp-mount-point))))
                     (user-partition
                      (fs-type 'ext4)
                      (bootable? #t)
                      (bios-grub? #t)
                      (size bios-grub-size))))
--8<---------------cut here---------------end--------------->8---

Finally, grub-efi fails because there's no /boot/efi mount point.

This problem can then occur for two reasons:

1. The user is booting the installation image with UEFI support, using
  an empty installation device, choosing auto-partition and msdos as
  disk type.

2. The user is booting the installation image with UEFI support, using
  an already msdos formatted installation device and choosing
  auto-partition.

I think we could solve 1. easily, by forcing the GPT layout. Solving
2. is a bit trickier.

As Ludo suggested, we also need to create new installer tests covering
UEFI installations.

I'll try to come up with a patch soon.

Thanks,

Mathieu

  




Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Dec 22 09:27:29 2024; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.