Difference between revisions of "Pure UEFI Boot Guide"

From Funtoo
Jump to navigation Jump to search
m
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This tutorial will show you how to install Funtoo on a UEFI system. UEFI, also known as the [[Wikipedia:Unified Extensible Firmware Interface|Unified Extensible Firmware Interface]], is a new firmware interface that is used on some newer computers as a replacement for the traditional PC BIOS. It has an integrated boot loader, so setting up booting is different. The recommended approach is to follow the [[ UEFI_Install_Guide#EFI_Stub_method | Efi Stub Method ]]. Many have reported that they are now unable to boot their system using the other, older method.
This tutorial will show you how to install Funtoo on a UEFI system. UEFI, also known as the [[Wikipedia:Unified Extensible Firmware Interface|Unified Extensible Firmware Interface]], is a new firmware interface that is used on some newer computers as a replacement for the traditional PC BIOS. It has an integrated boot loader, so setting up booting is different. The recommended approach is to follow the. Many have reported that they are now unable to boot their system using the other, older method.
 
This tutorial is meant to be an "overlay" over the Regular Funtoo Installation. Follow the normal installation and only follow steps in this tutorial when dealing with partitioning and configuring the boot loader (GRUB). All steps are otherwise identical to the regular installation process.
This tutorial is meant to be an "overlay" over the Regular Funtoo Installation. Follow the normal installation and only follow steps in this tutorial when dealing with partitioning and configuring the boot loader (GRUB). All steps are otherwise identical to the regular installation process.


== What Are We Doing? ==
== What Are We Doing? ==


This guide will show you how to set up your UEFI system to load the GRUB boot loader, which will then load your Funtoo Linux kernel and initramfs. This is the "UEFI + GRUB" method as described on the [[Boot Methods]] page.
This guide will show you how to set up your UEFI system with EFI-stub method.


== First Steps ==
== First Steps ==
Line 15: Line 14:
== Partitioning ==
== Partitioning ==


To set up your partitions for UEFI booting, you will create a ~500MB FAT32 partition on <tt>/dev/sda1</tt>, and set it to type <tt>EF00</tt> using <tt>gdisk</tt>.  
To set up your partitions for UEFI booting, you will create a ~500MB FAT32 partition on <code>/dev/sda1</code>, and set it to type <tt>EF00</tt> using <tt>gdisk</tt>.  


<console>
<console>
# gdisk /dev/sda
Command: ##i##n ↵
Command: ##i##n ↵
Partition Number: ##i##1 ↵
Partition Number: ##i##1 ↵
Line 25: Line 25:
</console>
</console>


This partition will serve as your Funtoo <tt>/boot</tt> filesystem as well as the partition that the UEFI firmware can read to load GRUB. Then you will set up swap on <tt>/dev/sda2</tt> and your root filesystem on <tt>/dev/sda3</tt>. To create the FAT32 filesystem, type:
This partition will serve as your Funtoo <code>/boot</code> filesystem as well as the partition that the UEFI firmware can read to load GRUB. Then you will set up swap on <code>/dev/sda2</code> and your root filesystem on <code>/dev/sda3</code>. To create the FAT32 filesystem, type:


<console>
<console>
Line 31: Line 31:
</console>
</console>


Your <tt>/etc/fstab</tt> entry for this filesystem will also differ, and will look like this:
Your <code>/etc/fstab</code> entry for this filesystem will also differ, and will look like this:


<pre>
<pre>
Line 72: Line 72:
[*] Built-in kernel command line
[*] Built-in kernel command line
(kernel options that you want to pass go here)
(kernel options that you want to pass go here)
}}
{{note|Commands that you would normally pass, such as, <code>video{{=}}uvesafb:1920x1080-32,mtrr:3,ywrap</code>, should be put here. In other words, anything that you would normally add to <code>/etc/boot.conf</code> after <code>params +{{=}}</code> should be added to the built-in kernel command line as well.}}
{{important|You should specifiy the position of your rootfs here. For example: <code>root{{=}}/dev/sdb1</code>.}}
If your system requires an initramfs to boot, do not worry, you can build that in to the kernel. One thing that you should know, however, is that the kernel only takes plaintext and <code>.cpio</code> files for initramfs source files. Therefore, if you use an application to generate an initramfs for you, make sure that it does not use gzip compression. To build better-initramfs-bin without gzip compression, disable the gzip use flag for the package:
{{file|name=/etc/portage/package.use|desc= |body=
sys-kernel/better-initramfs-bin -gzip
}}
then emerge better-initramfs:
<console>
###i## emerge better-initramfs-bin
</console>
If you check in your <code>/boot</code> directory, you should see a file called <code>initramfs.cpio</code>. See below to include this file in your kernel.
{{kernelop|title=General setup|desc=
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
(/path/to/initramfs/file.cpio)
For better-initramfs-bin:
(/boot/initramfs.cpio)
}}
}}


