You are not logged in.

#1 2021-02-10 11:00:22

Shashwat
Member
From: India
Registered: 2011-05-08
Posts: 101

[Solved] Issue with EFIStub - boot entry not displayed in UEFI

I am trying to install EFIStub and I followed the wiki. https://wiki.archlinux.org/index.php/EFISTUB . The installation and instructions went fine without any hitch -

$ sudo efibootmgr --disk /dev/sda --part 1 --create --label "Linux Arch" --loader /vmlinuz-linux --unicode 'root=PARTUUID=cac3e4b3-2751-4838-821f-f0a92c1f8725 rw initrd=\initramfs-linux.img' --verbose
[sudo] password for tejonidhi: 
BootCurrent: 0005
Timeout: 1 seconds
BootOrder: 0000,0005,0001
Boot0001* Hard Drive	BBS(HD,,0x0)
Boot0005* GRUB	HD(1,MBR,0xdae44745,0x800,0xf9dcd)/File(\EFI\GRUB\grubx64.efi)
Boot0000* Linux Arch	HD(1,MBR,0xdae44745,0x800,0xf9dcd)/File(\vmlinuz-linux)root=PARTUUID=cac3e4b3-2751-4838-821f-f0a92c1f8725 rw initrd=\initramfs-linux.img

However, there is no separate boot entry in the UEFI. See this image - https://ibb.co/DMvXsjT

Now, I  am aware that the wiki mention of using bcfg via the live medium. I am in quandary on how to get to the shell.  Or there is another workaround?

Also I have not uninstalled GRUB to be on the safe side. Is this the right approach to test out EFIStub?

If I have to go to bcfg route how do I get the shell? Do I need to chroot /mnt before going to the process or simply on livedisk i can do it?

TIA
Regards

Last edited by Shashwat (2021-02-24 06:19:06)

Offline

#2 2021-02-10 11:16:39

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,626

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

1) The systemd-boot menu of the live disk should have an option to boot into the UEFI shell, this isn't the normal live disk environment, but an EFI specific shell

2) Definitely keep an already working entry yes, there are chances your UEFI simply doesn't allow to pass parameters so this could be impossible from the outset.

3) See 1) you are not booting into linux, but the UEFI shell, any notions of linux file systems or paths are irrelevant, you'll only have access to and operate on the ESP partition.

Which could also be a hint, what does your current setup look like? Is /vmlinuz-linux and /initramfs-linux.img present on the ESP? GRUB can load a linux filesystem and load the necessary binary from there, but if you want to opt for EFISTUB both of these linux files need to be actually present on the ESP. If they aren't that could already be the reason for the lack of an entry as the file wouldn't exist from the POV of the mainboard's UEFI

Last edited by V1del (2021-02-10 11:19:06)

Offline

#3 2021-02-10 11:27:27

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

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

If the UEFI firmware doesn't allow parameters then you could create a unified kernel image and place that on the EFI system partition under /EFI/BOOT/BOOTX64.EFI, which should be booted even in the absence of any NVRAM boot entries.

Offline

#4 2021-02-10 12:53:10

Shashwat
Member
From: India
Registered: 2011-05-08
Posts: 101

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

V1del wrote:

1) The systemd-boot menu of the live disk should have an option to boot into the UEFI shell, this isn't the normal live disk environment, but an EFI specific shell

2) Definitely keep an already working entry yes, there are chances your UEFI simply doesn't allow to pass parameters so this could be impossible from the outset.

3) See 1) you are not booting into linux, but the UEFI shell, any notions of linux file systems or paths are irrelevant, you'll only have access to and operate on the ESP partition.

Which could also be a hint, what does your current setup look like? Is /vmlinuz-linux and /initramfs-linux.img present on the ESP? GRUB can load a linux filesystem and load the necessary binary from there, but if you want to opt for EFISTUB both of these linux files need to be actually present on the ESP. If they aren't that could already be the reason for the lack of an entry as the file wouldn't exist from the POV of the mainboard's UEFI

I booted into the EFI shell using a bootable USB. However, I am not sure how to proceed further given the naming convention seems odd plus I have never worked with EFI shell.

I am attaching the image of key command output like map, bcfg boot dump and so on.

https://ibb.co/vvzVzKs
https://ibb.co/d4NF846
https://ibb.co/1mj9QS2

From the above I am assuming FS1 is the harddisk?  Wherein, FS0 is the bootable USB?

The output from

bcfg boot dump

seems to be creating confusion as it list device 01 as USB, plus there is no proper explanation on it on wiki.

