all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Auto-install EFI / BIOS bootloader
@ 2019-01-22 15:50 Pierre Neidhardt
  2019-01-22 17:26 ` Pierre Neidhardt
  2019-01-22 19:33 ` Danny Milosavljevic
  0 siblings, 2 replies; 5+ messages in thread
From: Pierre Neidhardt @ 2019-01-22 15:50 UTC (permalink / raw)
  To: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 1876 bytes --]

The manual suggests the following:

--8<---------------cut here---------------start------------->8---
     Note: Unsure whether to use EFI- or BIOS-based GRUB? If the
     directory ‘/sys/firmware/efi’ exists in the installation image,
     then you should probably perform an EFI installation, using
     ‘grub-efi-bootloader’.  Otherwise you should use the BIOS-based
     GRUB, known as ‘grub-bootloader’.  *Note Bootloader
     Configuration::, for more info on bootloaders.
--8<---------------cut here---------------end--------------->8---

From there, why wouldn't Guix do that automatically for use?

For instance, would could have the following:

--8<---------------cut here---------------start------------->8---
    (bootloader (bootloader-configuration
                 (bootloader grub-auto-bootloader)
                 (target "/dev/sdX))
--8<---------------cut here---------------end--------------->8---

The "target" can be used as follows:

- If in BIOS mode, use /dev/sdX directly.
- If in EFI mode, pick the partition with the ESP flag and look up the
mount-point in the (file-systems ...).

What do you think?


Side question: I just tried installing GuixSD on a brandnew workstation
and the motherboard (Asus PRIME B450M-K) displays "UEFI" when I press F2
on start.  Now when I boot the Guix image, /sys/firmware/efi does not
exist, and indeed the Grub EFI installation fails (the BIOS one works).
I tried with another distribution, same thing.  The error is something
like:

--8<---------------cut here---------------start------------->8---
/gnu/store/...-grub-.../.../modinfo.sh doesn't exist, please specify
--target or --directory.
--8<---------------cut here---------------end--------------->8---

Is it possible that Linux fails to detect the UEFI?

--
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Auto-install EFI / BIOS bootloader
  2019-01-22 15:50 Auto-install EFI / BIOS bootloader Pierre Neidhardt
@ 2019-01-22 17:26 ` Pierre Neidhardt
  2019-01-22 19:33 ` Danny Milosavljevic
  1 sibling, 0 replies; 5+ messages in thread
From: Pierre Neidhardt @ 2019-01-22 17:26 UTC (permalink / raw)
  To: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 166 bytes --]


> Is it possible that Linux fails to detect the UEFI?

Wait... Could that be because of the SecureBoot thing? :/

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Auto-install EFI / BIOS bootloader
  2019-01-22 15:50 Auto-install EFI / BIOS bootloader Pierre Neidhardt
  2019-01-22 17:26 ` Pierre Neidhardt
@ 2019-01-22 19:33 ` Danny Milosavljevic
  2019-01-22 19:38   ` Danny Milosavljevic
  1 sibling, 1 reply; 5+ messages in thread
From: Danny Milosavljevic @ 2019-01-22 19:33 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

Hi Pierre,

> From there, why wouldn't Guix do that automatically for use?

In practise UEFI likes to fake a lot of stuff.  It can happen that
/sys/firmware/efi exists but the system cannot *boot* via EFI.

Likewise, /sys/firmware/efi can vanish just because you booted
from CD using UEFI's BIOS fallback.

There are lots of other "fun" situations--and also lots of bugs in EFI
implementations.

grub-hybrid is better:  It supports booting both via EFI and via BIOS.

In order to support it we would have to partition somewhat like this:

http://www.slivermetal.org/2016/09/18/how-to-create-an-hybrid-uefi-gpt-bios-gptmbr-boot-usb-disk/

In short:

* Have both GPT and MBR partition tables, with the same entries.
* Invoke grub-install twice:
** Once with --target=x86_64-efi and the vfat ESP partition as argument,
** Once with --target=i386-pc and the drive (or a partition, I guess) as argument

Now it always boots.

(Hybrid MBR/GPT are "dangerous" because they have to be updated in lock-step)

Also, if we want to convert people from Windows or similar other operating systems,
the user should have to explicitly confirm overwriting the bootloader.

> Side question: I just tried installing GuixSD on a brandnew workstation
> and the motherboard (Asus PRIME B450M-K) displays "UEFI" when I press F2
> on start.  Now when I boot the Guix image, /sys/firmware/efi does not
> exist, and indeed the Grub EFI installation fails (the BIOS one works).
> I tried with another distribution, same thing.

See?

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Auto-install EFI / BIOS bootloader
  2019-01-22 19:33 ` Danny Milosavljevic
@ 2019-01-22 19:38   ` Danny Milosavljevic
  2019-01-22 21:50     ` Pierre Neidhardt
  0 siblings, 1 reply; 5+ messages in thread
From: Danny Milosavljevic @ 2019-01-22 19:38 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 301 bytes --]

> (Hybrid MBR/GPT are "dangerous" because they have to be updated in lock-step)

Oops, correction:

GPT always has a dummy MBR partition table which marks everything as "used".
So the MBR will not be updated further.

Grub2 will use GPT (if available) both in the EFI and in the non-EFI case.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Auto-install EFI / BIOS bootloader
  2019-01-22 19:38   ` Danny Milosavljevic
@ 2019-01-22 21:50     ` Pierre Neidhardt
  0 siblings, 0 replies; 5+ messages in thread
From: Pierre Neidhardt @ 2019-01-22 21:50 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 89 bytes --]

Interesting, Danny, thanks for sharing!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-22 22:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-22 15:50 Auto-install EFI / BIOS bootloader Pierre Neidhardt
2019-01-22 17:26 ` Pierre Neidhardt
2019-01-22 19:33 ` Danny Milosavljevic
2019-01-22 19:38   ` Danny Milosavljevic
2019-01-22 21:50     ` Pierre Neidhardt

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.