Difference between revisions of "Handbook:Parts/Portage/CustomTree"

From Gentoo Wiki
Jump to:navigation Jump to:search
(Marked this version for translation)
(Template updates. Link update.)
Line 2: Line 2:
 
</noinclude>{{Handbook:Parts/TOC}}
 
</noinclude>{{Handbook:Parts/TOC}}
  
== Using a subset of the portage tree == <!--T:3-->
+
== Using a subset of the Portage tree == <!--T:3-->
  
 
=== Excluding packages and categories === <!--T:4-->
 
=== Excluding packages and categories === <!--T:4-->
  
 
<!--T:5-->
 
<!--T:5-->
It is possible to selectively update certain categories/packages and ignore the other categories/packages. This can be achieved by having rsync exclude categories/packages during the <code>emerge --sync</code> step.
+
It is possible to selectively update certain categories/packages and ignore the other categories/packages. This can be achieved by having rsync exclude categories/packages during the {{c|emerge --sync}} step.
  
 
<!--T:6-->
 
<!--T:6-->
Define the name of the file that contains the exclude patterns in the PORTAGE_RSYNC_EXTRA_OPTS variable in {{Path|/etc/portage/make.conf}}:
+
Define the name of the file that contains the exclude patterns in the <var>PORTAGE_RSYNC_EXTRA_OPTS</var> variable in {{Path|/etc/portage/make.conf}}:
  
 
<!--T:7-->
 
<!--T:7-->
Line 27: Line 27:
 
== Adding unofficial ebuilds == <!--T:10-->
 
== Adding unofficial ebuilds == <!--T:10-->
  
=== Defining a portage overlay directory === <!--T:11-->
+
=== Defining a Portage overlay directory === <!--T:11-->
  
 
<!--T:12-->
 
<!--T:12-->
It is possible to ask portage to use ebuilds that are not officially available through the portage tree. Create a new directory (for instance {{Path|/usr/local/portage}}) in which to store the 3rd-party ebuilds. Use the same directory structure as the official Portage tree!
+
It is possible to ask Portage to use ebuilds that are not officially available through the Portage tree. Create a new directory (for instance {{Path|/usr/local/portage}}) in which to store the 3rd-party ebuilds. Use the same directory structure as the official Portage tree!
  
 
<!--T:13-->
 
<!--T:13-->
Then define PORTDIR_OVERLAY in {{Path|/etc/portage/make.conf}} and have it point to the previously defined directory. When using portage now, it will take those ebuilds into account as well without removing/overwriting those ebuilds the next time <code>emerge --sync</code> is ran.
+
Then define <var>PORTDIR_OVERLAY</var> in {{Path|/etc/portage/make.conf}} and have it point to the previously defined directory. When using Portage now, it will take those ebuilds into account as well without removing/overwriting those ebuilds the next time {{c|emerge --sync}} is ran.
  
 
=== Working with several overlays === <!--T:14-->
 
=== Working with several overlays === <!--T:14-->
  
 
<!--T:15-->
 
<!--T:15-->
For the powerusers who develop on several overlays, test packages before they hit the portage tree or just want to use unofficial ebuilds from various sources, the {{Package|app-portage/layman}} package brings <code>layman</code>, a tool to help users keep the overlay repositories up to date.
+
For the power users who develop on several overlays, test packages before they hit the Portage tree or just want to use unofficial ebuilds from various sources, the {{Package|app-portage/layman}} package brings {{c|layman}}, a tool to help users keep the overlay repositories up to date.
  
 
<!--T:16-->
 