My current setup is initramfs-linux.img on the ESP. The wiki doesn't specifically mention the inclusion of both in the ESP.

Shall I execute these as mentioned in the wiki?

Shell> bcfg boot add N fsV:\vmlinuz-linux "Arch Linux"
Shell> bcfg boot -opt N "root=/dev/sdX# initrd=\initramfs-linux.img"

But the catch again is the FSN - I am not able to discern the filesystem #.

Please help me get over this conundrum.

Edit -

Head_on_a_Stick wrote:

If the UEFI firmware doesn't allow parameters then you could create a unified kernel image and place that on the EFI system partition under /EFI/BOOT/BOOTX64.EFI, which should be booted even in the absence of any NVRAM boot entries.

How will I know for sure that my ASRock UEFI doesn't allow me to pass parameters?

Last edited by Shashwat (2021-02-10 13:01:21)

Offline

#5 2021-02-10 14:24:58

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,626

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

Yeah, looks like FS1 is the harddisk and FS:0 the USB.

So you'd want to refer to FS1 in this instance.

However, you definitely need vmlinuz-linux on the ESP it's the image you are referencing as part of the entry definition and if that "ls FS:1" is any indication neither is the initramfs-linux.img, both have to be on the ESP or you can't boot via EFISTUB.

As for how to know whether it doesn't support it, this is unlikely to be documented officially, so you'll have to test or google for other people's experiences with ASRock boards and using EFISTUB. I haven't heard anything to the contrary which is a good initial sign, e.g. I know based on reports here that MSI boards don't support it.

But as it stands the problem is quite simply you are referencing non existent (from the POV of the mainboard) vmlinuz-linux and initramfs-linux.img files. Copy them to the ESP and recreate the relevant entry and check again.

FWIW as you now see firsthand why bootloaders are still a thing, what's your motivation for trying this? Do you expect noticeable performance gains or do you just want to see how this works? Performance benefits will be in the 1 to 5 seconds range at most

Last edited by V1del (2021-02-10 14:39:14)

Offline

#6 2021-02-10 14:48:49

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,565

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

I have an Asrock board and I have experienced problem with efibootmg and NVRAM. It seems efibootmgr doesn't communicate well with the NVRAM firmware and the time I needed a fix I have to do it via UEFI shell.
I remember trying to install EFISTUB with this board but with no success. I now use rEFInd and it actually works great and fast..

Offline

#7 2021-02-10 23:27:58

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 325
Website

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

Shashwat wrote:

However, there is no separate boot entry in the UEFI. See this image - https://ibb.co/DMvXsjT

Well, `efibootmgr` clearly shows your entry `Boot0000`. I suppose you look in the wrong place in your computer's UEFI shell.

  • Look into “Hard Drive BBS Priorities”.

  • Trigger the boot device selection menu during boot and see if your entry is there. The method to do this depends on your computer.

Here is what my computer shows: Boot menu, HDD priorities, Choosing a device for the current boot. I installed it via `efibootmgr`.

Last edited by beroal (2021-02-10 23:28:53)


we are not condemned to write ugly code

Offline

#8 2021-02-22 06:25:45

Shashwat
Member
From: India
Registered: 2011-05-08
Posts: 101

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

V1del wrote:

Yeah, looks like FS1 is the harddisk and FS:0 the USB.

So you'd want to refer to FS1 in this instance.

However, you definitely need vmlinuz-linux on the ESP it's the image you are referencing as part of the entry definition and if that "ls FS:1" is any indication neither is the initramfs-linux.img, both have to be on the ESP or you can't boot via EFISTUB.

As for how to know whether it doesn't support it, this is unlikely to be documented officially, so you'll have to test or google for other people's experiences with ASRock boards and using EFISTUB. I haven't heard anything to the contrary which is a good initial sign, e.g. I know based on reports here that MSI boards don't support it.

But as it stands the problem is quite simply you are referencing non existent (from the POV of the mainboard) vmlinuz-linux and initramfs-linux.img files. Copy them to the ESP and recreate the relevant entry and check again.

FWIW as you now see firsthand why bootloaders are still a thing, what's your motivation for trying this? Do you expect noticeable performance gains or do you just want to see how this works? Performance benefits will be in the 1 to 5 seconds range at most

My bad, the boot folder has both initramfs and vmlinuz. What to do now?

Shall I go ahead with using bcfg command? As @beroal mentioned the entry is there so what could the command achieve?


beroal wrote:
Shashwat wrote:

