手册:IA64/使用Portage/定制Portage树

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Handbook:IA64/Portage/CustomTree and the translation is 100% complete.
Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎polski • ‎português do Brasil • ‎русский • ‎தமிழ் • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어
IA64 Handbook
安装
关于安装
选择安装媒介
配置网络
准备磁盘
安装stage3
安装基本系统
配置Linux内核
配置系统
安装系统工具
配置系统引导程序Bootloader
收尾安装工作
使用Gentoo
Portage介绍
USE标记
Portage功能特性
初始化脚本(Initscript)系统
环境变量
使用Portage
文件和目录
变量
混合使用不同的软件分支
额外的工具
定制Portage树
高级特性
网络配置
入门
高级配置
模块化网络
无线
添加功能
动态管理


使用 Gentoo 存储库的子集

不含包和类别

可以有选择地更新某些类别/包而忽略其他类别/包。这可以通过在 emerge --sync 步骤中使用 rsync 排除类别/包来实现。

/etc/portage/make.confPORTAGE_RSYNC_EXTRA_OPTS 变量中定义包含排除模式的文件的名称:

FILE /etc/portage/make.conf定义排除文件
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
FILE /etc/portage/rsync_excludes排除所有游戏类别
games-*/*

但是请注意,这可能会导致依赖性问题,因为新的、允许的包可能依赖于新的但排除在外的包。

为了使此方法起作用,必须禁用清单验证,这会降低存储库的安全性。要禁用验证,可以在 sys-apps/portage 上禁用 rsync-verify USE 标志或在 Gentoo 存储库的 repos.conf 条目中设置 sync-rsync-verify-metamanifest=no

添加非官方 ebuild

定义自定义 ebuild 存储库

It is possible to instruct Portage to use ebuilds that are not officially available through the Gentoo ebuild repository. In order to do so, create a new directory (for instance /var/db/repos/localrepo) in which to store the 3rd party ebuilds. This new repository will require the same directory structure as the official Gentoo repository.

root #mkdir -p /var/db/repos/localrepo/{metadata,profiles}
root #chown -R portage:portage /var/db/repos/localrepo

Next, pick a sensible name for the repository. The next example uses "localrepo" as the name:

root #echo 'localrepo' > /var/db/repos/localrepo/profiles/repo_name

Tell Portage that the repository master is the main Gentoo ebuild repo, and that the local repository should not be automatically synchronized (as it is not backed by an external source such as an rsync server, git mirror, or other repository type):

FILE /var/db/repos/localrepo/metadata/layout.conf
masters = gentoo
auto-sync = false

Finally, enable the repository on the local system by creating a repository configuration file inside /etc/portage/repos.conf. This will inform Portage of where the custom local repository can be found:

FILE /etc/portage/repos.conf/localrepo.conf
[localrepo]
location = /var/db/repos/localrepo

使用多个overlay

For the power users who develop on several overlays, test packages before they hit the Gentoo repository 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.

Alternatively, install app-eselect/eselect-repository to utilize the native synchronization in Portage. See also Eselect/Repository

eselect 存储库

使用 eselect 模块添加存储库很简单(可通过 app-eselect/eselect-repository 获得):

例如,要启用 hardened-development overlay:

root #eselect repository enable hardened-development

使用此方法添加的 overlay 随以下命令更新:

root #emerge --sync

Layman

首先安装和配置 layman,如 Overlays 用户指南 中所示,并使用 layman -a 添加所需的存储库。

例如,启用 hardened-development overlay:

root #layman -a hardened-development

无论通过 layman 使用多少个仓库,都可以使用以下命令来更新所有仓库:

root #layman -S

有关使用 overlay 的更多信息,请参阅 man layoutman 和之前的 layman/overlay 用户指南链接。

非 Portage 维护的软件

使用自维护的 Portage 软件

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-4.9.16 which has been installed manually, add the following line to /etc/portage/profile/package.provided:

FILE /etc/portage/profile/package.providedMarking gentoo-sources-4.9.16 as manually installed
sys-kernel/gentoo-sources-4.9.16
Note
这是一个使用没有 = 运算符的描述版本的文件。