You are not logged in.

#1 2016-07-11 12:18:30

jolivier
Member
Registered: 2012-05-30
Posts: 19

UEFISTUB with NVMe Disk

Hello all,

I am trying to install Arch on a Dell Precision 7710 which has the particularity of having a NVMe disk. I managed to do everything up to the bootloader but I fail to manage to have my laptop boot on Linux.

In short:
I have now the two following entries in my efibootmgr:

BootCurrent: 0003
Timeout: 2 seconds
BootOrder: 0001,0003
Boot0000* Arch Linux    HD(1,GPT,57337e5a-f3cf-43c0-b481-278d3e24e24f,0x800,0x100000)/File(\vmlinuz-linux)r.o.o.t.=./.d.e.v./.n.v.m.e.0.n.1.p.2. .r.w. .i.n.i.t.r.d.=./.i.n.i.t.r.a.m.f.s.-.l.i.n.u.x...i.m.g.
Boot0001* Arch  PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-25-38-42-61-B5-9E-A0)/HD(1,GPT,57337e5a-f3cf-43c0-b481-278d3e24e24f,0x800,0x100000)/File(\vmlinuz-linux)
Boot0003* UEFI:  Mimobot 1100, Partition 1      PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(1,MBR,0x23,0xac,0x14000)..BO                  

The first one is the one I generated following the EFISTUB article (the firmware doesn't accept it, my guess is that the path is not sufficient).
The second one is the one generated via the UI of the firmware of my Laptop, the path is correct since I enter in Linux code but the kernel panics directly, probably because of missing extra agrs.
So I want to keep the path of the later while keeping the extra args of the former. How do I do that?

I tried

efibootmgr -u "root=/dev/sda2 rw initrd=/initramfs-linux.img" -b 0001 

but it didn't change anything based on next efibootmgr -v that I ran...
So either I can generate a new entry from scratch with the right path and extra args or I can modify the path or extra args of any existing one, but nothing that I see in efibootmgr seems to do the trick; what should I do?

With more details:

My NVMe disk is on /dev/nvme0n1 which I simply partitioned:
p1 is my ESP that I mount on /boot ,
p2 is my root
p3 is my /home

When I follow the EFISTUB article following the efibootmgr instructions I type:

efibootmgr -d /dev/nvmpe0n1 -p 1 -c -L "Arch Linux" -l /vmlinuz-linux -u "root=/dev/nvme0n1p2 rw initrd=/initramfs-linux.img"

After this I reboot and my computer tells me that no device is bootable.
I digged in the firware setup UI and found the "Add boot entry" menu. This UI found my ESP (it listed the content of the partition so that I could choose the file /vmlinuz-linux) and suggested that I add an entry for my ESP. The boot entry it generated was at least correct so that I reached linux code which failed with a kernel panic. I ran at this point efibootmgr -v and see

BootCurrent: 0003
Timeout: 2 seconds
BootOrder: 0001,0003
Boot0000* Arch Linux    HD(1,GPT,57337e5a-f3cf-43c0-b481-278d3e24e24f,0x800,0x100000)/File(\vmlinuz-linux)r.o.o.t.=./.d.e.v./.n.v.m.e.0.n.1.p.2. .r.w. .i.n.i.t.r.d.=./.i.n.i.t.r.a.m.f.s.-.l.i.n.u.x...i.m.g.
Boot0001* Arch  PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-25-38-42-61-B5-9E-A0)/HD(1,GPT,57337e5a-f3cf-43c0-b481-278d3e24e24f,0x800,0x100000)/File(\vmlinuz-linux)
Boot0003* UEFI:  Mimobot 1100, Partition 1      PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(1,MBR,0x23,0xac,0x14000)..BO                  

The first one is the one I generated from the wiki.
The second one is the one generated via the UI of the firmware of my Laptop.
So I want to keep the path of the later while keeping the extra args of the former. How do I do that?

I tried

efibootmgr -u "root=/dev/sda2 rw initrd=/initramfs-linux.img" -b 0001 

but it didn't change anything based on next efibootmgr -v that I ran...
So either I can generate a new entry from scratch with the right path and extra args or I can modify the path or extra args of any existing one, but nothing that I see in efibootmgr seems to do the trick; what should I do?

I think this is related to https://github.com/rhinstaller/efibootmgr/issues/4 and https://bbs.archlinux.org/viewtopic.php?id=207352 but no applicable fix for me.

Offline

#2 2016-07-11 13:47:16

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: UEFISTUB with NVMe Disk

HERE BE DRAGONS!

Afaik efibootmgr does indeed not work properly (yet) with NVMe disks (it's missing the PCI path part of the device specifier).

To get things configured properly you could try to manipulate the boot variable directly.
The structure of the variable is as follows:

EFI_LOAD_OPTION{
    UINT32 Attributes; //Whether the entry is active or not (LOAD_OPTION_ACTIVE), etc.
    UINT16 FilePathListLength; //Length in bytes of FilePathList[].
    CHAR16 Description[]; //The user readable description for the load option. Null terminated.
    EFI_DEVICE_PATH_PROTOCOL FilePathList[]; //A packed array of UEFI device paths.
    UINT8 OptionalData[]; //A binary data buffer that is passed to the loaded image. A nullptr is passed if size = 0 bytes.
}

If you take a few minutes you could write a small EFI program that just calls the SetVariable function with the needed values (you can grab the values from the other variable using GetVariable wink  ). Boot this once and you should be good to go.

I guess another option would be to directly manipulate the variables from inside Linux. The NVRAM boot variables are usually in the following location:

/sys/firmware/efi/efivars/Boot*

I have personally never manipulated any NVRAM data through Linux directly though.

Last edited by Omar007 (2016-07-11 14:01:55)

Offline

#3 2016-07-11 19:54:32

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: UEFISTUB with NVMe Disk

jolivier wrote:

Hello all

Hi smile

The second one is the one generated via the UI of the firmware of my Laptop, the path is correct since I enter in Linux code but the kernel panics directly, probably because of missing extra agrs.
So I want to keep the path of the later while keeping the extra args of the former. How do I do that?

Recompile your kernel with the desired options added to CONFIG_CMDLINE

When I follow the EFISTUB article following the efibootmgr instructions I type:

efibootmgr -d /dev/nvmpe0n1 -p 1 -c -L "Arch Linux" -l /vmlinuz-linux -u "root=/dev/nvme0n1p2 rw initrd=/initramfs-linux.img"

Have you tried using UUIDs to identify "root=" instead  of /dev/nvme0n1p2?

what should I do?

Have you tried systemd-boot?

That was the solution in your linked thread.

GRUB should work with NVMe drives.

Offline

#4 2016-07-12 09:15:40

jolivier
Member
Registered: 2012-05-30
Posts: 19

Re: UEFISTUB with NVMe Disk

Hi, thanks for your answers.

I tried grub also when my first attempt with efistub failed but had the same issue than efistub. I saw yesterday on other forums that grub-git might have fixed this issue also but haven't tried yet (systemd seems to work and is simpler).
I had overlooked systemd-boot as I thought efistub was simpler but if it doesn't support NVMe disks I change my opinion!
So I followed the systemd-boot setup and managed to reach systemd boot menu! This is interesting since the efi boot entry for systemd has a simple path (HD(1, GPT,...)) without the prefixing PCI stuff but it still works! So there was maybe something else than the path that was incorrect in the entry generated by efibootmgr.
II still encounter boot issues but I'll open a different post since I don't think this is related.
Thanks!

Last edited by jolivier (2016-07-12 09:17:53)

Offline

Board footer

Powered by FluxBB