However, there is no separate boot entry in the UEFI. See this image - https://ibb.co/DMvXsjT

Well, `efibootmgr` clearly shows your entry `Boot0000`. I suppose you look in the wrong place in your computer's UEFI shell.

  • Look into “Hard Drive BBS Priorities”.

  • Trigger the boot device selection menu during boot and see if your entry is there. The method to do this depends on your computer.

Here is what my computer shows: Boot menu, HDD priorities, Choosing a device for the current boot. I installed it via `efibootmgr`.

Well yes, the boot entry does seems to reflect the efibootmgr created entry. Not sure why it isn't reflecting in the BIOS/UEFI.

Here are the screenshot of my BIOS entry-

1. https://ibb.co/YfBdVM9
2. https://ibb.co/T83ZWnh
3. https://ibb.co/XY1QqNX
4. https://ibb.co/RND8b0X

There is a boot from EFI shell option in the BIOS but when I click it nothing happens and a message appear that no efi shell exist. (Image 3)

I have disabled CSM mode because I am not running legacy system plus enabling it doesn't really display anything significant. But if you need that screenshot I can enable and provide as well.

Edit- The bcfg command shows that the devpath is pointing to a grubx64.efi file? Is that ok? Or a different efi file needs to be generated? What will happen to this efi file if I remove grub (considering I manage to install efistub)? - https://ibb.co/d4NF846

Please help.

TIA

Last edited by Shashwat (2021-02-22 07:04:13)

Offline

#9 2021-02-22 08:03:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,626

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

My bad, the boot folder has both initramfs and vmlinuz. What to do now?

And that /boot folder is what? A folder on your root partition or the mount point of your ESP?

Go into your system, mount all partitions as you think they have to be post the outputs of

mount
tree /boot
tree $mountPointofESP #Replace this with where you've mounted the ESP

The bcfg command shows that the devpath is pointing to a grubx64.efi file? Is that ok? Or a different efi file needs to be generated? What will happen to this efi file if I remove grub (considering I manage to install efistub)?

Yes that's the entry GRUB created and which you are booting to get into your system. Yes you need a a different EFI file, the vmlinuz-linux and initramfs-linux.img created by mkinitcpio for setting up EFISTUB (which is why they have to reside on the same partition that the grubx64.efi is currently on). Nothing will happen with that file. It's a file you created by running the grub-install command which isn't going to be touched just because you remove the GRUB package, but you can just manually remove it in case.

Offline

#10 2021-02-22 08:35:01

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 325
Website

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

Shashwat wrote:

I have disabled CSM mode because I am not running legacy system plus enabling it doesn't really display anything significant. But if you need that screenshot I can enable and provide as well.

I disable the CSM mode too. If it is enabled, then the ArchLinux live media boots in the legacy/CSM mode, and `efibootmgr` does not work because "EFI variables are not supported on this system". So you better disable the legacy/CSM mode.

Shashwat wrote:

From the above I am assuming FS1 is the harddisk?

`FS1` is partition 1 of your HDD. It only contains the `EFI` directory. You need to copy `vmlinuz-linux` and `initramfs-linux.img` manually to `FS1`.

Shashwat wrote:

The output from

bcfg boot dump

seems to be creating confusion as it list device 01 as USB, plus there is no proper explanation on it on wiki.

In the output of

bcfg boot dump

"Option: 01" is the number of the boot option, not the number of a device.

In your `bcfg` dump, I do not see an entry for the Linux kernel. Here is the output of `efibootmgr` on my computer:

efibootmgr
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0006,0003,0001
Boot0000* Arch Linux SSD
Boot0001  Hard Drive
Boot0003* Windows Boot Manager
Boot0006* Arch Linux SSD Fallback
efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0006,0003,0001
Boot0000* Arch Linux SSD	HD(2,GPT,de5f4687-886d-4a95-a79b-d08ebc6a4fd8,0x80000,0x80000)/File(\EFI\ARCH\VMLINUZ-LINUX)i.n.i.t.r.d.=.\.E.F.I.\.a.r.c.h.\.i.n.i.t.r.a.m.f.s.-.l.i.n.u.x...i.m.g. .r.o.o.t.=./.d.e.v./.d.i.s.k./.b.y.-.i.d./.a.t.a.-.T.S.1.2.8.G.S.S.D.3.7.0.S._.C.6.9.8.2.4.4.7.4.7.-.p.a.r.t.3. .r.w. .f.b.c.o.n.=.m.a.p.:.0.
Boot0001  Hard Drive	BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........T.S.1.2.8.G.S.S.D.3.7.0.S...................\.,.@.r.d.=.X..........A.................................>..Gd-.;.A..MQ..L.6.C.8.9.4.2.7.4.7.4. . . . . . . . . . ........BO..NO..........S.A.M.S.U.N.G. .H.D.2.0.4.U.I...................\.,.@.r.d.=.X..........A.................................>..Gd-.;.A..MQ..L.2.S.7.H.D.J.B.2.2.2.0.8.1.9. . . . . . ........BO
Boot0003* Windows Boot Manager	HD(2,GPT,de5f4687-886d-4a95-a79b-d08ebc6a4fd8,0x80000,0x80000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot0006* Arch Linux SSD Fallback	HD(2,GPT,de5f4687-886d-4a95-a79b-d08ebc6a4fd8,0x80000,0x80000)/File(\EFI\ARCH\VMLINUZ-LINUX-FALLBACK)i.n.i.t.r.d.=.\.E.F.I.\.a.r.c.h.\.i.n.i.t.r.a.m.f.s.-.l.i.n.u.x.-.f.a.l.l.b.a.c.k...i.m.g. .r.o.o.t.=./.d.e.v./.d.i.s.k./.b.y.-.i.d./.a.t.a.-.T.S.1.2.8.G.S.S.D.3.7.0.S._.C.6.9.8.2.4.4.7.4.7.-.p.a.r.t.3. .r.w. .n.o.p.a.t. .f.b.c.o.n.=.m.a.p.:.0.

I suppose you deleted the entry somehow or it is the old screeshot or BIOS has cleared your entry on reboot. Try to add the entry again, but check the output `bcfg boot dump` before. Sorry, I do not know how to work with `bcfg`. `efibootmgr` is the only tool that I needed.


we are not condemned to write ugly code

Offline

#11 2021-02-22 10:27:36

salexandarz
Member
Registered: 2020-08-21
Posts: 2

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

Some machines, like mine hp250g4, have selection of boot menu options in bios.
In that case, if parameters are correctly written like in wiki, Efistub option will appear in Bios under system configuration - uefii boot order - os boot manager, with name you provided and can be enabled from there. Other boot options like bootloaders will also be there. For example, my Efistub has name Arch and systemd-boot has generic name Linux Boot Manager.

Last edited by salexandarz (2021-02-22 10:49:15)

Offline

#12 2021-02-23 09:35:16

Shashwat
Member
From: India
Registered: 2011-05-08
Posts: 101

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

Finally I got the EFISTUB working albeit partially. Here is what I did -

I placed the initramfs-linux.img and vmlinuz-linux into /efi (wasn't there initially). This alone did nothing so I re-ran the efibootmgr command and recreated the entry and this time I am getting the EFISTUB in my BIOS.

Image 1 - https://ibb.co/zRRpwQY

Now the problem is that it does boot into efistub but gets stalled during partition mount.

https://ibb.co/NNytRf4

Here the output of blkid

[tejonidhi@arch ~]$ blkid 
/dev/sda1: UUID="29BC-C4C9" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="dae44745-01"
/dev/sda2: UUID="cac3e4b3-2751-4838-821f-f0a92c1f8725" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="dae44745-02"
/dev/sda3: LABEL="data" UUID="9d3ce11e-31d1-4c41-a821-082c1d5ec276" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="dae44745-03"

Here is lsblk

For more details see lsblk(8).
[tejonidhi@arch ~]$ lsblk 
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 111.8G  0 disk 
├─sda1   8:1    0 499.7M  0 part /efi
├─sda2   8:2    0  24.9G  0 part /
└─sda3   8:3    0  86.4G  0 part /media/data

As per wiki the UUID should be of root directory and its mentioned as is but it is still showing error. What to do next? Or do I need to place the vmlinuz and initramfs into efi/EFI/GRUB?

Also if I don't plan to use grub from the get go how do I generate efi file during vanilla install?

Last question - since  I have manually copied the initramfs and vmlinuz, do I need to copy it every time there is a kernel update?

Edit- going to replace the UUID with PARTUUID. Is there a config file for efibootmgr or I need to run the command everytime?

Edit 2 - After changing the UUID with PARTUUID, all I am getting is ASROCK logo and nothing happens. What now?

Edit 3 - Evertying working fine now. EFISTUB is working - thanks a million to all. I forgot to pass rw initrd=\initramfs-linux.img parameter in the command.

Now I can finally remove grub? Please do answer few queries I had.  The boot is not SILENT boot during EFISTUB boot, how do I achieve that? Plymouth?

Final update code

[tejonidhi@arch ~]$ efibootmgr --verbose
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0005
Boot0000* Arch	HD(1,MBR,0xdae44745,0x800,0xf9dcd)/File(\vmlinuz-linux)r.o.o.t.=.P.A.R.T.U.U.I.D.=.d.a.e.4.4.7.4.5.-.0.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.
Boot0005* GRUB	HD(1,MBR,0xdae44745,0x800,0xf9dcd)/File(\EFI\GRUB\grubx64.efi)
[tejonidhi@arch ~]$ 

Regards
TIA

Last edited by Shashwat (2021-02-23 13:44:03)

Offline

#13 2021-02-24 10:49:32

salexandarz
Member
Registered: 2020-08-21
Posts: 2

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

Shashwat wrote:

Finally I got the EFISTUB working albeit partially. Here is what I did -

I placed the initramfs-linux.img and vmlinuz-linux into /efi (wasn't there initially). This alone did nothing so I re-ran the efibootmgr command and recreated the entry and this time I am getting the EFISTUB in my BIOS.

Image 1 - https://ibb.co/zRRpwQY

Now the problem is that it does boot into efistub but gets stalled during partition mount.

https://ibb.co/NNytRf4

Here the output of blkid

[tejonidhi@arch ~]$ blkid 
/dev/sda1: UUID="29BC-C4C9" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="dae44745-01"
/dev/sda2: UUID="cac3e4b3-2751-4838-821f-f0a92c1f8725" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="dae44745-02"
/dev/sda3: LABEL="data" UUID="9d3ce11e-31d1-4c41-a821-082c1d5ec276" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="dae44745-03"

Here is lsblk

For more details see lsblk(8).
[tejonidhi@arch ~]$ lsblk 
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 111.8G  0 disk 
├─sda1   8:1    0 499.7M  0 part /efi
├─sda2   8:2    0  24.9G  0 part /
└─sda3   8:3    0  86.4G  0 part /media/data

As per wiki the UUID should be of root directory and its mentioned as is but it is still showing error. What to do next? Or do I need to place the vmlinuz and initramfs into efi/EFI/GRUB?

Also if I don't plan to use grub from the get go how do I generate efi file during vanilla install?

Last question - since  I have manually copied the initramfs and vmlinuz, do I need to copy it every time there is a kernel update?

Edit- going to replace the UUID with PARTUUID. Is there a config file for efibootmgr or I need to run the command everytime?

Edit 2 - After changing the UUID with PARTUUID, all I am getting is ASROCK logo and nothing happens. What now?

Edit 3 - Evertying working fine now. EFISTUB is working - thanks a million to all. I forgot to pass rw initrd=\initramfs-linux.img parameter in the command.

Now I can finally remove grub? Please do answer few queries I had.  The boot is not SILENT boot during EFISTUB boot, how do I achieve that? Plymouth?

Final update code

[tejonidhi@arch ~]$ efibootmgr --verbose
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0005
Boot0000* Arch	HD(1,MBR,0xdae44745,0x800,0xf9dcd)/File(\vmlinuz-linux)r.o.o.t.=.P.A.R.T.U.U.I.D.=.d.a.e.4.4.7.4.5.-.0.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.
Boot0005* GRUB	HD(1,MBR,0xdae44745,0x800,0xf9dcd)/File(\EFI\GRUB\grubx64.efi)
[tejonidhi@arch ~]$ 

Regards
TIA

About silent boot, you didn't add kernel parameters when created entry with efibootmgr. You need to add quiet splash. Also you didn't add initrd for intel ucode or something other you use. If you use intel microcode then also you need to add i915 and fastboot=1. My code looked something like this:

sudo efibootmgr --disk /dev/sda --part 1 --create --label "Arch" --loader /vmlinuz-linux-lts --unicode 'root=PARTUUID=xxxx-xxxx-xxxx-xxxx-xxxx rw initrd=\intel-ucode.img initrd=\initramfs-linux-lts.img rootfstype=ext4 add_efi_memmap quiet splash i915.fastboot=1' --verbose

Last edited by salexandarz (2021-02-24 11:13:37)

Offline

#14 2021-02-24 10:57:51

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,626

Re: [Solved] Issue with EFIStub - boot entry not displayed in UEFI

You will want to mount your /efi to /boot otherwise you need to remember to manually copy the relevant files to /efi (or create an additional hook or so) when your kernel receives an update.

Offline

Board footer

Powered by FluxBB