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

(Difference between pages)
 
m (Undo revision 8974 by Tocadotux (talk) not under pt-br names)
 
Line 1: Line 1:
T
+
== Getting started with emerge ==
 +
Emerge is the front-end for funtoo's Portage package manager. With emerge it is easy to install, update or remove packages.
  
=== Grub method ===
+
=== Update Package Database ===
 +
'''Sync local package database. This will update your local Portage tree with the latest Funtoo ebuilds.'''
 +
<console>
 +
###i## emerge --sync
 +
</console>
  
==== Unmask Grub 2.02_beta2 ====
+
=== Search packages ===
 +
'''Search packages by name.'''
 +
<console>
 +
###i## emerge -s firefox
 +
###i## emerge --search firefox
 +
</console>
  
Unmask the latest version of GRUB by placing this in your <code>/etc/portage/package.unmask</code>:
+
'''Search packages by description.'''
 +
<console>
 +
###i## emerge -S web browser
 +
###i## emerge --searchdesc web browser
 +
</console>
  
<pre>
+
=== Install packages ===
sys-boot/grub
+
'''Install package.'''
</pre>
+
<console>
 +
###i## emerge firefox
 +
</console>
  
The 2.00 version of GRUB has known issues with UEFI booting. Using 2.02 is essential for having this boot method work reliably.
+
'''Install multiple packages.'''
 +
<console>
 +
###i## emerge firefox thunderbird
 +
</console>
  
==== Emerging GRUB ====
+
'''Install package. Ask for confirmation before performing any changes. Show verbose output.'''
 +
<console>
 +
###i## emerge -av firefox
 +
###i## emerge --ask firefox
 +
</console>
  
You will still use GRUB as a boot loader, but before emerging grub, you will need to enable EFI booting. To do this,
+
=== Remove packages ===
add the following line to <tt>/etc/portage/make.conf</tt>:
+
'''Remove package.'''
 +
<console>
 +
###i## emerge -C firefox
 +
###i## emerge --unmerge firefox
 +
</console>
  
<pre>
+
'''Remove package. Ask for confirmation before performing any changes.'''
GRUB_PLATFORMS="efi-64"
+
<console>
</pre>
+
###i## emerge -aC firefox
 +
</console>
  
Then, <tt>emerge grub</tt>. You will notice <tt>efibootmgr</tt> getting pulled in as a dependency. This is expected and good.
+
'''Remove orphaned packages. Ask for confirmation before performing any changes.'''
 +
<console>
 +
###i## emerge -a --depclean
 +
</console>
  
==== Installing GRUB ====
+
=== Update packages ===
 +
'''Update all packages.'''
 +
<console>
 +
###i## emerge -uDN @world
 +
</console>
  
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:
+
'''Update all packages. Ask for confirmation before performing any changes. Show verbose output.'''
 +
<console>
 +
###i## emerge -uavDN @world
 +
</console>
  
 +
'''When upgrading to a new version of perl, it is necessary to also run <code>perl-cleaner</code> afterwards:'''
 
<console>
 
<console>
# ##i##grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda
+
###i## emerge -auvDN @world
 +
###i## perl-cleaner --all
 
</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.
 
  
A more detailed explanation of the flags used in the above command:
+
{{Note|This requirement of running <code>perl-cleaner</code> will eventually go away, once all perl-related ebuilds are updated to EAPI 5. EAPI 5 is a version of the Ebuild specification that supports smart updating of perl-related bits.}}
* <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.
+
  
==== Configuring GRUB ====
+
== Emerge options ==
  
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.  
+
; --sync
 +
: Updates the portage tree that is located in /usr/portage by default.
  
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:
+
; --search -s
 +
: Searches  for  matches  of  the  supplied  string in the portage tree.
  
{{file|name=/etc/boot.conf|desc=|body=
+
; --searchdesc -S
boot {
+
: Matches the search string against the description field as well as the package name.
        generate grub
+
        default "Funtoo Linux"
+
        timeout 3
+
}
+
  
"Funtoo Linux" {
+
; --ask -a
        kernel vmlinuz[-v]
+
: Ask for confirmation before performing any changes.
        params += rootfstype=ext4 root=/dev/sda2
+
}
+
}}
+
  
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:
+
; --pretend -p
 +
: Instead of actually performing the merge, simply display what *would* have been installed if --pretend weren't used.
  
{{file|name=/boot/grub/grub.cfg|desc=|body=
+
; --unmerge -C
set timeout=3
+
: Removes all matching packages.
  
  insmod part_gpt
+
; --update -u
  insmod fat
+
: Updates  packages to the best version available, which may not always be the  highest version number due to masking for testing and development.
  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
+
; --deep [DEPTH] -D
set menu_color_highlight=blue/cyan
+
: force  emerge  to  consider  the  entire  dependency tree of packages, instead of checking only the immediate dependencies of the packages.
  
menuentry "Funtoo Linux - vmlinuz-3.16.3" {
+
; --newuse -N
  insmod part_gpt
+
: Tells emerge to include installed packages where USE flags have changed since compilation.
  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 <code>/boot/grub/grub.cfg</code> to support booting with UEFI, make your <code>/boot/grub/grub.cfg</code> look like this:
+
; --depclean -c
{{file|name=/boot/grub/grub.cfg|desc=|body=
+
: Remove orphaned packages. Cleans the system by removing packages that are not associated with explicitly merged packages.
set timeout=3
+
  
  insmod part_gpt
+
; --autounmask-write
  insmod fat
+
: Automatically write package.use settings as necessary to satisfy dependencies.
  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
+
; --resume -r
set menu_color_highlight=blue/cyan
+
: Resumes  the  most recent merge list that has been aborted due to an error.
  
menuentry "Funtoo Linux - vmlinuz-3.16.3" {
+
; --jobs[=JOBS] -j [JOBS]
  insmod part_gpt
+
: Specifies the number of packages to build simultaneously.
  insmod fat
+
 
  set root=(hostdisk//dev/sda,gpt1)
+
; --load-average [LOAD]
  search --no-floppy --fs-uuid --set 3CFD-6884
+
: Specifies  that  no  new  builds should be started if there are other builds running and the load average is at least LOAD (a floating-point number).
  linux /vmlinuz-3.16.3 video=uvesafb:1920x1080-32,mtrr:3,ywrap rootfstype=ext4 root=/dev/sda2
+
 
  set gfxpayload=keep
+
== Configuration ==
}
+
=== make.conf ===
set default=0
+
Emerge can be configured by editing
 +
 
 +
{{file|name=/etc/portage/make.conf||desc=See [[Make.conf]]|body=
 +
CFLAGS="-march=native -O2 -pipe"
 +
CXXFLAGS="-march=native -O2 -pipe"
 +
 
 +
MAKEOPTS="-j2"
 +
EMERGE_DEFAULT_OPTS="--jobs 2 --load-average 2"
 +
INPUT_DEVICES="evdev synaptics"
 +
VIDEO_CARDS="intel i965"
 +
LINGUAS="en en_US en_GB"
 +
ACCEPT_LICENSE="*"
 +
 
 +
USE="mmx mmxext sse sse2 sse3 ssse3 threads alsa X gtk xcb dri opengl vaapi udev \
 +
    svg x264 xvid gstreamer webm vpx icu bash-completion vim-pager \
 +
    -gnome -xscreensaver -cups -fortran -deprecated -iptables -ipv6 -geoloc \
 +
    -mta -sendmail -kmod -tiff -live -quicktime -real -gpm -themes"
 
}}
 
}}
  
The lines that we have added and altered do the following:
+
=== Package.use ===
* <code>insmod efi_gop</code> and <code>insmod efi_uga</code>: Both of these involve adding support for the UEFI framebuffer to GRUB.
+
Per-package use flags can be configured in
* <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.
+
  
== Known Issues ==
+
{{file|name=/etc/portage/package.use|body=
*With pure UEFI boot mode, with legacy mode disabled, following error expected:
+
x11-wm/dwm savedconfig
** video driver not supported, boot hangs, hard reboot required.
+
x11-drivers/ati-drivers qt4
*Choose UEFI first, next legacy driver. It depends on motherboard vendor and efi bios version.
+
media-sound/ncmpcpp visualizer clock taglib
**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>. This problem can also be fixed by following the [[Efi Stub guide]] instead of the GRUB one.
+
  
=== Done! ===
+
=== package.accept_keywords ===
 +
If you want to install a package that has not been tested on your architecture you need to edit
 +
{{file|name=/etc/portage/package.accept_keywords|body=
 +
=app-misc/screenfetch-9999 **
 +
}}
  
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.
+
== Other Resources ==
 +
For more info see the emerge man page.
 +
<console>
 +
$##i## man emerge
 +
</console>
  
 +
[[Category:Portage]]
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]
 +
[[Category:Tutorial]]
 +
[[Category:System]]
 +
[[Category:First Steps]]

Latest revision as of 16:03, February 7, 2015

Getting started with emerge

Emerge is the front-end for funtoo's Portage package manager. With emerge it is easy to install, update or remove packages.

Update Package Database

Sync local package database. This will update your local Portage tree with the latest Funtoo ebuilds.

# emerge --sync

Search packages

Search packages by name.

# emerge -s firefox
# emerge --search firefox

Search packages by description.

# emerge -S web browser
# emerge --searchdesc web browser

Install packages

Install package.

# emerge firefox

Install multiple packages.

# emerge firefox thunderbird

Install package. Ask for confirmation before performing any changes. Show verbose output.

# emerge -av firefox
# emerge --ask firefox

Remove packages

Remove package.

# emerge -C firefox
# emerge --unmerge firefox

Remove package. Ask for confirmation before performing any changes.

# emerge -aC firefox

Remove orphaned packages. Ask for confirmation before performing any changes.

# emerge -a --depclean

Update packages

Update all packages.

# emerge -uDN @world

Update all packages. Ask for confirmation before performing any changes. Show verbose output.

# emerge -uavDN @world

When upgrading to a new version of perl, it is necessary to also run perl-cleaner afterwards:

# emerge -auvDN @world
# perl-cleaner --all
Note

This requirement of running perl-cleaner will eventually go away, once all perl-related ebuilds are updated to EAPI 5. EAPI 5 is a version of the Ebuild specification that supports smart updating of perl-related bits.

Emerge options

--sync
Updates the portage tree that is located in /usr/portage by default.
--search -s
Searches for matches of the supplied string in the portage tree.
--searchdesc -S
Matches the search string against the description field as well as the package name.
--ask -a
Ask for confirmation before performing any changes.
--pretend -p
Instead of actually performing the merge, simply display what *would* have been installed if --pretend weren't used.
--unmerge -C
Removes all matching packages.
--update -u
Updates packages to the best version available, which may not always be the highest version number due to masking for testing and development.
--deep [DEPTH] -D
force emerge to consider the entire dependency tree of packages, instead of checking only the immediate dependencies of the packages.
--newuse -N
Tells emerge to include installed packages where USE flags have changed since compilation.
--depclean -c
Remove orphaned packages. Cleans the system by removing packages that are not associated with explicitly merged packages.
--autounmask-write
Automatically write package.use settings as necessary to satisfy dependencies.
--resume -r
Resumes the most recent merge list that has been aborted due to an error.
--jobs[=JOBS] -j [JOBS]
Specifies the number of packages to build simultaneously.
--load-average [LOAD]
Specifies that no new builds should be started if there are other builds running and the load average is at least LOAD (a floating-point number).

Configuration

make.conf

Emerge can be configured by editing

/etc/portage/make.conf - See Make.conf
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="-march=native -O2 -pipe"

MAKEOPTS="-j2"
EMERGE_DEFAULT_OPTS="--jobs 2 --load-average 2"
INPUT_DEVICES="evdev synaptics"
VIDEO_CARDS="intel i965"
LINGUAS="en en_US en_GB"
ACCEPT_LICENSE="*"

USE="mmx mmxext sse sse2 sse3 ssse3 threads alsa X gtk xcb dri opengl vaapi udev \
     svg x264 xvid gstreamer webm vpx icu bash-completion vim-pager \
     -gnome -xscreensaver -cups -fortran -deprecated -iptables -ipv6 -geoloc \
     -mta -sendmail -kmod -tiff -live -quicktime -real -gpm -themes"

Package.use

Per-package use flags can be configured in

/etc/portage/package.use
x11-wm/dwm savedconfig
x11-drivers/ati-drivers qt4
media-sound/ncmpcpp visualizer clock taglib

package.accept_keywords

If you want to install a package that has not been tested on your architecture you need to edit

/etc/portage/package.accept_keywords
=app-misc/screenfetch-9999 **

Other Resources

For more info see the emerge man page.

$ man emerge