Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
can't finish UEFI installation booting from the minimal cd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
JohnN
Apprentice
Apprentice


Joined: 05 Jul 2005
Posts: 158
Location: Claremont, CA

PostPosted: Mon Sep 25, 2017 4:47 am    Post subject: can't finish UEFI installation booting from the minimal cd Reply with quote

I've gotten all the way to the end of the installation handbook with a brand new machine. I have a /dev/sda1 partition with a vfat filesystem mounted at /boot.

I did these final instructions from the handbook:

Code:
mkdir -p /boot/efi/boot
root #cp /boot/vmlinuz-* /boot/efi/boot/bootx64.efi

But the final command

Code:
root #efibootmgr --create --disk /dev/sda --part 2 --label "Gentoo" --loader "\efi\boot\bootx64.efi"


gives the "gentoo efi variables are not supported on this system". I see in multiple posts that the minimal cd will not book in UEFI mode and therefore the efivar file system is not available for this final step.

My ASRock Taichi x370 MB gives multiple UEFI boot options but none of them find this boot location. They all hang or ask for a boot medium. What can I do to boot my new kernel (with all the necessary EFI stuff) and system?
Back to top
View user's profile Send private message
JohnN
Apprentice
Apprentice


Joined: 05 Jul 2005
Posts: 158
Location: Claremont, CA

PostPosted: Mon Sep 25, 2017 4:56 am    Post subject: Reply with quote

The disk is formatted GPT, by the way. I see lots of instructions for systems that already have Windows on them or using a Fedora CD. But surely by now there's a Gentoo way to do this??
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2337

PostPosted: Mon Sep 25, 2017 5:04 am    Post subject: Reply with quote

Yes, this is because the minimal CD doesn't have UEFI support. The solution is to use one that does.
_________________
First things first, but not necessarily in that order.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2440

PostPosted: Mon Sep 25, 2017 5:26 am    Post subject: Re: can't finish UEFI installation booting from the minimal Reply with quote

JohnN wrote:
But the final command

Code:
root #efibootmgr --create --disk /dev/sda --part 2 --label "Gentoo" --loader "\efi\boot\bootx64.efi"


gives the "gentoo efi variables are not supported on this system". I see in multiple posts that the minimal cd will not book in UEFI mode and therefore the efivar file system is not available for this final step.

Are you using --disk /dev/sda --part 2 for /dev/sda1?
    Guess it's a typing error? Then try:

  • have sysresccd bootable on a USB stick
  • start the computer from that USB stick
  • chroot into your just installed Gentoo
  • mount efivarfs rw
  • repeat your #efibootmgr --create --disk /dev/sda --part 2 --label "Gentoo" --loader "\efi\boot\bootx64.efi"
Back to top
View user's profile Send private message
JohnN
Apprentice
Apprentice


Joined: 05 Jul 2005
Posts: 158
Location: Claremont, CA

PostPosted: Mon Sep 25, 2017 1:42 pm    Post subject: Re: can't finish UEFI installation booting from the minimal Reply with quote

charles17 wrote:
JohnN wrote:
But the final command

Code:
root #efibootmgr --create --disk /dev/sda --part 2 --label "Gentoo" --loader "\efi\boot\bootx64.efi"


gives the "gentoo efi variables are not supported on this system". I see in multiple posts that the minimal cd will not book in UEFI mode and therefore the efivar file system is not available for this final step.

Are you using --disk /dev/sda --part 2 for /dev/sda1?
    Guess it's a typing error? Then try:

  • have sysresccd bootable on a USB stick
  • start the computer from that USB stick
  • chroot into your just installed Gentoo
  • mount efivarfs rw
  • repeat your #efibootmgr --create --disk /dev/sda --part 2 --label "Gentoo" --loader "\efi\boot\bootx64.efi"


No, I just copied and pasted that line from the Gentoo manual. I was using the correct partiition number.

Can you tell me how to find an image to make a bootable USB stick or cdrom?
Back to top
View user's profile Send private message
tuggbuss
Tux's lil' helper
Tux's lil' helper


Joined: 20 Mar 2017
Posts: 144

PostPosted: Mon Sep 25, 2017 1:45 pm    Post subject: Re: can't finish UEFI installation booting from the minimal Reply with quote

JohnN wrote:
charles17 wrote:
JohnN wrote:
But the final command

Code:
root #efibootmgr --create --disk /dev/sda --part 2 --label "Gentoo" --loader "\efi\boot\bootx64.efi"


gives the "gentoo efi variables are not supported on this system". I see in multiple posts that the minimal cd will not book in UEFI mode and therefore the efivar file system is not available for this final step.

Are you using --disk /dev/sda --part 2 for /dev/sda1?
    Guess it's a typing error? Then try:

  • have sysresccd bootable on a USB stick
  • start the computer from that USB stick
  • chroot into your just installed Gentoo
  • mount efivarfs rw
  • repeat your #efibootmgr --create --disk /dev/sda --part 2 --label "Gentoo" --loader "\efi\boot\bootx64.efi"


No, I just copied and pasted that line from the Gentoo manual. I was using the correct partiition number.

Can you tell me how to find an image to make a bootable USB stick or cdrom?


I use rescuecd: http://www.system-rescue-cd.org/
Back to top
View user's profile Send private message
JohnN
Apprentice
Apprentice


Joined: 05 Jul 2005
Posts: 158
Location: Claremont, CA

PostPosted: Mon Sep 25, 2017 1:47 pm    Post subject: Reply with quote

