Difference between pages "Install/pt-br/Partitioning" and "Install/BootLoader"

From Funtoo
< Install(Difference between pages)
Jump to navigation Jump to search
m (Tocadotux moved page Install/pt-br/Partitioning to Install/Partitioning/pt-br: Making as Paul advised me)
 
 
Line 1: Line 1:
<noinclude>
{{InstallPart|boot loader configuration}}
</noinclude>
=== Installing a Bootloader ===


===Particionamento===
These install instructions show you how to use GRUB to boot using BIOS (old-school) or UEFI (new-school).


=== Prepare o Disco Rígido ===
==== Old School (BIOS) ====


==== Introdução ====
If you're using the BIOS to boot, setting up GRUB, the bootloader, is pretty easy.


Em tempos remotos, só havia um jeito de inicializar (boot)o computador compatível com a arquitetura PC. Todos os nossos desktops e servidores tinham uma BIOS padrão, todos os nossos hard drives utilizavam Master Boot Records, e eram particionados utilizando esquema de partição MBR. E nós gostávamos disso daquele jeito mesmo!
To use this recommended boot method, first emerge <code>boot-update</code>. This will also cause <code>grub-2</code> to be merged, since it is a dependency of <code>boot-update</code>.
 
Então, depois veio os EFI e UEFI, que são firmware em novo-estilo projetados para inicializar sistemas, junto as tabelas de partição GPT para suportar discos superiores à 2.2TB. Tudo repentino, nós tínhamos uma variedade de opções para inicializar os sistemas Linux, tornando o que uma vez era um método único de encaixe de tudo  (one-method-fits-all) aproximar-se á algo muito mais complexo.
 
Vamos parar por um momento para rever as opções de boot disponíveis para você. Esse pequeno Guia utiliza, e recomenda, o método da BIOS à moda antiga inicializando e usando um MBR. Funciona. Não há nada de errado com ele. Se seu disco é do tamanho de  2TB ou menor, ele não vai impedir que você use toda a capacidade do seu disco, também.
 
Mas, há alguns situações onde  o método da não é satisfatório. Se você obtiver um disco de tamando superior à 2TB, então partições MBR não o permitirão acessar todo o seu  armazenamento (storage). Então essa é uma rasão. Outra rasão é que há alguns então assim chamados  "PC" por aí afora que não suportam maias BIOS, e lhe força a utilizar o UEFI para inicializar. Então, sem compaixão pelas pessoas que se enquadram nessa situação, esse Guia de Instalação documenta boot pelo UEFI também.
 
Nossa recomandação ainda é ir pela moda antiga a não ser  que tenha resão para não. Chamamos esse método  de método '''BIOS + GRUB (MBR)'''. Esse é o método tradicional de configurar um PC para inicilizar o Linux.
 
Se você precisa usar UEFI para inicilizar, recomendamos não utillizar de maneira alguma o MBR para boot, já que alguns sistemas suportam as some UEFI, mas outros não. Ao inves disso, recomendamos utilizar o UEFI para inicializar o GRUB, que carregará o Linux. Referimos a esse método como o método '''UEFI + GRUB (GPT)'''.
 
E sim, há ainda mais, alguns aos quais estão documentados na página [[Boot Methods]]. Nós costumavamos recomendar um étodo '''BIOS + GRUB (GPT)''', mas esse não tem consistentemente suporte em uma variedade de hardware.
 
'''A grande pergunta é -- que método de boot eu devo usar?''' Aqui está como responder.
 
;Princípio nº 1 - Moda antiga (Old School): Se você pode inicializar com confiavelmente o System Rescue CD e ele exibe um menu inicial azul claro, você está inializando o CD usando a BIOS, e provavelmente você pode assim inicilizar o Funtoo Linux ussando a BIOS. Então, vá pela moda antiga e use a boot da BIO, ''a não ser que'' você tenha alguma resão para usar UEFI, tal qual ter um disco do tamando superior a 2.2TB. Nesse caso, veja o segundo Princípio nº 2, já que seu sistema pode ter suporte também à  boot UEFI.
 
;Princípio nº 2 - Moderno (New School): Se você pode confiavelmente inicilizar o System Rescue CD e ele te exibe um menu inicial preto e branco -- parabens, seu sistema é configurado para suportar o boot via UEFI. Isso significa que você está pronto para instalar o install Funtoo Linux para inicializá-lo via UEFI. Seu sistema pode ainda ter suporte para inicilizar com a BIOS, mas  somente se for testado pela UEFI primeiro. Você pode dar uma bisbilhotada na sua configuração de boot pelo BIOS e brincar com isso.
 
