-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
Just for my innocent mind... Are we going to install standard MarIuX systems so it will boot from UEFI ? So we have System disks with UEFI and others with Legacy ? Sounds like a boy group to me... "Wrong Direction". |
|
Do we need to depend |
234a49d
to
e87196b
Compare
On 09/03/18 11:43, Donald Buczek wrote:
Do we need to depend `sys
'grub-install','--target=x86_64-efi',$root_disk and exit 1;` on
`is_efi` ? Maybe we should use "if there is a UEFI partition"
instead. Maybe we should mount it (if not already mounted) and
dismount if (if we mounted it).
If we do not depend on it `grub-install` is going to fail. No
idea, if that is acceptable. I’d prefer to be explicit.
The ESP is now mounted in case a UEFI installation is detected.
|
e87196b
to
35bc97d
Compare
[Note, updates were uploaded in the mean-time, some of the changes
already addressing some comments.]
On 08/30/18 12:28, Donald Buczek wrote:
* Is `/boot/efi` supposed to be the mounted FAT32 EFI system
partition? And therefore not disted?
Yes, it is. The EFI System Partition should be mounted there. After
discussing this, it is now only mounted, when checking and installing
GRUB.
* Does `sys 'grub-install','--target=x86_64-efi',$root_disk` write a
GRUB MBR? Although an UEFI boot doesn't read it?
No, it does not. `grub-install` also aborts, when the ESP is not
mounted.
* Does `/boot/grub` differ depending on whether the
`--target=x86_64-efi` is being given to grub-install? Currently
`/boot/grub` is disted, so this would be a problem.
Yes, the subdirectories `i386-pc` is used for legacy boot, and
`x86_64-efi` for UEFI. We checked `/root/Distfile`, and `i386-pc` is
not disted, so we will go that route for UEFI too.
# problems with mod-file /boot/grub/i386-pc between grub-2.00 and grub-2.02
/boot/grub/i386-pc
* Can we make `mxgrub install` always install `/boot/efi` and MBR
(and - although disted - `/boot/grub`) . To my (wrong?) understanding
the switch, how we boot, is in the firmware. Can we have a system
disk which can take any kind of boot?
Good idea. Currently, GRUB is *also* installed in the MBR of a UEFI
mounted system. I haven’t found an easy way to trick `grub-install`
into installing `/boot/grub/x86_64-efi` also on legacy systems. The
switch `--force` doesn’t help.
deinemuddah:~> sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --force /dev/sda
Installing for x86_64-efi platform.
grub-install: error: /boot/efi doesn't look like an EFI partition.
|
35bc97d
to
72bdd99
Compare
Suggestion: Instead of |
On 09/04/18 13:25, Donald Buczek wrote:
Suggestion: Instead of `is_efi` ( = ` -d '/sys/firmware/efi' `) use
`have_ESP` ( = ` !system "blkid -L ESP>/dev/null" ` ) ?
Could you document the advantage? Your suggestion has the disadvantage
that it doesn’t work with *mxonastick* where the ESP is named ESPUSB.
Getting too depend on labels is not a good idea in my opinion, as it
causes problems once you put two devices on the same system (for
example for debugging).
|
The intended advantage is, that I'd install the bootcode into the ESP partition (if available on the target disk) and into the MBR and between the partitions (if available on the target disk) no matter how my system booted.
might be correct. |
On 09/04/18 14:01, Donald Buczek wrote:
The intended advantage is, that I'd install the bootcode into the ESP
partition (if available on the target disk) and into the MBR and
between the partitions (if available on the target disk) no matter
how my system booted.
blkid --probe --match-token PART_ENTRY_TYPE="0xef" $device
might be correct.
But didn’t we test, that `grub-install` will fail anyway, if the system
is not booted using UEFI?
|
works for me (not UEFI bootet) :
|
I guess, the |
Yes. Another idea might be to not immediately If you want, I can take over and code this. I mean its perl. For people from the vaults. |
On 09/04/18 14:01, Donald Buczek wrote:
The intended advantage is, that I'd install the bootcode into the ESP
partition (if available on the target disk) and into the MBR and
between the partitions (if available on the target disk) no matter
how my system booted.
blkid --probe --match-token PART_ENTRY_TYPE="0xef" $device
might be correct.
This seems to only work with root rights.
$ blkid --probe --match-token PART_ENTRY_TYPE="0xef" /dev/sda
blkid: error: /dev/sda: Permission denied
|
Instead of always mounting the EFI System Partition (ESP), only mount it when checking if GRUB is installed. The mount point `/boot/efi` was created on the distmaster.
As that’s the common case, maybe it’s just spam, and should be a verbose option.
Contradicting the documentation, that `i386-pc` is the default target, on UEFI systems it is not. $ sudo grub-install --boot-directory=/boot /dev/nvme0n1 Installing for x86_64-efi platform. grub-install: error: cannot find EFI directory. So, pass `--target=i386-pc` to install GRUB in the MBR. $ sudo grub-install --target=i386-pc --boot-directory=/boot /dev/nvme0n1 Installing for i386-pc platform. Installation finished. No error reported.
72bdd99
to
7a21fb7
Compare
Thank you for the review. I’ll introduced There is one drawback with |
Looks like the switch
|
In case a drive with an EFI System Partition (ESP) is put into a system that boots in legacy mode, running `grub-install --target=x86_64-efi` will fail, as `efibootmgr` fails to update the NVRAM. Therefore, pass `--no-nvram` to `grub-install`, which skip running efibootmgr. --no-nvram don't update the `boot-device'/`Boot*' NVRAM variables. This option is only available on EFI and IEEE1275 targets. As a downside, the administrator needs to go int the firmware menu, and add the entry in the boot manager manually.
With a system booted from UEFI, starting the Linux kernel from GRUB, GRUB outputs error: not suitable video mode found booting in blind mode and no Linux messages can be seen. Jordan_U’s answer from #grub@irc.freenode.net: > Are you using a manually written grub.cfg or one made by > grub-mkconfig? > > If the former, add "insmod all_video" to your grub.cfg. That will > allow grub to set up a video mode to then pass on to linux. IIRC, the > text mode for UEFI is only intended for use by bootloaders, and thus > should not be used by linux. I think that means that if grub doesn't > pass a video mode to linux (which it needs video modules to be able to > do) then you won't get early printk from the kernel, messages will > only be displayed once native graphics drivers and KMS kicks in.
7a21fb7
to
e78c67f
Compare
I added the switch. (Just for your interest, there is also |
Now, on a UEFI system, the output looks like below.