Difference between pages "Subarches" and "UEFI Install Guide"

(Difference between pages)
m (corei7)
 
 
Line 1: Line 1:
{{:Install/Header}}
+
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 [[EFI Stub Guide ]].  
= Funtoo Linux Sub-Architectures =
+
__NOTITLE__
+
This page provides an overview of Funtoo Linux sub-architectures (also called ''subarches'',) designed for quick and easy reference. While this information is available in other places, such as Wikipedia, it often takes some time to study and cross-reference the various articles to get a good understanding of each type of sub-architecture, and this information generally isn't all collected neatly in one place. That is the purpose of this page. When possible, links to more detailed Wikipedia pages are provided. You are encouraged to help maintain this page as well as the Wikipedia articles referenced here.
+
  
== 64-bit Suport (Generic) ==
+
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.
  
=== generic_64 ===
+
== What Are We Doing? ==
<console>
+
 
CFLAGS: -mtune=generic -O2 -pipe
+
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.
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2
+
</console>
+
  
Produces code optimized for the most common IA32/AMD64/EM64T processors. As new processors are deployed in the marketplace, the behavior of this option will change. Therefore, if you upgrade to a newer version of GCC, code generation controlled by this option will change to reflect the processors that are most common at the time that version of GCC is released.
+
== First Steps ==
  
The '''generic_64''' subarch is designed to support 64-bit PC-compatible CPUs, such as the [[Wikipedia:AMD_K8|AMD K8-series processors]], which were introduced in late 2003. They were notable as the first processors that supported the [[Wikipedia:X86-64|AMD64 (also called X86-64) 64-bit instruction set]] for PC-compatible systems, which was introduced as a backwards-compatible 64-bit alternative to Intel's IA-64 architecture. Intel followed suit and also began supporting this 64-bit instruction set, which they called "[[Wikipedia:X86-64#Intel_64|Intel 64]]", by releasing X86-64 64-bit compatible CPUs from mid-2004 onwards (See [[Wikipedia:X86-64#Intel_64_implementations|Intel 64 implementations]].)
+
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.
  
AMD desktop 64-bit CPUs include the Athlon 64, Athlon 64 FX, Athlon 64 X2, Athlon X2, Turion 64, Turion 64 X2 and Sempron series processors. AMD server processors were released under the Opteron brand and have codenames SledgeHammer, Venus, Troy, Athens, Denmark, Italy, Egypt, Santa Ana and Santa Rosa. All Opterons released through late 2006 were based on the K8 microarchitecture with original X86-64 instructions.
+
{{fancynote|If the <tt>/sys/firmware/efi</tt> 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.}}
  
== 64-bit AMD Processors ==
+
== 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>.
  
=== amd64-k10 ===
 
 
<console>
 
<console>
CFLAGS: -march=amdfam10 -O2 -pipe
+
Command: ##i##n ↵
CHOST: x86_64-pc-linux-gnu
+
Partition Number: ##i##1 ↵
USE: mmx sse sse2 sse3 3dnow 3dnowext
+
First sector: ##i##↵
 +
Last sector: ##i##+500M ↵
 +
Hex Code: ##i##EF00
 
</console>
 
</console>
  
CPUs based on AMD Family 10h cores with x86-64 instruction set support. (This supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit instruction set extensions.)
+
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:
 
+
The '''amd64-k10''' subarch provides support for the [[Wikipedia:AMD_10h|AMD Family 10h processors]], which were released in late 2007 as a successor to the AMD K8 series processors.
+
 