The Doctor wrote:
Yes, this is because the minimal CD doesn't have UEFI support. The solution is to use one that does.


Oh, I see the link there now. I'll try that one. Thanks!
Back to top
View user's profile Send private message
JohnN
Apprentice
Apprentice


Joined: 05 Jul 2005
Posts: 158
Location: Claremont, CA

PostPosted: Wed Sep 27, 2017 5:35 am    Post subject: Reply with quote

So, that USB image mounted once with efivars active, but on subsequent reboots I can't find a single boot option that activates it. What might have happened?
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2440

PostPosted: Wed Sep 27, 2017 5:42 am    Post subject: Reply with quote

JohnN wrote:
So, that USB image mounted once with efivars active, but on subsequent reboots I can't find a single boot option that activates it. What might have happened?

Did you chroot into your Gentoo installation?
Could you access efivarfs from inside the chroot?
Code:
$ mount | grep efiv

efivarfs on /sys/firmware/efi/efivars type efivarfs (ro,relatime)
Back to top
View user's profile Send private message
JohnN
Apprentice
Apprentice


Joined: 05 Jul 2005
Posts: 158
Location: Claremont, CA

PostPosted: Thu Sep 28, 2017 2:44 am    Post subject: Reply with quote

Idk what happened. I re-burned the rescue image, and now when I chroot into the Gentoo installation, I get efivarfs and can use efibootmgr. I still can't get the kernel to boot, though. I have /dev/sda1 formatted gpt, formatted fat32. Parted shows the boot and esp flags. I put a copy of the new kernel in an EFI/Gentoo subdirectory, and issued this command:

Code:
efibootmgr --create --disk /dev/sda --partition 1 --label "Gentoo Linux" -l "\EFI\Gentoo\vmlinuz-4.12.12-gentoo.efi"


I used the same partition to mount as /boot while chrooted, and the kernel make install put a matching SystemMap file there. I wasn't expecting that. I copied it to the EFI directory as well.

The kernel shows correctly with efibootmgr -v and it looks right in the motherboard's boot menu as well, but it just hangs when I try to boot it. I'm only booting the one installation, and I really thought UEFI would be way easier than messing with Grub2 as I have in the past. So far, no joy.

My root directory is a mdadm raid array (not the efi boot partition), which could be a problem, but I think I'm not even getting that far yet. (I also need to figure out how to pass the mdadm raid mount at / at boot time.)

It seems like sometimes the rescue USB stick is actually booting the new kernel, even though I didn't choose that option. It always hangs, usually at RAID or LVM.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2440

PostPosted: Thu Sep 28, 2017 5:47 am    Post subject: Reply with quote

Are you trying to go without external bootloaders like grub2? If so, did you read the EFI stub kernel wiki article? Then be sure your kernel's CONFIG_CMDLINE points to your root directory.

Next question:
Are you sure you are going to use lvm? In that case you need to use an initramfs, see topic 1068042.

Anyway, if your kernel fails to boot, it is still possible you've missed to activate some important kernel option. In that case, again sysresccd could be of help as it provides a boot option for booting an already installed linux system. It then uses sysresccd's kernel+initramfs for booting your system.
Back to top
View user's profile Send private message
JohnN
Apprentice
Apprentice


Joined: 05 Jul 2005
Posts: 158
Location: Claremont, CA

PostPosted: Thu Sep 28, 2017 5:44 pm    Post subject: Reply with quote

charles17 wrote:
Are you trying to go without external bootloaders like grub2? If so, did you read the EFI stub kernel wiki article? Then be sure your kernel's CONFIG_CMDLINE points to your root directory.

Next question:
Are you sure you are going to use lvm? In that case you need to use an initramfs, see topic 1068042.

Anyway, if your kernel fails to boot, it is still possible you've missed to activate some important kernel option. In that case, again sysresccd could be of help as it provides a boot option for booting an already installed linux system. It then uses sysresccd's kernel+initramfs for booting your system.


When I try that, it fails with error "/newroot/sbin/init no such file"

The only thing I saw that I missed was the EFI Stub instruction to configure "CONFIG_EFI_VARS=m", as a module. I fixed that. CONFIG_CMDLINE is "root=/dev/md3", so that assumes that the RAID array gets set up. That's kind of mystery to me how that happens. It still will not load. My motherboard bootloader shows the update boot list, but it hangs when I try to boot from the /dev/sda1 boot partition. I am so stuck at this point.

Yes, my goal is to go without any external bootloader. I think I followed the EFI stub kernel instructions correctly.

I don't intend to use lvm for anything. I want just mdadm RAID 1 for the / directory if possible.


Last edited by JohnN on Fri Sep 29, 2017 5:38 pm; edited 2 times in total
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2440

PostPosted: Thu Sep 28, 2017 6:19 pm    Post subject: Reply with quote

JohnN wrote:
I want just mdadm RAID 1 for the / directory if possible.

Can raid 1 work without an initramfs? Or did you create one?
Back to top
View user's profile Send private message
JohnN
Apprentice
Apprentice


Joined: 05 Jul 2005
Posts: 158
Location: Claremont, CA

PostPosted: Fri Sep 29, 2017 1:04 am    Post subject: Reply with quote

charles17 wrote:
JohnN wrote:
I want just mdadm RAID 1 for the / directory if possible.

Can raid 1 work without an initramfs? Or did you create one?

I didn't see anything in Gentoo's mdadm instructions that said an initramfs is needed.

I think I'm going to take the RAID out of the equation for now, until I make sure I can make a kernel that will boot.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum