Gentoo:Overlays

From Linux 101, The beginner's guide to all things Linux.

Jump to: navigation, search

Contents

[edit] What is an Overlay?

Overlays are almost exactly what they sound like. They are simply a set of ebuilds that lay on top of the standard Portage ebuilds. They are useful for allowing the installation of customized programs or older and newer versions of the programs available in Portage. For instance, if you wished to add a specific patch to a program, you would edit the current ebuild and add in the new patch. However, if you were to save the ebuild over the portage one, then during your next emerge --sync, your custom ebuild would be overwritten. Thus, an overlay is ideal as it allows these ebuilds to survive a Portage update.

[edit] How do I create an Overlay?

There are a number of ways to setup an overlay for use and you may find you are partial to one over the other based on what you are attempting to accomplish. In order for Portage to recognize an overlay directory, the PORTDIR_OVERLAY directive must be set in /etc/make.conf such as

PORTDIR_OVERLAY="/etc/portage/local"

where /etc/portage/local is your selected overlay directory.

[edit] Automatic Creation

Automatic creation is done through the use of the utility layman. Simply emerge the utility and add the appropriate make.conf setting,

# emerge layman
# echo "source <LAYMAN OVERLAY DIRECTORY GOES HERE>/make.conf" >> /etc/make.conf

and run

# layman -f

to download a current list of available overlays. This switch is also used to update the listing. If you do not have a specific overlay in mind, you can find all those offered through layman by issuing

# layman -L

and following that with

# layman -a <overlay name>

to download and set up the overlay.

[edit] Manual Creation

To manually create an overlay you would simply select a place to set the ebuild files other than your current Portage location. For instance, if your Portage files were stored in /usr/portage/, as is default, you could place your overlay in /usr/local/portage. For ease of use, however, I recommend that your overlays are placed into /etc/portage/local as a fair number of more advanced Portage configuration files are readily accessible (after their creation) from /etc/portage.

[edit] Prefabricated Creation

Almost identical to the automatic creation method (sans the automation), the prefabricated creation of an overlay stems from downloading an overlay from someone providing it and then simply extracting it into your overlay directory set in /etc/make.conf. The tarball will contain the directory structure required, as well as all necessary files to get you up and running quickly and easily. Once the files are extracted to their proper location, they will be immediately available for emerging (provided there are no masked packages or other unforeseen conflicts.)

[edit] Related Links

The Portage Articles Series

portage | emerge | make.conf | use flags | cflags | Overlays


Navigation: Gentoo Index
Personal tools