+
Desktop amd64-k10 CPUs include [[Wikipedia:AMD Phenom|AMD Phenom]], [[Wikipedia:AMD_10h#Phenom_II_Models|AMD Phenom II]] and [[Wikipedia:AMD_10h#Athlon_II_Models|AMD Athlon II]]. Server CPUs include Opterons with codenames Budapest, Barcelona, Suzuka, Shanghai, Istanbul, Lisbon, and Magny-Cours. A full listing of amd64-k10 Opteron models [[Wikipedia:List_of_AMD_Opteron_microprocessors#K10_based_Opterons|can be found here]].
+
  
=== amd64-bulldozer ===
 
 
<console>
 
<console>
CFLAGS: -march=bdver1 -O2 -pipe
+
# ##i##mkfs.vfat -F 32 /dev/sda1
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 sse4 3dnow 3dnowext
+
 
</console>
 
</console>
  
CPUs based on AMD Family 15h cores with x86-64 instruction set support. (This supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
+
Your <tt>/etc/fstab</tt> entry for this filesystem will also differ, and will look like this:
  
The '''amd64-bulldozer''' subarch supports the [[Wikipedia:Bulldozer (microarchitecture)|AMD bulldozer microarchitecture]] CPUs, which were released from late 2011 through the first quarter of 2012 as a replacement for the [[Wikipedia:AMD_10h|K10 microarchitecture]] CPUs.
+
<pre>
Bulldozer desktop CPUs use the [[Wikipedia:Socket_AM3+|AM3+ socket]] and server CPUs use the  [[Wikipedia:Socket_G34|G34 socket]].
+
/dev/sda1 /boot vfat noatime 1 2
 +
</pre>
  
Desktop bulldozer CPUs include the [[Wikipedia:List_of_AMD_FX_microprocessors#.22Zambezi.22_.2832_nm_SOI.29|Zambezi FX-series CPUs]]. Server bulldozer CPUs include Opterons with codenames Zurich (Opteron 3200-series), Valencia (Opteron 4200-series) and Interlagos (Opteron 6200 series). A complete list of Opteron models [[Wikipedia:http://en.wikipedia.org/wiki/Opteron#Opteron_.2832_nm_SOI.29-_First_Generation_Bulldozer_Microarchitecture|can be found here.]].
+
== Kernel ==
  
=== amd64-piledriver ===
+
=== VFAT ===
<console>
+
CFLAGS: -march=bdver2 -O2 -pipe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 sse4 3dnow 3dnowext
+
</console>
+
  
AMD Family 15h core based CPUs with x86-64 instruction set support. (This supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
+
Make sure you add VFAT support to your kernel if you are building it manually.
  
The '''amd64-piledriver''' subarch supports the [[Wikipedia:Piledriver (microarchitecture)|AMD Piledriver microarchitecture]] produced by AMD from mid-2012 through 2015, which is the successor to the [[Wikipedia:Bulldozer (microarchitecture)|AMD bulldozer microarchitecture]].
+
=== EFI Framebuffer ===
Piledriver CPUs and APUs are available that use the [[Wikipedia:FM2 Socket|FM2 socket]]. Desktop Piledriver CPUs use the [[Wikipedia:Socket_AM3+|AM3+ socket]]. Server Piledriver CPUs use a variety of sockets, including [[Wikipedia:Socket_AM3+|AM3+]], [[Wikipedia:Socket_C32|C32]] and [[Wikipedia:Socket_G34|G34]].
+
  
Desktop piledriver CPU and APUs include FX-series with codename Vishera (FX-8350, FX-8370),  [[Wikipedia:List_of_AMD_accelerated_processing_unit_microprocessors#Virgo:_.22Trinity.22_.282012.2C_32_nm.29|A-series with codename Trinity]] (A6-5400K, A10-5800K) and [[Wikipedia:http://en.wikipedia.org/wiki/List_of_AMD_accelerated_processing_unit_microprocessors#.22Richland.22_.282013.2C_32_nm.29_2|A-series with codename Richland]].
+
If you have the following option enabled in your kernel, then uvesafb and efifb will not be able to detect the framebuffer:
  
Server piledriver CPUs include Opterons with codenames Delhi (Opteron 3300-series, [[Wikipedia:Socket_AM3+|AM3+]]), Seoul (Opteron 4300-series, [[Wikipedia:Socket_C32|C32]])  and Abu Dhabi (Opteron 6300-series, [[Wikipedia:Socket_G34|G34]]). A full listing of Opteron models [[Wikipedia:Opteron#Opteron_.2832_nm_SOI.29_-_Piledriver_Microarchitecture|is available here]].
+
{{kernelop|title=Bus options (PCI etc.)|desc=
 +
    [*] Mark VGA/VBE/EFI FB as generic system framebuffer (NEW)
 +
}}
  
Piledriver adds several new instructions over bulldozer, so AMD bulldozer systems cannot run amd64-piledriver-optimized stages. However, this subarch is  instruction-compatible with its successor, the, so amd64-piledriver stages can run on amd64-steamroller systems, and vice versa.
+
If you have that option enabled, ''you must also enable'':
  
=== amd64-steamroller ===
+
{{kernelop|title=Device Drivers,Graphics support,Frame buffer Devices|desc=
<console>
+
    [*]  Simple framebuffer support
CFLAGS: -march=bdver3 -O2 -pipe
+
}}
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 sse4 3dnow 3dnowext
+
</console>
+
  
AMD Family 15h core based CPUs with x86-64 instruction set support. (This supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
+
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.
 +
=== Grub method ===
  
The '''amd64-steamroller''' subarch supports the  [[Wikipedia:Steamroller (microarchitecture)|AMD steamroller microarchitecture]], produced from early 2014. It is the successor to the [[Wikipedia:Piledriver (microarchitecture)|AMD Piledriver microarchitecture]].
+
==== Unmask Grub 2.02_beta2 ====
Steamroller APUs are available that use the [[Wikipedia:FM2+ Socket|FM2+ socket]] and  [[Wikipedia:Socket_FP3|FP3 socket]] (mobile.)
+
  
Desktop steamroller APUs include the [[Wikipedia:AMD_Accelerated_Processing_Unit#Steamroller_architecture_.282014.29:_Kaveri|A-Series with codename Kaveri]], such as the quad-core AMD A10-7850K APU. Steamroller APUs are also available in mobile versions. Server steamroller APUs will include the codename Berlin APUs, which are expected to be released some time in 2015.
+
Unmask the latest version of GRUB by placing this in your <code>/etc/portage/package.unmask</code>:
  
Amd64-steamroller subarches are instruction-compatible with amd64-piledriver, but add new instructions over amd64-bulldozer.
+
<pre>
 +
sys-boot/grub
 +
</pre>
  
=== amd64-jaguar ===
+
The 2.00 version of GRUB has known issues with UEFI booting. Using 2.02 is essential for having this boot method work reliably.
<console>
+
CFLAGS: -march=btver2 -O2 -pipe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 sse4 3dnow 3dnowext
+
</console>
+
  
CPUs based on AMD Family 16h cores with x86-64 instruction set support. This includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM, SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
+
==== Emerging GRUB ====
  
The '''amd64-jaguar''' (also called AMD Family 16h) subarch supports the  [[Wikipedia:Jaguar (microarchitecture)|AMD jaguar microarchitecture]], which is targeted at low-power devices, including notebooks, tablets and small form-factor desktops and servers. It is perhaps most well-known for being the microarchitecture used for the [[Wikipedia:Playstation 4|Playstation 4]] and [[Wikipedia:Xbox One|Xbox One]], which each use custom 8-core Jaguar APUs.
+
You will still use GRUB as a boot loader, but before emerging grub, you will need to enable EFI booting. To do this,  
Socketed Jaguar APUs use the [[Wikipedia:AM1 Socket|AM1 socket]], and  [[Wikipedia:Socket_FT3|FT3 socket]] for mobile devices. G-series [[Wikipedia:System_on_a_chip|"system on a chip" (SoC)]] APUs are available for non-socketed devices such as tablets and embedded system boards.
+
add the following line to <tt>/etc/portage/make.conf</tt>:
  
Desktop Jaguar APUs include the [[Wikipedia:List_of_AMD_accelerated_processing_unit_microprocessors#.22Kabini.22.2C_.22Temash.22_.282013.2C_28_nm.29|Kabini A-series APUs and Temash E-series APUs]], such as the Athlon 5150 and 5350 APUs, and Sempron 2650 and 3850.
+
<pre>
 +
GRUB_PLATFORMS="efi-64"
 +
</pre>
  
Amd64-jaguar subarches use the MOVBE instruction which is not available on amd64-bulldozer, amd64-piledriver or amd64-steamroller. They are thus not instruction-compatible with any of these subarches.
+
Then, <tt>emerge grub</tt>. You will notice <tt>efibootmgr</tt> getting pulled in as a dependency. This is expected and good.
  
== 64-bit Intel Processors ==
+
==== Installing GRUB ====
 +
 
 +
Now, for the magic of getting everything in place for booting. You should copy your kernel and initramfs (if you have one -- you will if you are following the default install) to <tt>/boot</tt>. GRUB will boot those. But how do we get UEFI to boot GRUB? Well, we need to run the following command:
  
=== corei7 ===
 
 
<console>
 
<console>
CFLAGS: -march=corei7 -O2 -pipe
+
# ##i##grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 ssse3 sse4
+
 
</console>
 
</console>
Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 instruction set support.  
+
This command will simply install all the stuff to <tt>/boot/EFI</tt> and <tt>/boot/grub</tt> that your system needs to boot. In particular, the <tt>/boot/EFI/grub/grubx64.efi</tt> file will be created. This is the GRUB boot image that UEFI will load and start.
  
Introduced November of 2008, the '''corei7''' subarch supports the [[Wikipedia:Nehalem_(microarchitecture)|Nehalem]], [[Wikipedia:Sandy_Bridge_(microarchitecture)|Sandy Bridge]], [[Wikipedia:Ivy_Bridge_(microarchitecture)|Ivy Bridge]], and [[Wikipedia:Haswell_(microarchitecture)|Haswell]] microarchitectures.
+
A more detailed explanation of the flags used in the above command:
 +
* <code>--target=x86_64-efi</code>: Tells GRUB that we want to install it in a way that allows it to boot in UEFI
 +
* <code>--efi-directory=/boot</code>: All GRUB UEFI files will be installed in ''/boot''
 +
* <code>--bootloader-id="Funtoo Linux [GRUB]"</code>: This flag is not necessary for GRUB to boot. However, it allows you to change the text of the boot option in the UEFI BIOS. The stuff in the quotes can be set to anything that you would like.
 +
* <code>--recheck</code>: If a device map already exists on the disk or partition that GRUB is being installed on, it will be removed.
 +
* <code>/dev/sda</code>:The device that we are installing GRUB on.
  
=== core2_64 ===
+
==== Configuring GRUB ====
<console>
+
CFLAGS: -march=core2 -O2 -pipe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 ssse3
+
</console>
+
  
Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3 instruction set support.  
+
OK, now UEFI has the GRUB image it needs to boot. But we still need to configure GRUB itself so it finds and boots your kernel and initramfs. This is done by performing the following steps. Since boot-update doesn't yet support UEFI, we will use boot-update, but then edit our <code>/boot/grub/grub.cfg</code> to support UEFI booting.  
  
The '''core2_64''' subarch supports 64-bit-capable [[Wikipedia:Intel_Core_2|Intel Core 2 Processors]], which includes ''some'' processors of the [[Wikipedia:Intel Core (microarchitecture)|Core]] and all processors of the [[Wikipedia:Penryn_(microarchitecture)|Penryn]] microarchitecture. All "Core 2" branded processors are 64-bit-capable. These processors were introduced in July of 2006 and were phased out in July of 2011, in favor of [[Wikipedia:Nehalem_(microarchitecture)|Nehalem-based]] processors.
+
First, you will need to edit <code>/etc/boot.conf</code>. Format this as you would if you were booting without UEFI. If you are not sure how this should look, below is an example of what it could look like if you are booting from an unencrypted ext4 partition:
  
For a full list of 64-bit capable Core 2 processors, [http://ark.intel.com/search/advanced?s=t&FamilyText=Legacy%20Intel%C2%AE%20Core%E2%84%A22%20Processor&InstructionSet=64-bit see this link].
+
{{file|name=/etc/boot.conf|desc=|body=
 +
boot {
 +
        generate grub
 +
        default "Funtoo Linux"
 +
        timeout 3
 +
}
  
The 64-bit capable ''Core 2''-branded CPUs include: "Conroe"/"Allendale" (dual-core for desktops), "Merom" (dual-core for laptops), "Merom-L" (single-core for laptops), "Kentsfield" (quad-core for desktops), and the updated variants named "Wolfdale" (dual-core for desktops), "Penryn" (dual-core for laptops),  and "Yorkfield" (quad-core for desktops). (Note: ''For the server and workstation "Woodcrest", "Tigerton", "Harpertown" and "Dunnington" CPUs see the [[Wikipedia:Xeon|Xeon]] brand''.)
+
"Funtoo Linux" {
 +
        kernel vmlinuz[-v]
 +
        params += rootfstype=ext4 root=/dev/sda2
 +
}
 +
}}
  
=== atom_64 ===
+
After you have edited your <code>/etc/boot.conf</code> file, run <code>boot-update</code>. If you check your <code>/boot/grub/grub.cfg</code> now, you should see something like this:
<console>
+
 
CFLAGS: -O2 -fomit-frame-pointer -march=atom -pipe -mno-movbe
+
{{file|name=/boot/grub/grub.cfg|desc=|body=
CHOST: x86_64-pc-linux-gnu
+
set timeout=3
USE: mmx sse sse2 sse3
+
 
</console>
+
  insmod part_gpt
 +
  insmod fat
 +
  set root=(hostdisk//dev/sda,gpt1)
 +
  search --no-floppy --fs-uuid --set 3CFD-6884
 +
if loadfont /grub/unifont.pf2; then
 +
  set gfxmode=text
 +
  insmod gfxterm
 +
  insmod vbe
 +
  terminal_output gfxterm
 +
fi
 +
 
 +
set menu_color_normal=cyan/blue
 +
set menu_color_highlight=blue/cyan
  
Intel Atom CPU with 64-bit extensions MMX, SSE, SSE2, SSE3 and SSSE3 instruction set support.
+
menuentry "Funtoo Linux - vmlinuz-3.16.3" {
 +
  insmod part_gpt
 +
  insmod fat
 +
  set root=(hostdisk//dev/sda,gpt1)
 +
  search --no-floppy --fs-uuid --set 3CFD-6884
 +
  linux /vmlinuz-3.16.3 video=uvesafb:1920x1080-32,mtrr:3,ywrap rootfstype=ext4 root=/dev/sda2
 +
  set gfxpayload=text
 +
}
 +
set default=0
 +
}}
  
The Intel Atom Processor is the common name for Intel's  [[Wikipedia:Bonnell_(microarchitecture)|Bonnell microarchitecture]],  which represents a partial revival of the principles used in earlier Intel designs such as P5 and the i486, with the sole purpose of enhancing the performance per watt ratio. Successor to the [[Wikipedia:Stealey_(microprocessor)|Intel A100 series (Stealey)]], which was derived from the [[Wikipedia:Pentium_M|Pentium M]], the Intel Atom has been produced since 2008. Targeted at low-power devices, Atom processors can be found in a wide range of notebooks, tablets and small form-factor desktops and servers.  
+
To get your <code>/boot/grub/grub.cfg</code> to support booting with UEFI, make your <code>/boot/grub/grub.cfg</code> look like this:
 +
{{file|name=/boot/grub/grub.cfg|desc=|body=
 +
set timeout=3
  
The '''atom_64''' sub-architecture supports 64-bit capable Intel Atom CPUs.  The first 64-bit capable Intel Atom CPUs were the Intel Atom 230 and 330, released in late 2008. However, Intel also continued to produce new 32-bit Atom Processors after this date. For example, the Atom N2xx series Atom Diamondville models cannot support 64-bit operation, while the 2xx and 3xx Diamondville, Pineview, Cedarview and Centerton can. A full list of 64-bit capable Intel Atom Processors [http://ark.intel.com/search/advanced?s=t&FamilyText=Intel%C2%AE%20Atom%E2%84%A2%20Processor&InstructionSet=64-bit can be seen here.]
+
  insmod part_gpt
 +
  insmod fat
 +
  insmod efi_gop
 +
  insmod efi_uga
 +
  set root=(hostdisk//dev/sda,gpt1)
 +
  search --no-floppy --fs-uuid --set 3CFD-6884
 +
if loadfont /grub/unifont.pf2; then
 +
  set gfxmode=auto
 +
  insmod gfxterm
 +
  insmod vbe
 +
  terminal_output gfxterm
 +
fi
  
{{Important|For 64-bit support to be functional, a 64-bit capable Atom Processor must be paired ''with a processor, chipset, and BIOS'' that all support [[Wikipedia:X86-64#Intel_64|Intel 64]]. If not all hardware supports 64-bit, then you must use the [[subarches#atom_32|atom_32]] subarch instead.}}
+
set menu_color_normal=cyan/blue
 +
set menu_color_highlight=blue/cyan
  
== 32-bit Suport (Generic) ==
+
menuentry "Funtoo Linux - vmlinuz-3.16.3" {
=== generic_32 ===
+
  insmod part_gpt
 +
  insmod fat
 +
  set root=(hostdisk//dev/sda,gpt1)
 +
  search --no-floppy --fs-uuid --set 3CFD-6884
 +
  linux /vmlinuz-3.16.3 video=uvesafb:1920x1080-32,mtrr:3,ywrap rootfstype=ext4 root=/dev/sda2
 +
  set gfxpayload=keep
 +
}
 +
set default=0
 +
}}
  
== 32-bit AMD Processors ==
+
The lines that we have added and altered do the following:
=== amd64-k8_32 ===
+
* <code>insmod efi_gop</code> and <code>insmod efi_uga</code>: Both of these involve adding support for the UEFI framebuffer to GRUB.
=== athlon-xp ===
+
* <code>set gfxmode=auto</code>: Instead of having the GRUB boot option screen being displayed at the smallest resolution possible, changing this to auto will make it fit the resolution of your display.
  
== 32-bit ARM Processors ==
+
== Known Issues ==
=== armv5te ===
+
*With pure UEFI boot mode, with legacy mode disabled, following error expected:
=== armv6j_hardfp ===
+
** video driver not supported, boot hangs, hard reboot required.
=== armv7a_hardfp ===
+
*Choose UEFI first, next legacy driver. It depends on motherboard vendor and efi bios version.
 +
**In UEFI bios choose grub option, if your succeeded with above guide, additional menu should appear in Boot Menu, otherwise it boots into EFI shell: <code>grub:NAME of you hard drive</code>
 +
* On some systems, installing the packages that are required for UEFI booting with any gcc later than a 4.x.x release may lead to a black screen after the GRUB screen. To fix this, before you begin installing any packages on your system, emerge =gcc-4.6.4-r2 and proceed with the installation as usual. Remember to switch your compiler back to the version of gcc that came with your system after you have finished installing. To do this, use <code>gcc-config 2</code>.
  
== 32-bit Intel Processors ==
+
=== Done! ===
=== atom_32 ===
+
=== core2_32 ===
+
=== i686 ===
+
=== pentium4 ===
+
  
 +
Remember to follow all other steps in the regular Funtoo Install Guide. Assuming you did everything correctly, your system should now boot via UEFI! We will be adding UEFI support to boot-update soon to make this process easier.
  
{{:Install/Footer}}
+
[[Category:HOWTO]]

Revision as of 21:44, November 18, 2014

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 EFI Stub Guide .

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 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.

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.

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:

# 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.

Grub method

Unmask Grub 2.02_beta2

Unmask the latest version of GRUB by placing this in your /etc/portage/package.unmask:

sys-boot/grub

The 2.00 version of GRUB has known issues with UEFI booting. Using 2.02 is essential for having this boot method work reliably.

Emerging GRUB

You will still use GRUB as a boot loader, but before emerging grub, you will need to enable EFI booting. To do this, add the following line to /etc/portage/make.conf:

GRUB_PLATFORMS="efi-64"

Then, emerge grub. You will notice efibootmgr getting pulled in as a dependency. This is expected and good.

Installing GRUB

Now, for the magic of getting everything in place for booting. You should copy your kernel and initramfs (if you have one -- you will if you are following the default install) to /boot. GRUB will boot those. But how do we get UEFI to boot GRUB? Well, we need to run the following command:

# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda

This command will simply install all the stuff to /boot/EFI and /boot/grub that your system needs to boot. In particular, the /boot/EFI/grub/grubx64.efi file will be created. This is the GRUB boot image that UEFI will load and start.

A more detailed explanation of the flags used in the above command:

  • --target=x86_64-efi: Tells GRUB that we want to install it in a way that allows it to boot in UEFI
  • --efi-directory=/boot: All GRUB UEFI files will be installed in /boot
  • --bootloader-id="Funtoo Linux [GRUB]": This flag is not necessary for GRUB to boot. However, it allows you to change the text of the boot option in the UEFI BIOS. The stuff in the quotes can be set to anything that you would like.
  • --recheck: If a device map already exists on the disk or partition that GRUB is being installed on, it will be removed.
  • /dev/sda:The device that we are installing GRUB on.

Configuring GRUB

OK, now UEFI has the GRUB image it needs to boot. But we still need to configure GRUB itself so it finds and boots your kernel and initramfs. This is done by performing the following steps. Since boot-update doesn't yet support UEFI, we will use boot-update, but then edit our /boot/grub/grub.cfg to support UEFI booting.

First, you will need to edit /etc/boot.conf. Format this as you would if you were booting without UEFI. If you are not sure how this should look, below is an example of what it could look like if you are booting from an unencrypted ext4 partition:

/etc/boot.conf
boot {
        generate grub
        default "Funtoo Linux"
        timeout 3
}

"Funtoo Linux" {
        kernel vmlinuz[-v]
        params += rootfstype=ext4 root=/dev/sda2
}

After you have edited your /etc/boot.conf file, run boot-update. If you check your /boot/grub/grub.cfg now, you should see something like this:

/boot/grub/grub.cfg
set timeout=3

  insmod part_gpt
  insmod fat
  set root=(hostdisk//dev/sda,gpt1)
  search --no-floppy --fs-uuid --set 3CFD-6884
if loadfont /grub/unifont.pf2; then
   set gfxmode=text
   insmod gfxterm
   insmod vbe
   terminal_output gfxterm
fi

set menu_color_normal=cyan/blue
set menu_color_highlight=blue/cyan

menuentry "Funtoo Linux - vmlinuz-3.16.3" {
  insmod part_gpt
  insmod fat
  set root=(hostdisk//dev/sda,gpt1)
  search --no-floppy --fs-uuid --set 3CFD-6884
  linux /vmlinuz-3.16.3 video=uvesafb:1920x1080-32,mtrr:3,ywrap rootfstype=ext4 root=/dev/sda2
  set gfxpayload=text
}
set default=0

To get your /boot/grub/grub.cfg to support booting with UEFI, make your /boot/grub/grub.cfg look like this:

/boot/grub/grub.cfg
set timeout=3

  insmod part_gpt
  insmod fat
  insmod efi_gop
  insmod efi_uga
  set root=(hostdisk//dev/sda,gpt1)
  search --no-floppy --fs-uuid --set 3CFD-6884
if loadfont /grub/unifont.pf2; then
   set gfxmode=auto
   insmod gfxterm
   insmod vbe
   terminal_output gfxterm
fi

set menu_color_normal=cyan/blue
set menu_color_highlight=blue/cyan

menuentry "Funtoo Linux - vmlinuz-3.16.3" {
  insmod part_gpt
  insmod fat
  set root=(hostdisk//dev/sda,gpt1)
  search --no-floppy --fs-uuid --set 3CFD-6884
  linux /vmlinuz-3.16.3 video=uvesafb:1920x1080-32,mtrr:3,ywrap rootfstype=ext4 root=/dev/sda2
  set gfxpayload=keep
}
set default=0

The lines that we have added and altered do the following:

  • insmod efi_gop and insmod efi_uga: Both of these involve adding support for the UEFI framebuffer to GRUB.
  • set gfxmode=auto: Instead of having the GRUB boot option screen being displayed at the smallest resolution possible, changing this to auto will make it fit the resolution of your display.

Known Issues

  • With pure UEFI boot mode, with legacy mode disabled, following error expected:
    • video driver not supported, boot hangs, hard reboot required.
  • Choose UEFI first, next legacy driver. It depends on motherboard vendor and efi bios version.
    • In UEFI bios choose grub option, if your succeeded with above guide, additional menu should appear in Boot Menu, otherwise it boots into EFI shell: grub:NAME of you hard drive
  • On some systems, installing the packages that are required for UEFI booting with any gcc later than a 4.x.x release may lead to a black screen after the GRUB screen. To fix this, before you begin installing any packages on your system, emerge =gcc-4.6.4-r2 and proceed with the installation as usual. Remember to switch your compiler back to the version of gcc that came with your system after you have finished installing. To do this, use gcc-config 2.

Done!

Remember to follow all other steps in the regular Funtoo Install Guide. Assuming you did everything correctly, your system should now boot via UEFI! We will be adding UEFI support to boot-update soon to make this process easier.