Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Question regarding partitions in UEFI boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Silmano
n00b
n00b


Joined: 10 Mar 2012
Posts: 59

PostPosted: Mon Oct 08, 2012 8:12 am    Post subject: Question regarding partitions in UEFI boot Reply with quote

After reading some documentation on how to set up an UEFI installation of Gentoo I have a question regarding /boot partition that I haven't been able to find an answer.

The idea I have in mind is building a EFI_STUB kernel to be able to boot directly from it, so I have to copy the kernel to a visible EFI partition. I'm used to mount a separate partition for /boot, but do I need it here or just the efi partition will sufice?

Don't know if the best is to have something like this:
Code:
/dev/sda1   200M   FAT32   EFI System   /efi
/dev/sda2   200M   ext2   Linux Boot   /boot
/dev/sda3   rest   ext4   Linux      /

Or I can avoid the boot partition and simply use the efi on in either /boot (as FAT32) or any other directory?
Code:
/dev/sda1   200M   FAT32   EFI System   /boot/efi
/dev/sda2   rest   ext4   Linux      /


Any suggestion will be apreciated.
Back to top
View user's profile Send private message
pigeon768
l33t
l33t


Joined: 02 Jan 2006
Posts: 683

PostPosted: Mon Oct 08, 2012 3:30 pm    Post subject: Reply with quote

A separate /boot directory is not strictly required in your case.

It might be a good idea to have one anyway though.
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Mon Oct 08, 2012 4:12 pm    Post subject: Reply with quote

There are people who successfully mount the EFI System Partition (ESP) as /boot. This is playing a bit fast and loose with the EFI specs, since they don't mention Linux kernels, or boot loader programs, in the root of the ESP; you're supposed to put them in subdirectories of the EFI's /EFI directory. Of course, you could just store your kernel and initrd in /boot/EFI/gentoo instead of in /boot in order to follow the letter of the EFI "law." Other stuff that Linux might put in /boot (like GRUB files, if you install GRUB) isn't mentioned by the EFI spec, too. In practice, these Linux-specific additions don't cause problems, but it's conceivable there'll be a conflict at some point in the future or with some particularly fussy (or buggy) EFI implementation.

Another option is to use a separate /boot partition, as is common with Linux, but use FAT on it. That way, the EFI will be able to read it and you should be able to add your kernel as a boot loader program, either directly to the EFI's NVRAM or by using another boot manager like rEFInd or gummiboot. A variant on this option is to use ext2fs, ext3fs, or ReiserFS on /boot and add an EFI driver for the filesystem you use to your EFI's configuration. rEFInd ships with drivers for all these filesystems. (The ext2fs driver handles both ext2fs and ext3fs.)
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21605

PostPosted: Tue Oct 09, 2012 1:50 am    Post subject: Reply with quote

The mount location is invisible to UEFI. UEFI needs to find an EFI System Partition and to find within that partition an EFI program registered as a bootloader. When you build the kernel with its EFI stub support, the kernel becomes its own bootloader. In that case, copy the kernel vmlinuz to the ESP in an appropriate subdirectory and use efibootmgr to register it as a bootloader. The path from the root of the ESP to the binary is part of the registration, so that the UEFI code does not need to search the ESP to find the EFI program.
Back to top
View user's profile Send private message
Silmano
n00b
n00b


Joined: 10 Mar 2012
Posts: 59

PostPosted: Tue Oct 09, 2012 7:22 am    Post subject: Reply with quote

Thanks for the suggestions.

In the end I've used /boot/efi as EFI partition and I haven't made a separate partition for /boot since the kernel loads from the EFI partition itself. Its pretty neat to be able to run a kernel from UEFI without the use of any bootloader. :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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