[SOLVED] arch with efi stub

Hi, i'm relatively new to the arch world and i am trying to install arch with efi stub. I want to ask, is there anyway to install arch and efi stub booting right away. Because i followed the guide for setting up efi stub and i saw that the guide applies to already installed arch, which i assume means that i need to have other bootloader like grub for e.g. to boot in my arch and then setup the new booting method. I want to make clean installation of arch and along the way install efi stub (efibootmgr) to boot directly in my arch without previously booting a bootloader like grub. My mobo is UEFI capable and i want to use arch with GPT and efi stub, nothing more . Anyway i'm experimenting on virutalbox before i try this on my machine because i want to train my self in doing this type of installation. I would be thankful if you provide me with any tips and links so i can learn this matter a bit better, thanks and cheers!

Re: [SOLVED] arch with efi stub

That is how I did it; it was just a case of partitioning the drive, chrooting for the install and then installing efibootmgr and, in my case, gummiboot and then creating the entries and copying the relevant files to the correct location. I read the wiki pages and it went pretty smoothly.

Re: [SOLVED] arch with efi stub

I followed the guide, i tried with refind and also i tried adding entry directly in the efibootmgr to invoke the kernel (not installing any bootloader like refind). In both cases, when i reboot, my virtual-machine goes in EFI shell (v 2.10).. It seems to me that the kernel is not being invoked, hmm? What can be the cause for this?

Re: [SOLVED] arch with efi stub

There have been a lot of really really horrible questions around here lately. There is the saying that there are no stupid questions, but this is not true. Seeking information is repsectable, but a poorly phrased question can certainly make it "bad". Please see cfr's signature and click on the first link of the two (and read the linked article of course).

If you wnat help, you are probably going to have to do better. More than that, if you don't want to be berated by the other members around here, you need to do better.

Re: [SOLVED] arch with efi stub

Ok, sorry for not providing what i did, here it is:

First i downloaded latest arch release. I create new virtual machine (arch x64 type, 8GB dynamically alocated) in virtualbox. In the settings for the machine i enabled EFI, added the iso in the virtual cd-rom and fired the machine. I picked the first entry in the arch startup menu (arch x86_64).

1. I ran this

gdisk /dev/sda

Then inputed "o" to create new GPT scheme. After that i created new 512MB ef00 partition (EFI System) as the first partition of the 8GB virtual HDD. And the second one 7.5GB as type 8300 (Linux filesystem) (i didn't created LVM since i don't think ill need it, i dont need the additional layer because i dont resize or do similar staff to my partitions, i just keep em fixed). So i had 2 partitions, one 512MB of type ef00, and the second one 7.5GB of type 8300.

2. I formated the partitions running this:

mkfs.vfat -F32 /dev/sda1 and mkfs.ext4 /dev/sda2

It went smoothly..

So far i my disk is properly partitioned and ready for next steps...

3. Mounted the partitions like so:

mount /dev/sda2 /mnt

mkdir /mnt/boot/efi -p

mount /dev/sda1 /mnt/boot/efi

4. I settup mirrors in the /etc/pacman.d/mirrorList and then run:

pacstrap /mnt/ base base-devel

Installation went smoothly...

5. This step is kinda awkward to me and i smell misconfiguration here, so please consider this one a bit carefully...Next i had to generate the filesystem table, so i get my partitions mounted at startup.. so i generated the fstab as so:

genfstab -U -p /mnt >> /mnt/etc/fstab

In the guide there was warning that the current kernel has an issue with the EFI system partition because of the options set by the fstab generator. I edited the fstab generated by the generator and in the fist entry, the one for sda2 (Linux filesystem partiton) i removed data=ordered because the guide says that this is irrelevant option as it is turned on by default. And in the second entry, the one for sda1 (EFI system partition) i removed everything except "codepage=cp437" which i replaced with "codepage=437". The guide says something about this option being rewritten but i got a bit confused since first it says remove everything except "noatime" which was not present in my fstab, and then says to rewrite the codepage one, removing the cp part???

6. Did arch-chroot /mnt to jump to my new installation and did some locale and similar configurations. Configured pacman to include multilib section and upgraded it using -Syy. Changed root pass and created new user part of the wheel group for sudo previlages.

7. Since i started my installation with efi support i didn't have to reboot my vbox so i continued with the next step, setting up the boot method. First i loaded efivars using the modprobe to load the module efivars. Then i created /boot/efi/EFI/arch folder structure, copied the kernel, images for ram blocks and fallback (vmlinuz, initramfs, initramfs-..-fallback) into /boot/efi/EFI/arch.

Re: [SOLVED] arch with efi stub

OK. I'm not sure about that fstab entry but I'm pretty sure it isn't the problem. As far as I know, the EFI partition doesn't need to be mounted at all except for updates. Moreover, the system is clearly not getting to the point of reading fstab.

Can you do this:

modprobe efivars
efibootmgr -v

and post the output?

EDIT: You could also try copying /boot/efi/EFI/arch_refind/refindx64.efi to /boot/efi/EFI/boot/bootx64.efi which might get it booted even if the efibootmgr entry isn't working for some reason.

EDIT 2: I just reread your earlier post. When you updated did you just run pacman -Syy? If so, you need to go back and run pacman -Syu as you will have just updated the database - not the actual installed packages. Since you then went on to install at least the boot loader, you may have mismatched stuff.

EDIT 3: Also, you may need to modprobe efivars before chrooting in order to get the menu entry set up correctly.

Re: [SOLVED] arch with efi stub

stefo wrote:

I followed the guide, i tried with refind and also i tried adding entry directly in the efibootmgr to invoke the kernel (not installing any bootloader like refind). In both cases, when i reboot, my virtual-machine goes in EFI shell (v 2.10).. It seems to me that the kernel is not being invoked, hmm? What can be the cause for this?

In my experience, VirtualBox can't remember its EFI "NVRAM" entries when they're set via efibootmgr in Linux. You must either name your boot loader EFI/BOOT/bootx64.efi on the ESP or use the bcfg utility in a version 2 shell to get the entry to "stick."

And after i reboot the 5th entry is gone and the BootOrder is: 0000,0001,0002,0003,0004

One more question along the way.. The efibootmgr is changing the entries in the hardware right? It's just a handle so i can manipulate the efi software that is shipped with the mobo, if i get that right? And, if i plan to install win. single boot i will need to restore back the efi boot order and remove the entry added for arch, or the win installation fixes this?

Re: [SOLVED] arch with efi stub

See the post just above yours - it sounds like the memory issue is a virtualbox one so hopefully this will work OK when you do it for real.

I don't know anything about Windows however generally people seem to have to reset up their boot loaders etc. after installing Windows for dual boot so I'm assuming that it wipes this sort of thing. In any case, it would probably make the Windows boot the new default so even if the other one was still there, it wouldn't affect anything.

In my experience, the problem of keeping the entries is much more serious than the problem of their hanging around. If I reset my BIOS to defaults, for example, all the customised efibootmgr entries are wiped and it is back to factory settings. They are also easy to delete intentionally by hand. The boot order can also be changed in either BIOS or with efibootmgr on my machine.

Re: [SOLVED] arch with efi stub

yay! got it workin the prob. is that virtualbox can't remember efi entries across reboots... Now i have it up and running by renaming refindx64.efi into bootx64.efi and putting it inside /boot/efi/EFI/boot/I guess this is not going to be the issue if i try to install on my lap-top diretly? Because i plan to do so and i want to be sure beforehand.

Re: [SOLVED] arch with efi stub

Hmm, it seems to me that the entry i added with efibootmgr is not remembered after rebooting.. Here is what i have before reboot and after i add the entry in efi..

Judging by the time stamps, you were probably writing this just as I was posting my last message. Be sure to go back and read it if you missed it.

One more question along the way.. The efibootmgr is changing the entries in the hardware right? It's just a handle so i can manipulate the efi software that is shipped with the mobo, if i get that right?

Yes, that's right -- although in your case, since you're using VirtualBox, it's just virtual hardware. VirtualBox stores its settings in a file on the disk somewhere rather than in an actual NVRAM chip.

And, if i plan to install win. single boot i will need to restore back the efi boot order and remove the entry added for arch, or the win installation fixes this?

If you remove whatever boot loader files you installed, the firmware will skip over them and move on to the next one. Some implementations also seem to remove such "dead" entries automatically. Either way, you shouldn't need to make any adjustments unless the entry for Windows ends up getting removed from the boot list.

If you don't remove the files for your Linux boot loader, it will continue to launch. If it can chainload to the Windows boot loader and is designed sensibly, this will end up being an extra step in the boot process until you remove the Linux boot loader, but will otherwise do no harm -- Windows will continue to boot. Fedora's EFI-enabled GRUB Legacy, gummiboot, and rEFInd all operate in this way. GRUB 2 can, as well, although some configurations put some of its configuration files on /boot, which means it'll stop working if you remove Linux. (Ubuntu configures its GRUB 2 in this way, which I consider to be a bug.) ELILO and the kernel's EFI stub loader can't chainload and so can't be used as the first boot program in a dual-boot configuration to begin with.

Re: [SOLVED] arch with efi stub

stefo wrote:

I guess this is not going to be the issue if i try to install on my lap-top diretly? Because i plan to do so and i want to be sure beforehand.

More crossed postings!

Your laptop will probably remember its settings, but that's far from guaranteed. I own four EFI-based computers, three of which can reliably remember their settings. The fourth (a Gigabyte board that uses its "Hybrid EFI" implementation) can remember its settings for a reboot or two, but tends to forget them randomly. I've given up trying with it, and use rEFInd as EFI/BOOT/bootx64.efi on that system.

Re: [SOLVED] arch with efi stub

Glad you got it working.

As I said above, it shouldn't be an issue when you do it for real - not unless you have really, really buggy firmware. Besides, that would be far too easy - whatever trouble you run into is bound to be of a different kind - that's sod's law! Seriously, I'm sure you'll be fine and there is, in any case, only one way to know for certain...

Just remember to stay calm if you run into difficulties and post enough information for people to understand what you've tried, what you are trying to do and what the issue is. That way if you do come across any problems the wiki and google can't solve, you'll be likely to get effective (and less frustrated) advice from the beginning.

Re: [SOLVED] arch with efi stub

OK. More cross-postings. So I take back the "really, really buggy firmware". Make that just "buggy firmware". However, sod's law still applies so I'm sure if you have trouble it will be something you are not prepared for .

Note that I'm not sure what the current recommendations in the wiki are but when I set up grub 2 following the wiki's recommendations, I also installed some of the files grub needs to work on /boot. So that configuration, too, would be broken if I removed everything but the EFI stuff.

PS Don't forget to mark this solved by editing your first post and prepending the subject line with [solved].