Difference between pages "Pure UEFI Boot Guide" and "Emerge"

(Difference between pages)
(moved efi-stub example to it's own page.)
 
m (Undo revision 8974 by Tocadotux (talk) not under pt-br names)
 
Line 1: Line 1:
his 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.
+
== 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.
  
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.
+
=== Update Package Database ===
 +
'''Sync local package database. This will update your local Portage tree with the latest Funtoo ebuilds.'''
 +
<console>
 +
###i## emerge --sync
 +
</console>
  
== What Are We Doing? ==
+
=== Search packages ===
 +
'''Search packages by name.'''
 +
<console>
 +
###i## emerge -s firefox
 +
###i## emerge --search firefox
 +
</console>
  
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.
+
'''Search packages by description.'''
 +
<console>
 +
###i## emerge -S web browser
 +
###i## emerge --searchdesc web browser
 +
</console>
  
== First Steps ==
+
=== Install packages ===
 +
'''Install package.'''
 +
<console>
 +
###i## emerge firefox
 +
</console>
  
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.
+
'''Install multiple packages.'''
 +
<console>
 +
###i## emerge firefox thunderbird
 +
</console>
  
{{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.}}
+
'''Install package. Ask for confirmation before performing any changes. Show verbose output.'''
 +
<console>
 +
###i## emerge -av firefox
 +
###i## emerge --ask firefox
 +
</console>
  
== Partitioning ==
+
=== Remove packages ===
 +
'''Remove package.'''
 +
<console>
 +
###i## emerge -C firefox
 +
###i## emerge --unmerge firefox
 +
</console>
  
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>.
+
'''Remove package. Ask for confirmation before performing any changes.'''
 +
<console>
 +
###i## emerge -aC firefox
 +
</console>
  
 +
'''Remove orphaned packages. Ask for confirmation before performing any changes.'''
 
<console>
 
<console>
Command: ##i##n ↵
+
###i## emerge -a --depclean
Partition Number: ##i##1 ↵
+
First sector: ##i##↵
+
Last sector: ##i##+500M ↵
+
Hex Code: ##i##EF00
+
 
</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:
+
=== Update packages ===
 +
'''Update all packages.'''
 +
<console>
 +
###i## emerge -uDN @world
 +
</console>
  
 +
'''Update all packages. Ask for confirmation before performing any changes. Show verbose output.'''
 
<console>
 
<console>
# ##i##mkfs.vfat -F 32 /dev/sda1
+
###i## emerge -uavDN @world
 
</console>
 
</console>
  
Your <tt>/etc/fstab</tt> entry for this filesystem will also differ, and will look like this:
+
'''When upgrading to a new version of perl, it is necessary to also run <code>perl-cleaner</code> afterwards:'''
 +
<console>
 +
###i## emerge -auvDN @world
 +
###i## perl-cleaner --all
 +
</console>
  
<pre>
+
{{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.}}
/dev/sda1 /boot vfat noatime 1 2
+
</pre>
+
  
== Kernel ==
+
== Emerge options ==
  
=== VFAT ===
+
; --sync
 +
: Updates the portage tree that is located in /usr/portage by default.
  
Make sure you add VFAT support to your kernel if you are building it manually.
+
; --search -s
 +
: Searches  for  matches  of  the  supplied  string in the portage tree.
  
=== EFI Framebuffer ===
+
; --searchdesc -S
 +
: Matches the search string against the description field as well as the package name.
  
If you have the following option enabled in your kernel, then uvesafb and efifb will not be able to detect the framebuffer:
+
; --ask -a
 +
: Ask for confirmation before performing any changes.
  
{{kernelop|title=Bus options (PCI etc.)|desc=
+
; --pretend -p
    [*] Mark VGA/VBE/EFI FB as generic system framebuffer (NEW)
+
: Instead of actually performing the merge, simply display what *would* have been installed if --pretend weren't used.
}}
+
  
If you have that option enabled, ''you must also enable'':
+
; --unmerge -C
 +
: Removes all matching packages.
  
{{kernelop|title=Device Drivers,Graphics support,Frame buffer Devices|desc=
+
; --update -u
    [*]  Simple framebuffer support
+
: Updates  packages to the best version available, which may not always be the  highest version number due to masking for testing and development.
}}
+
  
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.
+
; --deep [DEPTH] -D
 +
: force  emerge  to  consider  the entire  dependency tree of packages, instead of checking only the immediate dependencies of the packages.
  
== Boot Loader ==
+
; --newuse -N
=== EFI Stub method ===
+
: Tells emerge to include installed packages where USE flags have changed since compilation.
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 ====
+
; --depclean -c
To prepare your kernel to boot with EFI stub, make sure that the following options are built in to your kernel:
+
: Remove orphaned packages. Cleans the system by removing packages that are not associated with explicitly merged packages.
{{kernelop|title=Processor type and features|desc=
+
[*] EFI runtime service support
+
[*]    EFI stub support
+
[ ]        EFI mixed-mode support
+
  
[*] Built-in kernel command line
+
; --autounmask-write
(kernel options that you want to pass go here)
+
: 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
 +
 
 +
{{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"
 
}}
 
}}
{{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>.}}
+
=== Package.use ===
 +
Per-package use flags can be configured in
  
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|body=
{{file|name=/etc/portage/package.use|desc= |body=
+
x11-wm/dwm savedconfig
sys-kernel/better-initramfs-bin -gzip
+
x11-drivers/ati-drivers qt4
 +
media-sound/ncmpcpp visualizer clock taglib
 
}}
 
}}
then emerge better-initramfs:
+
 
<console>
+
=== package.accept_keywords ===
###i## emerge better-initramfs-bin
+
If you want to install a package that has not been tested on your architecture you need to edit
</console>
+
{{file|name=/etc/portage/package.accept_keywords|body=
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.
+
=app-misc/screenfetch-9999 **
{{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)
+
 
}}
 
}}
  
==== Building and installing the kernel ====
+
== Other Resources ==
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:
+
For more info see the emerge man page.
 
<console>
 
<console>
###i## pwd
+
$##i## man emerge
/usr/src/linux
+
###i## make -jn
+
###i## make -jn install modules_install
+
###i## mkdir -vp /boot/EFI/Boot
+
###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!
+
 
 +
[[Category:Portage]]
 +
[[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