Line 96: Line 77:
After you have configured your kernel, build it, install it to <code>/boot</code>, and then create a copy of the image to store in the EFI boot directory:
After you have configured your kernel, build it, install it to <code>/boot</code>, and then create a copy of the image to store in the EFI boot directory:
<console>
<console>
###i## pwd
###i## cd /usr/src/linux
/usr/src/linux
###i## make -jn ##!i##(replace 'n' with CPU core numbers)
###i## make -jn
###i## make -jn install modules_install
###i## make -jn install modules_install
###i## mkdir -vp /boot/EFI/Boot
###i## mkdir -vp /boot/EFI/Boot
###i## cp -v /boot/vmlinuz-x.x.x /boot/EFI/Boot/bootx64.efi
###i## cp -v /boot/vmlinuz-x.x.x /boot/EFI/Boot/bootx64.efi
</console>
</console>
When you have finished all of this, you should be able to reboot and enjoy yor new Funtoo system!
You should be able to reboot and enjoy yor new Funtoo system!

Latest revision as of 19:05, January 28, 2017

This tutorial will show you how to install Funtoo on a UEFI system. UEFI, also known as the Unified Extensible Firmware Interface, is a new firmware interface that is used on some newer computers as a replacement for the traditional PC BIOS. It has an integrated boot loader, so setting up booting is different. The recommended approach is to follow the. Many have reported that they are now unable to boot their system using the other, older method. This tutorial is meant to be an "overlay" over the Regular Funtoo Installation. Follow the normal installation and only follow steps in this tutorial when dealing with partitioning and configuring the boot loader (GRUB). All steps are otherwise identical to the regular installation process.

What Are We Doing?

This guide will show you how to set up your UEFI system with EFI-stub method.

First Steps

To install Funtoo Linux on a UEFI system, first you need to boot SysRescueCD in UEFI mode. To do this, enable UEFI in your BIOS, and if necessary disable legacy booting. After some fiddling, you should be able to boot SysRescueCD and get a black and white text menu instead of the traditional aqua/cyan-colored menu. The black and white menu indicates that you booted SysRescueCD in UEFI mode. Once you've accomplished this, you're ready to continue with your Funtoo Linux installation and partition your drive. See below for details.

   Note

If the /sys/firmware/efi directory exists, then you have successfully booted in EFI mode and will be able to configure your Funtoo system to boot in EFI mode. If the directory doesn't exist, fix this first. It is a requirement for setting up EFI booting.

Partitioning

To set up your partitions for UEFI booting, you will create a ~500MB FAT32 partition on /dev/sda1, and set it to type EF00 using gdisk.

root # gdisk /dev/sda
Command: n ↵
Partition Number: 1 ↵
First sector: 
Last sector: +500M ↵
Hex Code: EF00

This partition will serve as your Funtoo /boot filesystem as well as the partition that the UEFI firmware can read to load GRUB. Then you will set up swap on /dev/sda2 and your root filesystem on /dev/sda3. To create the FAT32 filesystem, type:

root # mkfs.vfat -F 32 /dev/sda1

Your /etc/fstab entry for this filesystem will also differ, and will look like this:

/dev/sda1		/boot		vfat		noatime	1 2

Kernel

VFAT

Make sure you add VFAT support to your kernel if you are building it manually.

EFI Framebuffer

If you have the following option enabled in your kernel, then uvesafb and efifb will not be able to detect the framebuffer:

Under Bus options (PCI etc.):

[*] Mark VGA/VBE/EFI FB as generic system framebuffer (NEW)

If you have that option enabled, you must also enable:

Under Device Drivers-->Graphics support-->Frame buffer Devices:

[*]   Simple framebuffer support

This is the preferred method of using the EFI framebuffer, the efifb and uvesafb drivers will be used as a fallback if the above is not compatible.

Boot Loader

EFI Stub method

Instead of bothering with the installation of GRUB and the risk that your system will not boot, you should consider using the UEFI firmware of your computer to boot your kernel. not only does this method reduce boot times slightly, it also removes the hassel of dealing with and configuring a bootloader.

Kernel Configuration

To prepare your kernel to boot with EFI stub, make sure that the following options are built in to your kernel: Under Processor type and features:

[*] EFI runtime service support
[*]     EFI stub support
[ ]         EFI mixed-mode support

[*] Built-in kernel command line
(kernel options that you want to pass go here)

Building and installing the kernel

After you have configured your kernel, build it, install it to /boot, and then create a copy of the image to store in the EFI boot directory:

root # cd /usr/src/linux
root # make -jn (replace 'n' with CPU core numbers)
root # make -jn install modules_install
root # mkdir -vp /boot/EFI/Boot
root # cp -v /boot/vmlinuz-x.x.x /boot/EFI/Boot/bootx64.efi

You should be able to reboot and enjoy yor new Funtoo system!