You are not logged in.

#26 2013-07-11 20:40:44

blablubb1234
Member
Registered: 2013-07-04
Posts: 31

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

the.ridikulus.rat wrote:

@blablubb1234: The reason bcfg is overwriting the "Setup" variable (by default Boot0000 in my Lenovo Thinkpad E430, check "efibootmgr -v" output for the actual variable ID in your system) is because you used

bcfg boot add 0 ......

Try some other number - like "7" below

bcfg boot add 7 fs0:\EFI\refind\refind_x64.efi "rEFInd"

EDIT: Can you post your full "efibootmgr -v" output?

Although I already told you that it didn't matter where exactly I insert the boot entry, I followed your recommendation and tried to create a boot entry for rEFInd again, this time adding it at another place (just to anticipate it: I again broke my setup utility). But this is exacty what I did:

First of all, as "Setup" used to get kicked off the boot list, I decided to move the CD entry to position 0, so - in the worst case - eventually the CD boot entry would fall off the list as i never used it anyways. Now this is how efibootmgr -v then looked like. And this and this is how bcfg -b boot dump -v looked like.

NOTE: Boot0000 aka Setup and Boot0001 aka Boot Menu from efibootmgr -v don't show up; I guess this might be a very important detail.

Then, just in order so I could boot the USB stick if something went terribly wrong (and I couldn't access the boot menu anymore), I moved the boot entry for the USB stick in front of the Windows Boot Manager by:

bcfg boot mv 5 2

See here.
Following this I added the rEFInd entry after the last boot entry with

bcfg boot add 6 fs0:\EFI\refind\refind_x64.efi "rEFInd"

See this screenshot. Now on that screenshot I guess we see the bug: bcfg doesn't seem to see the two entries Boot0000 and Boot0001 (which are visible by efibootmgr), so when adding rEFInd at position 6 (this is even confirmed by the shell), it still enumerates the entry starting at Boot0000 and thus overwriting the Setup utility hmm So maybe you were wright and I theoretically have enough space in the NVRAM, but as Boot0000 and Boot0001 seem to be invisible to bcfg/shell, manually adding a boot entry will result in deleting first the setup utility and second the boot menu.

Now the question is:

Can I create a boot entry using bcfg specifically telling it to put it at position X AND naming it Boot000Y so it does NOT overwrite the existing setup entry?

Just to keep you updated: I can now access rEFInd and boot M$ from there. I still have to setup the according Archlinux entry in rEFInd, haven't done that so far.

Offline

#27 2013-07-11 21:02:00

blablubb1234
Member
Registered: 2013-07-04
Posts: 31

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

srs5694 wrote:
the.ridikulus.rat wrote:

I don't think there is any 6-item limit to NVRAM entries as I have Boot0000-Boot0018 entries in my Thinkpad E430's NVRAM.

If there's one thing I've learned about EFI, it's to never assume that something true of one implementation is true of another. Even one manufacturer's products can vary greatly from one version to another, so a bug like this might have crept into one model or even just one specific version of the firmware.

So true... and at least I think an IdeaPad is not comparable at all to an ThinkPad.... unfortunately though hmm

Offline

#28 2013-07-11 21:09:42

blablubb1234
Member
Registered: 2013-07-04
Posts: 31

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

srs5694 wrote:

As to your problem, here are some options:

  • You can put rEFInd or gummiboot on a USB flash drive as EFI/BOOT/bootx64.efi. If you plug that into your computer on a permanent basis and set the firmware to favor booting from it, the result should be pretty good. There are even very low-profile USB flash drives so that the device will sit in the computer unobtrusively. This will work better with rEFInd than with gummiboot, though, since the latter can only load kernels (and I believe other boot loaders) from its own partition, so you'd need to put your Linux kernels and a copy of Microsoft's boot loader on the USB flash drive. That will slow down Linux boot times. By contrast, rEFInd can launch an EFI program from any partition that it can read, so rEFInd stored on a USB flash drive can boot a Linux kernel from a hard disk partition.

  • Removing the Windows boot loader from the list and instead adding rEFInd might work; however, Windows might then re-add its own boot loader back to the list when it reboots, and that might trigger the loss of your F2 functionality, if your hypothesis about what's causing that loss is correct.

  • Installing rEFInd, gummiboot, or whatever under the name EFI/Microsoft/Boot/bootmgfw.efi, first moving that file to another name, might also work. Unfortunately but understandably, some people have reported that Windows sometimes replaces that file with its own boot loader,  so this solution might be short-lived.

Ultimately, though, the solution is to get a fixed firmware. Unfortunately, your manufacturer might not offer such a thing; too many of them take the attitude that if it boots Windows, their job is done. Still, it's worth checking for an update, and complaining about the problem if you can't find one. You might even consider returning the computer if you can't get it working properly. In fact, if you can't get it working well I urge you to return it. A return will cost the manufacturer money, which is about the only thing that will attract any attention from a manufacturer, and if you explain the reason for the return, may cause them to take steps to correct the problem. Absent such attention, a manufacturer who ships a cruddy firmware today is likely to keep shipping cruddy firmware next year, the year after that, and so on.

As sad as it is, I really consider just booting from an USB dongle... might after afll be the least effort for the best result.

But before giving up, I have one more option called bcdedit under Windows. Maybe I can specify which Boot000X to use with that tool? I just don't have any idea whatsoever about the syntax.

And you are so damn right about complaining to Lenovo. I will certainly do that. But still, as the Laptop is too old, they won't take it back or update their EFI anymore.... last update is 2 years old and I already flashed to this newest version.

Last edited by blablubb1234 (2013-07-11 21:12:12)

Offline

#29 2013-07-11 23:33:25

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

blablubb1234 wrote:

Now on that screenshot I guess we see the bug: bcfg doesn't seem to see the two entries Boot0000 and Boot0001 (which are visible by efibootmgr),

If the bug is in bcfg (which is built into the EFI shell), then perhaps trying another build of the EFI shell will fix the problem. See the Arch wiki for download links to recent binary builds. The build that I include in the rEFInd CD-R and USB flash drive versions is patched so that it's supposed to work on older computers on which the official build fails. It might be better or worse than the official build with respect to this bug (if it is a bcfg bug).

Can I create a boot entry using bcfg specifically telling it to put it at position X AND naming it Boot000Y so it does NOT overwrite the existing setup entry?

This HP site includes syntax to specify the boot order but not the Boot#### name.

But before giving up, I have one more option called bcdedit under Windows. Maybe I can specify which Boot000X to use with that tool? I just don't have any idea whatsoever about the syntax.

I only have a minimal example command:

bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi
bcdedit /set {bootmgr} description "rEFInd description"

You could check Microsoft's bcdedit documentation for more information. I don't see anything obvious there about adjusting the full boot order or entering items in particular slots.

Offline

#30 2013-07-11 23:51:27

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

Lenovo don't necessarily update the EFI firmware anyway even if there is a firmware update. My firmware was updated fairly recently but I still have an older and different version of the EFI than most people here. That something works on one ThinkPad doesn't mean it will work on the next...


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#31 2013-07-12 08:55:41

blablubb1234
Member
Registered: 2013-07-04
Posts: 31

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

srs5694 wrote:
blablubb1234 wrote:

Now on that screenshot I guess we see the bug: bcfg doesn't seem to see the two entries Boot0000 and Boot0001 (which are visible by efibootmgr),

If the bug is in bcfg (which is built into the EFI shell), then perhaps trying another build of the EFI shell will fix the problem. See the Arch wiki for download links to recent binary builds. The build that I include in the rEFInd CD-R and USB flash drive versions is patched so that it's supposed to work on older computers on which the official build fails. It might be better or worse than the official build with respect to this bug (if it is a bcfg bug).

I know, I had to download the alternative shell because "regular" version 2 doesn't work at all on my "older" firmware (just getting some weird error messages.) And version doen't know bcfg command. Which one exactly did you include? The one provided by the alternative download link?

srs5694 wrote:

This HP site includes syntax to specify the boot order but not the Boot#### name.

Yeah, but this doesn't really help me. I think sticking with the Shell I use right now won't bring me any further unless I can specifically tell which Target (BootXXXX) to use hmm

srs5694 wrote:

[I only have a minimal example command:

bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi
bcdedit /set {bootmgr} description "rEFInd description"

You could check Microsoft's bcdedit documentation for more information. I don't see anything obvious there about adjusting the full boot order or entering items in particular slots.

I already checked that documentation but I couldn't find anything helpfull neither. I will try using bcdedit to create the rEFInd entry after I flashed over the original UEFI again. Maybe bcdedit sees Boot0000 and Boot0001 which bcfg can't see. If that should not work I will try to overwrite \EFI\Boot\bootx64.efi with rEFInd. Maybe one of those will help....

Last edited by blablubb1234 (2013-07-12 09:04:26)

Offline

#32 2013-07-12 13:52:18

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

cfr wrote:

Lenovo don't necessarily update the EFI firmware anyway even if there is a firmware update. My firmware was updated fairly recently but I still have an older and different version of the EFI than most people here.

Keep in mind that there are at least two version numbers that are relevant. The EFI version number (currently at 2.3.1, although that's often reported by software as 2.31) refers to the version of the EFI specification the firmware implements. The firmware version, by contrast, is the version number of a given manufacturer's build. It's not uncommon for the latter to change without changing the former, and such changes can fix significant bugs.

In other words, if you hear that somebody has (say), EFI 2.10, and you've also got EFI 2.10, that does not mean that the two of you will experience the same bugs. This is true even if you're running the same hardware -- you might have EFI 2.10, build 20101211, whereas the other person might have EFI 2.10, build 20110703. In this example, it's the build numbers that are important. When comparing across manufacturers, the differences can be even more significant. The EFI version number tells you, at best, about the features that the firmware supports, not about the bugs it contains.

Offline

#33 2013-07-12 20:50:03

blablubb1234
Member
Registered: 2013-07-04
Posts: 31

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

Hey guys,

I finally got a little further smile

I did what srs5694 proposed and (tried) to move \EFI\Microsoft\Boot\bootmgrfw.efi to \EFI\Microsoft\Boot\bootmgrfw.efi.bak. Somehow this went wrong (don't ask me how, I used the mv command with full path, but luckily it did go wrong) and bootmgrfw.efi now is located in the same directory as the Arch kernel files (but not in \EFI\Microsoft\Boot\ anymore, see here.

Now as I wanted to boot rEFInd instead of Windows by default (and as I mentioned before \EFI\Boot\bootx64.efi was the exact same file as \EFI\Microsoft\Boot\bootmgrfw.efi) I did a

cp \EFI\refind\refind_x64.efi \EFI\Boot\bootx64.efi

and have thereby overwritten Windows 7's fallback bootloader with an instance of rEFInd. Additionally, I copied this newly created file inside the same directory as refind_x64.efi; see here.

Now what happens when I boot is this:

If I select the boot menu via F12 I get prompted with this selection. As there is no more Windows Boot Manager left in \EFI\Microsoft\Boot, selecting this entry has the same result as selecting ADA HDD0: Samsung SSD 840 PRO Series, namely this prompt stating "Configuration file 'refind.conf' missing! Nevertheless if I just push ENTER there rEFInd boots up Windows7.

If on booting I don't access the boot menu via F12 I get directed to rEFInd with this and this boot option. I assume this rEFInd screen is started via \EFI\Boot\bootx64.efi, correct?
Anyways, I can again boot up Windows 7 or start the original (!) rEFInd I installed (to \EFI\refind\refind_x64.efi, see the path annotation below the missing icons) during Arch installation. The three little missing icons are "About", "Shutdown" and "Restart". Clicking rEFInd gets me to yet another rEFInd screen where I can boot Archlinux (theoretically at least, because I have not yet created the refind_linux.conf with the root partition entry),Windows 7 or switch back to the rEFInd screen with the missing icons.

Now I feel I am very much closer to solving my problem, although I am very well aware that there is still something very wrong with my current configuration big_smile
Which files do I need? How can I make the first rEFInd screen find the Linux kernel without having to boot a second instance of rEFInd first?

I have already tried deleting \EFI\Boot\refind_x64.efi, this deletes the possibility in the "second instance" of rEFInd to cycle back to the first instance with the missing icons. The rest (booting Windows 7 and Arch from the second isntance itself is still functional).

I really hope we can now figure out how to configure rEFInd so I can finally boot into Archlinux (and don't break it after kernel update etc.). BTW: F2 setup utility is of course still working as I didn't create an NVRAM entry for rEFInd smile At least that problem is "solved" or - let's say - worked around.

Offline

#34 2013-07-12 23:25:13

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

You need to copy all of rEFInd's support files and subdirectories to EFI/BOOT:

  • The refind.conf file

  • The icons subdirectory

  • The drivers or drivers_x64 directory, if present

With those items copied, the first instance of rEFInd launched (which produces the ugly icons as you've got it now) should work much more like the one with the correct icons. You'll still need a refind_linux.conf file to pass any kernel options, though.

Offline

#35 2013-07-15 14:46:54

blablubb1234
Member
Registered: 2013-07-04
Posts: 31

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

Hi srs5694,

thanks alot for you help smile This worked out well and now the first instance of rEFInd looks the way it is supposed to. Creating the refind_linux.conf wasn't problematic neither.

Additionally, I deleted the directory <EFI PARTITION>\EFI\refind\ to clean up my ESP. However, I still have refind_x64.efi and bootx64.efi in the directory <EFI PARTITION>\EFI\Boot. Which of those is getting loaded and which can I delete? I can't figure out a way to find out.

And I have two more questions before marking this as solved:

1) If there is an update to rEFInd (as it happened to be the case these days), I manually have to copy over the new rEFInd version (see above) to <EFI PARTITION>\EFI\refind_x64.efi oder <EFI PARTITION>\EFI\bootx64.efi?

2) Is there anything I have to take care of when doing a kernel update? I suppose, as I am using PARTUUIDs for pointing at my root-device, and Arch just copies over the new kernel, there is nothing I have to manually edit in refind_linux.conf? Am I correct about this?

Thanks again very much and best regards.

Offline

#36 2013-07-15 19:38:41

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

Yes you need to copy the .efi and any driver, fonts, icons etc. which you use when they are updated. If your EFI partition is mounted at /boot the kernel will be updated when the package is updated. Even if you mount it elsewhere, it is fine if you are using rEFInd's drivers as rEFInd can then use the kernel on /boot.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#37 2013-07-15 21:41:02

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

Chances are rEFInd is booting via EFI/BOOT/bootx64.efi in your case, so you can safely delete EFI/BOOT/refind_x64.efi. If the two files are identical and this causes problems, though, just move/rename bootx64.efi to refind_x64.efi to fix the problem.

cfr's response covers your remaining questions; I have nothing more to add to that.

Offline

#38 2013-07-17 08:22:43

blablubb1234
Member
Registered: 2013-07-04
Posts: 31

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

cfr wrote:

Yes you need to copy the .efi and any driver, fonts, icons etc. which you use when they are updated. If your EFI partition is mounted at /boot the kernel will be updated when the package is updated. Even if you mount it elsewhere, it is fine if you are using rEFInd's drivers as rEFInd can then use the kernel on /boot.

Let's hope the best then when the next kernel update finally comes along tongue
Just copied over the new rEFInd Version and everything works fine smile
Thank you very much.

Best regards.

Offline

#39 2013-07-17 08:25:52

blablubb1234
Member
Registered: 2013-07-04
Posts: 31

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

srs5694 wrote:

Chances are rEFInd is booting via EFI/BOOT/bootx64.efi in your case, so you can safely delete EFI/BOOT/refind_x64.efi. If the two files are identical and this causes problems, though, just move/rename bootx64.efi to refind_x64.efi to fix the problem.

Admittedly, I could have figured that out myself big_smile Nevertheless, i yesterday deleted refind_x64.efi from <EFI PARTITION>\Boot\ and it still started rEFInd and I am still able to dual boot both Win7 and Archlinux aswell as accessing my Setup smile

Thank you very very much and best regards.

Offline

#40 2013-07-17 13:42:11

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,800
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

@blablubb1234
Use the "edit" link of your first post to edit the subject line and prefix it with "[SOLVED]".

Offline

#41 2013-07-17 17:35:35

SamSpade
Member
Registered: 2012-10-29
Posts: 9

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

the.ridikulus.rat wrote:

... The --loader path and -u argument truncation should not be an issue if efibootmgr is ported to use efivarfs and the var size checks removed ....

Was trying out efibootmgr today on my ThinkPad E120 (latest BIOS 1.18, 2/27/2013). Wanted to include the kernel version to the kernel/image files just to make them readable:

efibootmgr -c -d /dev/sda -p 1 -l '\EFI\Arch-3.9.9-1\vmlinuz-arch-3.9.9-1.efi' -L "Arch Linux 3.9.9-1 (EFISTUB)" -u "root=UUID=0d2ca564-9466-4bb6-a639-eb632999988b ro initrd=EFI/Arch-3.9.9-1/initramfs-arch-3.9.9-1.img video=LVDS-1:1366x768 video=HDMI-1:1920x1080 video=VGA-1:1440x900"

The -l/--loader arguments were truncated to 39 characters, but my long 160+ character -u kernel parameters weren't.

efibootmgr -v
Boot000A* Arch Linux 3.9.9-1 (EFISTUB)	HD(1,800,100000,e4b002e1-c1f4-42c6-950e-d73e5a99e603)File(\EFI\Arch-3.9.9-1\vmlinuz-arch-3.9.9-1.)r.o.o.t.=.U.U.I.D.=.0.d.2.c.a.5.6.4.-.9.4.6.6.-.4.b.b.6.-.a.6.3.9.-.e.b.6.3.2.9.9.9.9.8.8.b. .r.o. .i.n.i.t.r.d.=.E.F.I./.A.r.c.h.-.3...9...9.-.1./.i.n.i.t.r.a.m.f.s.-.a.r.c.h.-.3...9...9.-.1...i.m.g. .v.i.d.e.o.=.L.V.D.S.-.1.:.1.3.6.6.x.7.6.8. .v.i.d.e.o.=.H.D.M.I.-.1.:.1.9.2.0.x.1.0.8.0. .v.i.d.e.o.=.V.G.A.-.1.:.1.4.4.0.x.9.0.0...

After changing the loader filename from vmlinuz-arch-3.9.9-1.efi to vmlinuz.efi it fit and now boots well.

Is this a ThinkPad UEFI issue or a efibootmgr upstream bug? If it was a BIOS issue, it would be good to have some verification and error checking in the upstream efibootmgr code, like giving an error message when the parameters don't match after they're written to NVRAM. Seems a common issue in these early UEFI years.

Offline

#42 2013-07-17 18:08:18

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

I haven't looked into this in depth, but apparently the pre-3.8 kernels were limited in the amount of data they could write to EFI variables at any given time. That limit has been raised with a new efifs driver, but my impression is that older versions of efibootmgr don't use the new interfaces. As I say, I haven't studied this issue in depth, but it seems to me that the mismatches on this matter are causing a lot of problems right now. I expect the difficulties will fade away in time, though.

Offline

Board footer

Powered by FluxBB