;Qual pe a Grande Diferença entra a Moda Antiga e a Moderna?: Aqui está a coisa. Se você for com as as partições MBR a moda antiga, sua partição <code>/boot</code> será um sistema de arquivos ext2, e você utilizará <code>fdisk</code> para criar suas partições MBR. Se você com as partições GPT e boot via UEFI, sua partição <code>/boot</code> será um sistema de arquivos vfat, por que isso é o que o UEFI é capaz de ler, e você utilizará <code>gdisk</code> para criar suas partiçẽos GP. E você instalará o GRUB um pouco diferente. É a respeito disso que tudo vem abaixo, em caso você estivesse curioso/a.
 
{{Note|'''Algumas placas mãe pode aparentar suporte a UEFI, mas não suportam.''' Faça sua pesquisa. Por exemplo, O BIOS atribuído na minha Gigabyte GA-990FXA-UD7 rev 1.1 tem uma opção de abilitar o boot UEFI por CD/DVD. '''Isso não é o sufuciente para abilitar boot via UEFI pelo hard drives e instalar o Funtoo Linux.''' UEFI deve ter tanto para mídia removível (assim você pode inicializar o System Rescue CD utilizando o UEFI) quanto mídias fixas (assim você pode inicializar sua nova instalação do Funtoo Linux.) Revelá-se que revisões posteriores dessa placa (rev 3.0) tem um novo BIOS que suporta completamente o boot do UEFI.  Isso pode apontar para o terceiro princípio -- conheça teu hardware.}}
 
==== O método a moda antiga (BIOS/MBR) ====
 
