You are not logged in.

#26 2012-11-27 14:07:05

wwgfd
Member
From: UK
Registered: 2012-10-11
Posts: 32

Re: installing arch on efi/uefi 64bit motherboard

@srs5694 -- Thanks that makes a lot of sense, and no rEFInd / gummiboot haven't offendded me, I've never met them wink

I know that trying to boot the kernel with the native EFISTUB directly can be a on-going sensation of slight pain or discomfort in the lower abdomen / top of the legs region (i.e. "ball ache" -- or should that be "ball-Arch"?) but anyway I like a challenge, and as I said this method works fine when manually typed in to the built in EFI shell that came with my mainboard. However I did wonder if my NVRAM entry (yes I'm using efibootmgr) is missing the initial drive selection from the command chain? -- i.e. "fs0:" for me.

When I boot manually from the EFI shell I type:

> fs0:\EFI\arch\vmlinuz-arch.efi root=/dev/sda2 ro rootfstype=ext4 elevator=deadline add_efi_memmap initrd=\EFI\arch\initramfs-arch.img

Here are the console output's:

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          110G  3.9G  100G   4% /
dev             3.9G     0  3.9G   0% /dev
run             3.9G  400K  3.9G   1% /run
/dev/sda2       110G  3.9G  100G   4% /
tmpfs           3.9G   80K  3.9G   1% /dev/shm
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs           3.9G   16K  3.9G   1% /tmp
/dev/sda1      1022M   29M  994M   3% /boot


$ efibootmgr -v
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0000,0003,0002
Boot0000* SATA6:PLEXTOR DVDR   PX-891SA 	BIOS(10,0,00)
Boot0002* UEFI: Built-in EFI Shell 	Vendor(5023b95c-db26-429b-a648-bd47664c8012,)AMBO
Boot0003* Arch Linux	HD(1,22,200000,8f147af9-c536-43d7-9619-cfbd3e61e14a)File(\EFI\arch\vmlinuz-arch.efi)

There's a load of 'text....with...lots....of...dots" after the efibootmgr output in the above which I've omitted for brevity, they looked like config option instructions anyway, the only important bit probably being -- "e.f.i.b.o.o.t.m.g.r. .v.e.r.s.i.o.n. .0...5...4..."

Thanks for your help


What would Gordon Freeman do?

Offline

#27 2012-11-27 14:41:56

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

Re: installing arch on efi/uefi 64bit motherboard

wwgfd wrote:

There's a load of 'text....with...lots....of...dots" after the efibootmgr output in the above which I've omitted for brevity, they looked like config option instructions anyway, the only important bit probably being -- "e.f.i.b.o.o.t.m.g.r. .v.e.r.s.i.o.n. .0...5...4..."

Those are likely options passed to the last menu entry. I've not tested this, since I don't currently use such a configuration, but here's an entry that "efibootmgr -v" shows me that should boot a Linux kernel directly:

Boot0004* Arch Linux	HD(1,800,f4000,8b76434e-4498-4049-9140-356ee57763b0)File(\EFI\arch\vmlinuz-linux.efi)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./.s.d.a.3. .r.o. .q.u.i.e.t...

The characters interspersed with dots are options in UTF-16 format, which is the text format used by EFI. Without those options, or if they're corrupted in some way, the entry won't work correctly.

Offline

#28 2012-11-27 19:35:22

jumperpunk
Member
Registered: 2009-01-19
Posts: 21

Re: installing arch on efi/uefi 64bit motherboard

srs5694 wrote:
wwgfd wrote:

There's a load of 'text....with...lots....of...dots" after the efibootmgr output in the above which I've omitted for brevity, they looked like config option instructions anyway, the only important bit probably being -- "e.f.i.b.o.o.t.m.g.r. .v.e.r.s.i.o.n. .0...5...4..."

Those are likely options passed to the last menu entry. I've not tested this, since I don't currently use such a configuration, but here's an entry that "efibootmgr -v" shows me that should boot a Linux kernel directly:

Boot0004* Arch Linux	HD(1,800,f4000,8b76434e-4498-4049-9140-356ee57763b0)File(\EFI\arch\vmlinuz-linux.efi)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./.s.d.a.3. .r.o. .q.u.i.e.t...

The characters interspersed with dots are options in UTF-16 format, which is the text format used by EFI. Without those options, or if they're corrupted in some way, the entry won't work correctly.

I am having the exact same experience as wwgfd. Like wwgfd, I can use the UEFI shell (I use the one from the arch usb) to manually type the command to boot the system. I've actually made a script for it on the ESP so that I can do it a little faster and compare the commands I am using to boot vs. the arguments I am passing with efibootmgr.

I have noticed that trying to use efibootmgr to edit an existing EFI entry does not work. I have to remove the entry and recreate it.

My guess is that I am using the wrong encoding to pass the arguments. I have tried inputting the text as ascii, utf-8, utf-16, and ucs2, all with and without the -u option on efibootmgr (I will double check that in a bit, I'm currently syncing the kernel git repo to try something else). What input is efibootmgr expecting? If I pass the arguments to efibootmgr as ucs2, what does the -u option do? Is the UEFI expecting UTF-8, UTF-16, or UCS-2?

Offline

#29 2012-11-27 21:49:04

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

Re: installing arch on efi/uefi 64bit motherboard

jumperpunk wrote:

My guess is that I am using the wrong encoding to pass the arguments. I have tried inputting the text as ascii, utf-8, utf-16, and ucs2, all with and without the -u option on efibootmgr (I will double check that in a bit, I'm currently syncing the kernel git repo to try something else). What input is efibootmgr expecting? If I pass the arguments to efibootmgr as ucs2, what does the -u option do? Is the UEFI expecting UTF-8, UTF-16, or UCS-2?

My understanding is that the pipeline should look something like this:

echo "initrd=\EFI\arch\initramfs-linux.img root=/dev/sda3 ro quiet" | iconv -f ascii -t ucs2 | efibootmgr -c -L "Arch Linux" -l '\EFI\arch\vmlinuz-linux.efi' --append-binary-args -

That's cut-and-pasted from my Web page on the topic, but IIRC I simply cut-and-pasted that from an Arch wiki somewhere, perhaps with some small changes. Note the "-" at the end of the command. That's critical, since it tells efibootmgr to accept binary arguments from stdin, which ultimately comes from the echo and iconv commands.

Offline

#30 2012-11-28 01:40:14

jumperpunk
Member
Registered: 2009-01-19
Posts: 21

Re: installing arch on efi/uefi 64bit motherboard

I saw that on your page and from the archwiki. Unfortunately, no dice. I noticed the "-" at the end and I have been including it. I know that I am passing something, because I can see it when I do a 'efibootmgr -v', and it looks right, based on what I would expect, and what your output was. I will try again some tomorrow morning.

Offline

#31 2012-11-28 04:28:33

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: installing arch on efi/uefi 64bit motherboard

FWIW, my computer was really picky about where my initramfs was.  It did not like it being in /EFI/arch, so when I moved it to the root of the ESP on a whim, it suddenly worked.  So I just store all my kernels and initramfs' there.  It actually ends up making the command a bit shorter too.  So this is what I would use:

# echo "root=/dev/vg0/root initrd=\\initramfs-linux.img quiet" | iconv -f ascii -t ucs2 | efibootmgr -c -d /dev/sda -p 1 -L "Arch Linux" -l '\vmlinuz-linux.efi' --append-binary-args - 

@srs5694, the command in post #29 is right except you forgot to specify where the ESP is in the efibootmgr command.  So you would need the --disk (-d) and --part (-p) for it to work.  (It feels strange telling you that you have made a mistake, since it is from your web page that I found most of my understanding of UEFI)

Last edited by WonderWoofy (2012-11-28 04:29:39)

Offline

#32 2012-11-28 17:37:24

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

Re: installing arch on efi/uefi 64bit motherboard

WonderWoofy wrote:

@srs5694, the command in post #29 is right except you forgot to specify where the ESP is in the efibootmgr command.  So you would need the --disk (-d) and --part (-p) for it to work.  (It feels strange telling you that you have made a mistake, since it is from your web page that I found most of my understanding of UEFI)

The default values for -d and -p are /dev/sda and 1, respectively, so they shouldn't be needed if you're using /dev/sda1 as your ESP. (OTOH, there could be a bug, or the man page could be out of date.) I've added mention of these options to my Web page, though; thanks for pointing out the omission.

Offline

#33 2012-11-28 19:46:48

jumperpunk
Member
Registered: 2009-01-19
Posts: 21

Re: installing arch on efi/uefi 64bit motherboard

Well, I tried the 3.7-git branch to use the option that loads the kernel args from linux.conf, and it wont boot. I did something wrong in compiling my kernel. And now it won't boot to the stock pre-compiled kernel either, even after I did a chroot to remove the linux-git packages and reinstall the linux package. I will probably just start from scratch at this point as this is a fresh install.

@WonderWoofy, what symptoms did you see before moving the files? Was it similar to what wwgfd and I saw?

Last edited by jumperpunk (2012-11-28 19:47:22)

Offline

#34 2012-11-28 20:17:24

89c51
Member
Registered: 2012-06-05
Posts: 741

Re: installing arch on efi/uefi 64bit motherboard

jumperpunk wrote:

Well, I tried the 3.7-git branch to use the option that loads the kernel args from linux.conf, and it wont boot. I did something wrong in compiling my kernel. And now it won't boot to the stock pre-compiled kernel either, even after I did a chroot to remove the linux-git packages and reinstall the linux package. I will probably just start from scratch at this point as this is a fresh install.

@WonderWoofy, what symptoms did you see before moving the files? Was it similar to what wwgfd and I saw?

Are you sure the linux.conf support has been merged in the kernel??? I remember someone commenting that it hasn't been merged yet.

Offline

#35 2012-11-29 14:51:33

jumperpunk
Member
Registered: 2009-01-19
Posts: 21

Re: installing arch on efi/uefi 64bit motherboard

89c51 wrote:

[...]Are you sure the linux.conf support has been merged in the kernel??? I remember someone commenting that it hasn't been merged yet.

No, I'm not sure. My understanding was that it was supposed to be included in 3.7, and the current git is an RC, so I assumed it would be there. Unfortunately, I didn't even get it to boot from the UEFI shell, so I couldn't even really test it.

Offline

#36 2012-12-03 02:55:12

wwgfd
Member
From: UK
Registered: 2012-10-11
Posts: 32

Re: installing arch on efi/uefi 64bit motherboard

WonderWoofy wrote:

...my computer was really picky about where my initramfs was.  It did not like it being in /EFI/arch, so when I moved it to the root of the ESP on a whim, it suddenly worked...

I'm still working to try to fix my UEFI boot setup...
Any idea who manufactured you computer's motherboard please? -- just in case I or other people might have to make the same tweaks as you
It'd be great if you've got the motherboard model and 'BIOS' version too!

Of course failing any of that, just the computer make and model might give people enough to chase up the rest of the info for themselves.

FYI mine's an MSI "Z77MA-G45" running it's original release BIOS version (for now)


Thanks


What would Gordon Freeman do?

Offline

#37 2012-12-03 03:01:59

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: installing arch on efi/uefi 64bit motherboard

I have a Lenovo ThinkPad Edge E430.  So it is Lenovo branded and Lenovo firmware.  It is Phoenix Securecore Tiano though... not sure what else I can tell you, as I obviously don't have the same kind of info that I would if I had built a computer.

Offline

#38 2012-12-03 03:05:14

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: installing arch on efi/uefi 64bit motherboard

jumperpunk wrote:

@WonderWoofy, what symptoms did you see before moving the files? Was it similar to what wwgfd and I saw?

It was basically truncating part of the initrd= line, so everytime it would tell me it could not read the initrd.  It was loading the kernel though since that portion is fed to the efibootmgr command directly instead of being piped, coverted, then piped again.

I taked with the.ridikulus.rat who just got one of the same machines as I have, and he was having the exact same problem.  I have to imagine it is a firmware bug, as this method works for others quite well.

Offline

#39 2012-12-03 12:28:51

jumperpunk
Member
Registered: 2009-01-19
Posts: 21

Re: installing arch on efi/uefi 64bit motherboard

WonderWoofy wrote:
jumperpunk wrote:

@WonderWoofy, what symptoms did you see before moving the files? Was it similar to what wwgfd and I saw?

It was basically truncating part of the initrd= line, so everytime it would tell me it could not read the initrd.  It was loading the kernel though since that portion is fed to the efibootmgr command directly instead of being piped, coverted, then piped again.

I taked with the.ridikulus.rat who just got one of the same machines as I have, and he was having the exact same problem.  I have to imagine it is a firmware bug, as this method works for others quite well.

It sounds like there is a character limit that the firmware would take on the arguments line. Would it show the full argument line if you did an 'efibootmgr -v'? I had been using the partuuid to identify root, I may need to switch to /dev/sdaX.

UDPATE:
I made my argument line as short as possible, and I still have the same problem.

Last edited by jumperpunk (2012-12-03 12:51:27)

Offline

#40 2012-12-04 14:02:11

jumperpunk
Member
Registered: 2009-01-19
Posts: 21

Re: installing arch on efi/uefi 64bit motherboard

hmm... for kicks, I just installed Ubuntu to see how it handled the EFI stuff. It installed and booted just fine using EFI. It uses Grub, booting from an efi file located in the standard (\EFI\ubuntu\) location without passing any arguments. I am wondering if there is a bug in my firmware that prevents it from accepting arguments right.

@srs5694: does rEFInd use just an .efi file, or does it pass arguments to the efi?

Offline

#41 2012-12-04 16:13:02

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

Re: installing arch on efi/uefi 64bit motherboard

rEFInd passes arguments to the kernel, but it does not require that they be entered in your NVRAM. Since it seems you've got either a buggy firmware or a problem in entering the right data into the NVRAM, it's unlikely that this problem would affect rEFInd.

Offline

#42 2012-12-05 10:18:21

89c51
Member
Registered: 2012-06-05
Posts: 741

Re: installing arch on efi/uefi 64bit motherboard

jumperpunk wrote:
89c51 wrote:

[...]Are you sure the linux.conf support has been merged in the kernel??? I remember someone commenting that it hasn't been merged yet.

No, I'm not sure. My understanding was that it was supposed to be included in 3.7, and the current git is an RC, so I assumed it would be there. Unfortunately, I didn't even get it to boot from the UEFI shell, so I couldn't even really test it.


To answer this. There was a patch on the lkml (https://lkml.org/lkml/2012/3/18/45) but by looking at the kernel code -not that i understand much of it- it hasn't been merged. Maybe someone has to bug the maintainer or something. Anyway.

Offline

#43 2012-12-05 12:41:10

jumperpunk
Member
Registered: 2009-01-19
Posts: 21

Re: installing arch on efi/uefi 64bit motherboard

Looks like I'm going to give rEFInd a try then. I'll update with the results.

[update]
IT WORKS! Thank you! Now I just need to play with the settings to make rEFInd pretty (it wouldn't take my 1920x1080 res, lol) and customize it to make it, well... customized.

One suggestion, you may want to have it ignore the default \EFI\boot\bootx64.efi if Windows is installed. At least in my case, Windows 8 installed its bootloader here adn the \EFI\Microsoft as a "just in case" for hard-coded UEFIs. I am going to edit my refind file to ignore that directory, so it isnt a big deal, and it may break more people by default rather than help them.

Last edited by jumperpunk (2012-12-05 20:55:33)

Offline

#44 2012-12-06 18:27:10

wwgfd
Member
From: UK
Registered: 2012-10-11
Posts: 32

Re: installing arch on efi/uefi 64bit motherboard

Hey, just thought I'd update my status on this thread --> I finally got my Kernel native 'EFISTUB' based boot loader working for Arch (YAY) !!!
On my 120GB Kingspec SSD I get a 'cold' to login screen boot time of 3-4 seconds big_smile

How I achieved this small miracle:
In all honesty credit here goes to the likes of srs5694 and WonderWoofy for some very helpful posts / contributions to this thread!

So what I did was just to use the efibootmgr tool to remove my old, broken Arch EFI boot entry, then I put my Kernel parameters in to a text file (rather than pass them on the command line) and used a modified command based on srs5694's example (and the one provided in the Arch Wiki's Beginner's Guide) to reference this file, the result being....

$ cat /boot/kparams.txt | iconv -f ascii -t ucs2 | efibootmgr -c -L "Arch Linux x86_64" -l '\boot\EFI\arch\vmlinuz-arch.efi' --@ - 

...or something like that.

Given my experiences in trying to get this to work, along with the fact that I remember reading somewhere (unfortunately I can't find the link now) that the next Kernel release will support reading the boot params in from a text/config file, I recommend using this approach now as it should get you up and running and it'll make tweaking or altering your preferred Kernel parameters easier (as you can simply edit the text file and then just re-create the new (U)EFI boot entry with 'efibootmgr') -- plus it'll prepare your system for this future functionality of the Kernel!

Best of luck folks wink


What would Gordon Freeman do?

Offline

#45 2012-12-11 15:02:39

jumperpunk
Member
Registered: 2009-01-19
Posts: 21

Re: installing arch on efi/uefi 64bit motherboard

Unfortunately, I had already tried passing the arguments from a file (both by piping it through iconv and by pointing the '-@' argument to a file) as wwgfd suggested, and it made no difference for me. I tried it again just to see if I missed something, and it still does not work. I'm about 98% sure that it is an issue with the UEFI on my laptop (Dell Precision M4600).

I'll just be using rEFInd. As I'm dual-booting with Windows 8, it works well.

Offline

#46 2013-01-29 10:49:56

kozaki
Member
From: London >. < Paris
Registered: 2005-06-13
Posts: 671
Website

Re: installing arch on efi/uefi 64bit motherboard

Interesting thread (with a clear title smile
I got hooked trying to install Arch64 on a uefi mobo til I did as quoted in the wiki, i.e.:

swordfish wrote:

Alan, I got here an Asrock H77M-ITX board. Asrock is - as far as I know - a sub-division of Asus. With this information and the advice of the user the.ridikulus.rat I was able to create an USB stick that boots in UEFI mode.

I can confirm this on an Asrock B75Pro ufi 64-bit mobo with an ssd that I partitionned using gdisk (GPT, 1 GB vfat partition + 200 MB boot with arch kernel & initramfs installed during install + lvm). Thank you the.ridikulus.rat, swordfish and Rod smith! Booting in USB (uefi) and checking as follows:

AlanF00 wrote:

According to the Arch Beginner's Guide ( https://wiki.archlinux.org/index.php/Beginners%27_Guide ) you should do this to find out if you booted in UEFI mode:

# modprobe efivars       # before chrooting
# ls -1 /sys/firmware/efi/vars/

.

Shows the directory /sys/firmware/efi/vars/ as required.

So after one finally succeeds booting from uefi usb media, all is needed is to chroot, and (re)install the bootloader  into preinstalled Arch (or (re)install Arch from chroot) is that it?
Am asking the more knowledgeable person, as this is omitted in both guide, or I missed it after a couple of  short nights reading about uefi, gpt, alignment and digging into my mobos and hardware components (damn rusted screws)

EDIT: Oh m'lord but how do you tell rEFInd that it should load the kernel from sda2 /boot?
Or since it finds it automatically,

As of refind-efi 0.6.5-1, refind now automatically detects kernels in /boot by default.

  then why are these steps in https://wiki.archlinux.org/index.php/UE … ing_rEFInd for:
Copy /usr/lib/refind/config/refind_linux.conf to /boot/efi/EFI/arch/refind_linux.conf (i.e. where the EFISTUB kernel is), then edit it with e.g.:

"Boot with defaults" "root=PARTUUID=3518bb68-d01e-45c9-b973-0b5d918aae96 ro rootfstype=ext4 add_efi_memmap systemd.unit=graphical.target"

Since from http://www.rodsbooks.com/refind/drivers.html « there's no EFI driver for Linux's Logical Volume Manager (LVM) » ?

Having done as instructed in wiki:UEFI_Bootloaders#Using_rEFInd then got ou from chroot and unmounted /{(boot/efi),home} and rebooted, was presented with 2 new rEFInd entries (yes!), each showing the 2 EFI\arch_grub\grubx64*.efi that were installed during install (and yes it looks funky wink)
Grub starts the logical volumes, and then can't find ROOT as the partuuid is the one from the third partition or physical volume.
Which 1) confirms I cannot take care of more than one thing at a time as she says :-(
and 2) so we should edit refind_linux.conf with something like this if using LVM?:

/boot/efi/EFI/arch/refind_linux.conf

"Boot with defaults" "root=/dev/mapper/arch-root ro rootfstype=ext4 add_efi_memmap"
"Boot to Terminal"   "root=/dev/mapper/arch-root ro rootfstype=ext4 add_efi_memmap 3"

to help those of us that use LVM NOT use the partuuid scheme?

Some references:
LVM and EFIStub booting
https://wiki.archlinux.org/index.php/UE … ing_rEFInd
ArchLinux 2012.7.15 UEFI+GPT+LVM+LUKS on an Asus EeePc 1215b

Last edited by kozaki (2013-01-29 13:59:20)


Seeded last month: Arch 50 gig, derivatives 1 gig
Desktop @3.3GHz 8 gig RAM, linux-ck
laptop #1 Atom 2 gig RAM, Arch linux stock i686 (6H w/ 6yrs old battery smile) #2: ARM Tegra K1, 4 gig RAM, ChrOS
Atom Z520 2 gig RAM, OMV (Debian 7) kernel 3.16 bpo on SDHC | PGP Key: 0xFF0157D9

Offline

Board footer

Powered by FluxBB