<!--T:16-->
First install and configure <code>layman</code> as shown in the [https://www.gentoo.org/proj/en/overlays/userguide.xml Overlays Users' Guide], and add the desired repositories with <code>layman -a</code>.
+
First install and configure {{c|layman}} as shown in the [[Project:Overlays/User_Guide|Overlays User Guide]], and add the desired repositories with {{c|layman -a}}.
  
 
<!--T:17-->
 
<!--T:17-->
Line 50: Line 50:
  
 
<!--T:19-->
 
<!--T:19-->
Regardless of how many repositories are used through <code>layman</code>, all the repositories can be updated with the following command:
+
Regardless of how many repositories are used through {{c|layman}}, all the repositories can be updated with the following command:
  
 
<!--T:20-->
 
<!--T:20-->
Line 56: Line 56:
  
 
<!--T:21-->
 
<!--T:21-->
For more information on working with overlays, please read <code>man layman</code> and the previously linked layman/overlay users' guide.
+
For more information on working with overlays, please read {{c|man layman}} and the previously linked layman/overlay users' guide.
  
== Non-portage maintained software == <!--T:22-->
+
== Non-Portage maintained software == <!--T:22-->
  
=== Using portage with self-maintained software === <!--T:23-->
+
=== Using Portage with self-maintained software === <!--T:23-->
  
 
<!--T:24-->
 
<!--T:24-->
Sometimes users want to configure, install and maintain software individually without having Portage automate the process, even though Portage can provide the software titles. Known cases are kernel sources and nvidia drivers. It is possible to configure Portage so it knows that a certain package is manually installed on the system (and thus take this information into account when calculating dependencies). This process is called ''injecting'' and is supported by portage through the {{Path|/etc/portage/profile/package.provided}} file.
+
Sometimes users want to configure, install and maintain software individually without having Portage automate the process, even though Portage can provide the software titles. Known cases are kernel sources and nvidia drivers. It is possible to configure Portage so it knows that a certain package is manually installed on the system (and thus take this information into account when calculating dependencies). This process is called ''injecting'' and is supported by Portage through the {{Path|/etc/portage/profile/package.provided}} file.
  
 
<!--T:25-->
 
<!--T:25-->
For instance, to inform portage about gentoo-sources-2.6.11.6 which has been installed manually, add the following line to {{Path|/etc/portage/profile/package.provided}}:
+
For instance, to inform Portage about gentoo-sources-2.6.11.6 which has been installed manually, add the following line to {{Path|/etc/portage/profile/package.provided}}:
  
 
<!--T:30-->
 
<!--T:30-->
Line 77: Line 77:
  
 
<!--T:29-->
 
<!--T:29-->
{{#set:Has Title=Custom portage tree}}
+
{{#set:Has Title=Custom Portage tree}}
 
{{Handbook:Parts/Navigator|Prev=Handbook:{{ROOTPAGENAME}}/Portage/Tools|Next=Handbook:{{ROOTPAGENAME}}/Portage/Advanced}}
 
{{Handbook:Parts/Navigator|Prev=Handbook:{{ROOTPAGENAME}}/Portage/Tools|Next=Handbook:{{ROOTPAGENAME}}/Portage/Advanced}}
  

Revision as of 22:24, 3 September 2015

Parts Handbook
Installation
About the installation
Choosing the media
Configuring the network
Preparing the disks
The stage file
Installing base system
Configuring the kernel
Configuring the system
Installing tools
Configuring the bootloader
Finalizing
Working with Gentoo
Portage introduction
USE flags
Portage features
Initscript system
Environment variables
Working with Portage
Files and directories
Variables
Mixing software branches
Additional tools
Custom package repository
Advanced features
OpenRC network configuration
Getting started
Advanced configuration
Modular networking
Wireless
Adding functionality
Dynamic management


Using a subset of the Portage tree

Excluding packages and categories

It is possible to selectively update certain categories/packages and ignore the other categories/packages. This can be achieved by having rsync exclude categories/packages during the emerge --sync step.

Define the name of the file that contains the exclude patterns in the PORTAGE_RSYNC_EXTRA_OPTS variable in /etc/portage/make.conf:

FILE /etc/portage/make.confDefining the exclude file
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
FILE /etc/portage/rsync_excludesExcluding all games
games-*/*

Note however that this may lead to dependency issues since new, allowed packages might depend on new but excluded packages.

Adding unofficial ebuilds

Defining a Portage overlay directory

It is possible to ask Portage to use ebuilds that are not officially available through the Portage tree. Create a new directory (for instance /usr/local/portage) in which to store the 3rd-party ebuilds. Use the same directory structure as the official Portage tree!

Then define PORTDIR_OVERLAY in /etc/portage/make.conf and have it point to the previously defined directory. When using Portage now, it will take those ebuilds into account as well without removing/overwriting those ebuilds the next time emerge --sync is ran.

Working with several overlays

For the power users who develop on several overlays, test packages before they hit the Portage tree or just want to use unofficial ebuilds from various sources, the app-portage/layman package brings layman, a tool to help users keep the overlay repositories up to date.

First install and configure layman as shown in the Overlays User Guide, and add the desired repositories with layman -a.

For instance, to enable the hardened-development overlay:

root #layman -a hardened-development

Regardless of how many repositories are used through layman, all the repositories can be updated with the following command:

root #layman -S

For more information on working with overlays, please read man layman and the previously linked layman/overlay users' guide.

Non-Portage maintained software

Using Portage with self-maintained software

Sometimes users want to configure, install and maintain software individually without having Portage automate the process, even though Portage can provide the software titles. Known cases are kernel sources and nvidia drivers. It is possible to configure Portage so it knows that a certain package is manually installed on the system (and thus take this information into account when calculating dependencies). This process is called injecting and is supported by Portage through the /etc/portage/profile/package.provided file.

For instance, to inform Portage about gentoo-sources-2.6.11.6 which has been installed manually, add the following line to /etc/portage/profile/package.provided:

FILE /etc/portage/package.providedMarking gentoo-sources-2.6.11.6 as manually installed
sys-kernel/gentoo-sources-2.6.11.6
Note
This is a file that uses versions without an operator.