{{Note|Use esse método se você estiver inicializando sua BIOS, e se o o menu boot inicial do seu System Rescue CD initial estiver em azul claro. Se você for utilizar o método moderno, [[#Método Moderno (UEFI/GPT)|click aqui para saltar para o UEFI/GPT.]]}}
 
===== Preparo =====
 
Primeiro, é uma boa idea certificar-se de que encontrou o hard disk correto para particioná-lo. Tente esse comando e verifique que  <code>/dev/sda</code> é o disco que você quer particionar:
 
<console>
# ##i##fdisk -l /dev/sda
 
Disk /dev/sda: 640.1 GB, 640135028736 bytes, 1250263728 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
 
 
#        Start          End    Size  Type            Name
1        2048  1250263694  596.2G  Linux filesyste Linux filesystem
</console>
 
Agora, é recomendado que você apague quaisquer tabelas de partição MBR ou GPT existente no disco, que poderiam confundir o BIOS do sistema no momento da inicialização. Fazemos isso utilizando <code>sgdisk</code>:
{{fancywarning|Isso tornará quaisquer partições existentes inacessiveis! É formente lhe aconcelhado advetido realizar backup de qualquer dado crítico antes de prosseguir.}}


<console>
<console>
# ##i##sgdisk --zap-all /dev/sda
(chroot) # ##i##emerge boot-update
 
Creating new GPT entries.
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
</console>
</console>


Essa saída també não é nada para se preocupar, desde que o comando ainda  foi bem sucedido:
Then, edit <code>/etc/boot.conf</code> and specify "<code>Funtoo Linux genkernel</code>" as the <code>default</code> setting at the top of the file, replacing <code>"Funtoo Linux"</code>.


<console>
<code>/etc/boot.conf</code> should now look like this:
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.  
***************************************************************
</console>


===== Particionamento =====
<pre>
boot {
generate grub
default "Funtoo Linux genkernel"
timeout 3
}


Agora usaremos <code>fdisk</code> para criar a tabela de partição MBR e as partições:
"Funtoo Linux" {
kernel bzImage[-v]
}


<console>
"Funtoo Linux genkernel" {
# ##i##fdisk /dev/sda
kernel kernel[-v]
</console>
initrd initramfs[-v]
params += real_root=auto
}


Dentro do <code>fdisk</code>, siga esses passos:
"Funtoo Linux better-initramfs" {
kernel vmlinuz[-v]
initrd /initramfs.cpio.gz
}
</pre>


'''Esvazie a tabela de partição''':
Please read <code>man boot.conf</code> for further details.


<console>
===== Running grub-install and boot-update =====
Command (m for help): ##i##o ↵
</console>


'''Crie a primeira Partição''' (boot):
Finally, we will need to actually install the GRUB boot loader to your disk, and also run <code>boot-update</code> which will generate your boot loader configuration file:


<console>
<console>
Command (m for help): ##i##n ↵
(chroot) # ##i##grub-install --no-floppy /dev/sda
Partition type (default p): ##i##
(chroot) # ##i##boot-update
Partition number (1-4, default 1): ##i##
First sector: ##i##
Last sector: ##i##+128M ↵
</console>
</console>


'''Crie a segunda Partição''' (swap):
Now you need to update your boot loader configuration file:
 
<console>
<console>
Command (m for help): ##i##n ↵
(chroot) # ##i##boot-update
Partition type (default p): ##i##
Partition number (2-4, default 2): ##i##↵
First sector: ##i##↵
Last sector: ##i##+2G ↵
Command (m for help): ##i##t ↵
Partition number (1,2, default 2): ##i## ↵
Hex code (type L to list all codes): ##i##82 ↵
</console>
</console>
You only need to run <code>grub-install</code> when you first install Funtoo Linux, but you need to re-run <code>boot-update</code> every time you modify your <code>/etc/boot.conf</code> file, so your changes are applied on next boot.


'''Crie a partição root:'''
==== New School (UEFI) ====


<console>
If you're using UEFI to boot, setting up the boot loader is a bit more complicated for now, but this process will be improving soon. Perform the following steps.
Command (m for help): ##i##n ↵
Partition type (default p): ##i##↵
Partition number (3,4, default 3): ##i##↵
First sector: ##i##↵
Last sector: ##i##↵
</console>


'''Verifique a tabela de partição:'''
===== Emerging GRUB =====


<console>
You will still use GRUB as a boot loader, but before emerging grub, you will need to enable EFI booting. To do this,
Command (m for help): ##i##p
add the following line to <code>/etc/make.conf</code>:


Disk /dev/sda: 298.1 GiB, 320072933376 bytes, 625142448 sectors
<pre>
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x82abc9a6


Device    Boot    Start      End    Blocks  Id System
For 64-bit systems:
/dev/sda1          2048    264191    131072  83 Linux
/dev/sda2        264192  4458495  2097152  82 Linux swap / Solaris
/dev/sda3        4458496 625142447 310341976  83 Linux
</console>
 
'''Grave a tabela de partição no disco:'''
 
<console>
Command (m for help): ##i##w
</console>


Sua nova tabela de partição MBR será agora gravada no seu disco.
GRUB_PLATFORMS="efi-64"


{{Note|Você finalizou o particionamento! Agora, pule para [[#Criando os filesystems|Criando os filesystems]].}}
For 32-bit systems, i.e. Intel Atom devices:


==== Método Moderno (UEFI/GPT)  ====
GRUB_PLATFORMS="efi-32"


{{Note|Use esse método se você estiver inicializando usando o UEFI, e se o menu de boot do seu System Rescue CD initial boot for preto e branco. Se for azul claro, esse método não funcionará.}}
</pre>


Utilize o comando <tt>gdisk</tt> para criar uma tabela de partição GPT como a seguir. Adapte tamanhos conforme necessário, embora esse padrões funcionarão para a maioria dos  suários. Inicie o <code>gdisk</code>:
Then, <code>emerge boot-update</code>. You will notice <code>grub</code> and <code>efibootmgr</code> getting pulled in as dependencies. This is expected and good:


<console>
<console>
# ##i##gdisk
(chroot) # ##i##emerge boot-update
</console>
</console>


Dentro do <tt>gdisk</tt>, Siga esses passos:
===== Installing GRUB =====


'''Crie uma uma nova tabela de partição vazia''' (Isso ''apagará'' todos os dados no seu disco quando salvo):
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 (for 32bit simply set it as efi-32):


<console>
<console>
Command: ##i##o ↵
(chroot) # ##i##grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): ##i##y ↵
</console>
</console>
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.


'''Crie a 1ª Partiçaõ''' (boot):
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.


<console>
===== Configuring GRUB =====
Command: ##i##n ↵
Partition Number: ##i##1 ↵
First sector: ##i##↵
Last sector: ##i##+500M ↵
Hex Code: ##i##↵
</console>


'''Crie a 2ª Partição''' (swap):
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.


<console>
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:
Command: ##i##n ↵
Partition Number: ##i##2 ↵
First sector: ##i##↵
Last sector: ##i##+4G ↵
Hex Code: ##i##8200 ↵
</console>


'''Create 3ª Partição''' (root):
{{file|name=/etc/boot.conf|desc=|body=
boot {
        generate grub
        default "Funtoo Linux"
        timeout 3
}


<console>
"Funtoo Linux" {
Command: ##i##n ↵
        kernel vmlinuz[-v]
Partition Number: ##i##3 ↵
        params += rootfstype=ext4 root=/dev/sda2
First sector: ##i##↵
}
Last sector: ##i##↵##!i## (for rest of disk)
}}
Hex Code: ##i##↵
</console>
 
Ao longo do caminho, você pode digitar "<tt>p</tt>" e apertar Enter para visualizar a tabela de partição atual. Se você cometar algum engano, você pode digitar "<tt>d</tt>" tuma partição existente que você criou. Quando estiver satisfeito com sua definição de partição, digite "<tt>w</tt>" para gravar sua configuração no disco:


'''Gravar a Tabela de Partição no Disco''':
After you have edited your <code>/etc/boot.conf</code> file, run <code>boot-update</code>. You should now have a <code>/boot/grub/grub.cfg</code> file, which you can edit using the following command:


<console>
<console>
Command: ##i##w ↵
# ##i##nano /boot/grub/grub.cfg
Do you want to proceed? (Y/N): ##i##Y ↵
</console>
</console>


A tabela de partição será agora gravada em disco e o <tt>gdisk</tt> será fechado.


Agora, suas partições GPT/GUID foram criadas, e será exibido os seguintes ''dispositivos de bloco'' (''block devices'') no Linux:
To get your <code>/boot/grub/grub.cfg</code> to support booting with UEFI, make the following changes. Below the existing insmod lines, add the following lines. Both of these involve adding support for the UEFI framebuffer to GRUB.:


* <tt>/dev/sda1</tt>, which will be used to hold the <tt>/boot</tt> filesystem,
<pre>
* <tt>/dev/sda2</tt>, which will be used for swap space, and
  insmod efi_gop
* <tt>/dev/sda3</tt>, which will hold your root filesystem.
  insmod efi_uga
</pre>


==== Criando os filesystems ====
Then, change the <code>set gfxpayload</code> line to read as follows. UEFI does not support text mode, so we will keep video initialized to the current resolution.:


{{Note|Essa seção cobre tanto instalação pelo  BIOS ''quanto pelo'' UEFI. Não pule esse passo!}}
<pre>
  set gfxpayload=keep
</pre>


Antes que a suas partições recém-criadas possam ser utilizada, os dispositivos de bloco precisam ser inicializados com os '''metadados'' sistema de arquivos (filesystem ''metadata''). Esse processi é conhecido como ''criar um sistema de arquivo'' (''creating a filesystem'') nos dispositivos de bloco. Depois que os filesystems são criados nos dispositivos de bloco, eles podem ser montados e utilizados para armazenar arquivos.
You can now save your changes by pressing <code>Control-X</code> and answering <code>y</code> when asked if you want to save the modified buffer. When prompted for a filename, hit Enter to use the existing filename.
 
Vamos deixar isso de forma simples. Você vai utilizar partições MBR a moda antiga? Se sim, vamos criar um sistema de arquivo ext2 em /dev/sda1:
 
<console>
# ##i##mkfs.ext2 /dev/sda1
</console>
 
Se for utilizar partições GPT modernas para o UEFI, você precisará criar um sistema de arquivos vfat no /dev/sda1, por isso é o que o UEFI é capaz de ler:
 
<console>
# ##i##mkfs.vfat -F 32 /dev/sda1
</console>
 
Agora, vamos criar uma partição swap. Essa partição será criada para ser utilizada como memoria virtual com base no disco (disk-based virtual memory) para o seu sistema Funtoo Linux.
 
Você criará um sistema de arquivos na sia partição swap, desde não seja utilizada para armazenar arquivos. Mas é necessário inicializá-la utilizando o comando <code>mkswap</code> command. Depois vamos executar o comando <code>swapon</code> para tornar o seu recém inicializado espaço swap imediadamente ativo  dentro do ambiente live CD, nesse caso isso é necessário durante o resto do processo de instalação:
 
<console>
# ##i##mkswap /dev/sda2
# ##i##swapon /dev/sda2
</console>
 
Agora, precisamos criar um sistema de arquivos root. É alí aonde o Funtoo Linux vai morar. Geralmente recomendamos sistemas de arquivos root ext4 ou XFS. Se não estiver certo, escola o  ext4. Aqui está como criar um sistema de arquivos root ext4:
 
<console>
# ##i##mkfs.ext4 /dev/sda3
</console>
 
...e aqui está como criar um sistema de arquivos root XFS, se você escolher utilizar o XFS:
 
<console>
# ##i##mkfs.xfs /dev/sda3
</console>
 
Seus sistemas de arquivos (e o swap) foram todos inicializados, então dessa forma podem ser montados (anexados á sua hierarquia de diretório existente) e utilizado para armazenar arquivos. Estamos prontos para instalar o Funtoo Linux nesses sistemas de arquivos novinhos em folha.
 
{{fancywarning|1=
Quando implantar um host OpenVZ, por favor utilize exclusivamente o ext4. A equipe de desenvolvimento paralelos testa extensi extensivamente com o ext4, e versões mais modernas do  <code>openvz-rhel6-stable</code> ''não'' são compatíveis com o XFS, e você pode experimentar kernel bugs.
}}
 
==== Montando os filesystems ====
 
Monte os recem-criados filesystems como a seguir, criando <code>/mnt/funtoo</code> como ponto de montagem da instalação:
 
<console>
# ##i##mkdir /mnt/funtoo
# ##i##mount /dev/sda3 /mnt/funtoo
# ##i##mkdir /mnt/funtoo/boot
# ##i##mount /dev/sda1 /mnt/funtoo/boot
</console>
 
Optionally, if you have a separate filesystem for <code>/home</code> or anything else:
 
<console>
# ##i##mkdir /mnt/funtoo/home
# ##i##mount /dev/sda4 /mnt/funtoo/home
</console>
 
If you have <code>/tmp</code> or <code>/var/tmp</code> on a separate filesystem, be sure to change the permissions of the mount point to be globally-writeable after mounting, as follows:
 
<console>
# ##i##chmod 1777 /mnt/funtoo/tmp
</console>

Revision as of 07:26, January 1, 2015


   Note

This is a template that is used as part of the Installation instructions which covers: boot loader configuration. Templates are being used to allow multiple variant install guides that use most of the same re-usable parts.


Installing a Bootloader

These install instructions show you how to use GRUB to boot using BIOS (old-school) or UEFI (new-school).

Old School (BIOS)

If you're using the BIOS to boot, setting up GRUB, the bootloader, is pretty easy.

To use this recommended boot method, first emerge boot-update. This will also cause grub-2 to be merged, since it is a dependency of boot-update.

(chroot) # emerge boot-update

Then, edit /etc/boot.conf and specify "Funtoo Linux genkernel" as the default setting at the top of the file, replacing "Funtoo Linux".

/etc/boot.conf should now look like this:

boot {
	generate grub
	default "Funtoo Linux genkernel" 
	timeout 3 
}

"Funtoo Linux" {
	kernel bzImage[-v]
}

"Funtoo Linux genkernel" {
	kernel kernel[-v]
	initrd initramfs[-v]
	params += real_root=auto 
} 

"Funtoo Linux better-initramfs" {
	kernel vmlinuz[-v]
	initrd /initramfs.cpio.gz
}

Please read man boot.conf for further details.

Running grub-install and boot-update

Finally, we will need to actually install the GRUB boot loader to your disk, and also run boot-update which will generate your boot loader configuration file:

(chroot) # grub-install --no-floppy /dev/sda
(chroot) # boot-update

Now you need to update your boot loader configuration file:

(chroot) # boot-update

You only need to run grub-install when you first install Funtoo Linux, but you need to re-run boot-update every time you modify your /etc/boot.conf file, so your changes are applied on next boot.

New School (UEFI)

If you're using UEFI to boot, setting up the boot loader is a bit more complicated for now, but this process will be improving soon. Perform the following steps.

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/make.conf:


For 64-bit systems:

GRUB_PLATFORMS="efi-64"

For 32-bit systems, i.e. Intel Atom devices:

GRUB_PLATFORMS="efi-32"

Then, emerge boot-update. You will notice grub and efibootmgr getting pulled in as dependencies. This is expected and good:

(chroot) # emerge boot-update
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 (for 32bit simply set it as efi-32):

(chroot) # 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. You should now have a /boot/grub/grub.cfg file, which you can edit using the following command:

root # nano /boot/grub/grub.cfg


To get your /boot/grub/grub.cfg to support booting with UEFI, make the following changes. Below the existing insmod lines, add the following lines. Both of these involve adding support for the UEFI framebuffer to GRUB.:

  insmod efi_gop
  insmod efi_uga

Then, change the set gfxpayload line to read as follows. UEFI does not support text mode, so we will keep video initialized to the current resolution.:

  set gfxpayload=keep

You can now save your changes by pressing Control-X and answering y when asked if you want to save the modified buffer. When prompted for a filename, hit Enter to use the existing filename.