Overlay/Local overlay

From Gentoo Wiki
Jump to: navigation, search

Someone handed you an ebuild, and you don't know what to do with it? Fear not, for here be instructions!

Creating a local overlay

You can create a local overlay with a few easy steps.

root # mkdir -p /usr/local/portage/{metadata,profiles}
root # echo 'NameOfYourOverlay' > /usr/local/portage/profiles/repo_name
root # echo 'masters = gentoo' > /usr/local/portage/metadata/layout.conf
root # chown -R portage:portage /usr/local/portage

Next, tell portage about the overlay.

root # mkdir -p /etc/portage/repos.conf
FILE /etc/portage/repos.conf/local.conf
location = /usr/local/portage
masters = gentoo
auto-sync = no
NameOfYourOverlay is an example and you should change it to something meaningful in all locations.
The old method of setting the PORTDIR_OVERLAY variable in make.conf is deprecated and should not be used.

Adding an ebuild to the overlay

Now that the basic layout is in order, you can add an ebuild to the overlay. In this example, app-dicts/artha-1.0.2 (available at [1]). We will assume the ebuild is in the homedir of the user myuser, and named artha-1.0.2.ebuild.

root # mkdir -p /usr/local/portage/app-dicts/artha
root # cp ~myuser/artha-1.0.2.ebuild /usr/local/portage/app-dicts/artha/artha-1.0.2.ebuild
root # chown -R portage:portage /usr/local/portage
root # pushd /usr/local/portage/app-dicts/artha
root # repoman manifest
root # popd

You should now be able to install the package from your overlay with emerge.

root #emerge -av1 app-dicts/artha


crossdev will automatically place the ebuilds/categories it generates into the highest priority overlay found in /etc/portage/repos.conf/. In order to do this you must set the priority number to something low. Most users will want to prevent crossdev from disturbing layman's overlays or the user's personal per-machine overlay (normally created at /usr/local/portage). Create an overlay specifically for crossdev's use:

root # mkdir -p /usr/local/portage-crossdev/{profiles,metadata}
root # echo 'local-crossdev' > /usr/local/portage-crossdev/profiles/repo_name
root # echo 'masters = gentoo' > /usr/local/portage-crossdev/metadata/layout.conf
root # chown -R portage:portage /usr/local/portage-crossdev

If the main Portage tree is synchronized using Git, or any other method with Manifest files that do not include checksums for ebuilds, prevent "masked by: corruption" errors with:

FILE /usr/local/portage-crossdev/metadata/layout.conf
masters = gentoo
thin-manifests = true

Then instruct Portage and crossdev to use this overlay:

FILE /etc/portage/repos.conf/crossdev.conf
location = /usr/local/portage-crossdev
priority = 10
masters = gentoo
auto-sync = no