/etc/portage/make.conf

From Gentoo Wiki
< /etc‎ | portage
Jump to:navigation Jump to:search
This page is a translated version of the page /etc/portage/make.conf and the translation is 54% complete.
Outdated translations are marked like this.

/etc/portage/make.conf, poprzednio zlokalizowany pod ścieżką /etc/make.conf, to główny plik konfiguracyjny używany do dostosowywania środowiska Portage na poziomie globalnym.. Katalog /etc/portage zawiera większość innych plików konfiguracyjnych Portage.

Ustawienia zapisane w make.conf będą miały zastosowanie do każdego pakietu, który się pojawi. Te ustawienia kontrolują wiele elementów funkcjonalności Portage, takich jak globalne opcje flagi USE, opcje językowe (L10N), Serwery lustrzane Portage, itp.

Instalowana jest bardzo podstawowa wersja podczas rozpakowywania archiwum etapu, a przykładową konfigurację można znaleźć pod ścieżką /usr/share/portage/config/make.conf.example.

Podobnie jak wiele plików konfiguracyjnych Portage, make.conf może być katalogiem, a jego zawartość zostanie zsumowana tak, jakby był pojedynczym plikiem.

See also
Podręcznik omawia używanie make.conf, szczególnie w sekcjach Flagi USE, Funkcje Portage i Zmienne. W celu uzyskania kompleksowej dokumentacji zobacz man make.conf.

Wstęp

Ostateczna konfiguracja Portage opiera się nie tylko na pliku make.conf. Ustawienia globalne zdefiniowane w tym pliku można przedefiniować (lub ponownie zdefiniować) dla poszczególnych pakietów w plikach znajdujących się w /etc/portage/package.use/, jak również za pośrednictwem zmiennych środowiskowych. Dostępne są również ustawienia domyślne zarządzane przez dystrybucję (częściowo poprzez domyślne ustawienia pakietu Portage, częściowo przez używany profil Gentoo).

Informacja
Chociaż Portage nadal obsługuje starą lokalizację pliku /etc/make.conf, jego użycie nie jest zalecane. Gdy oba pliki są dostępne, ustawienia w /etc/portage/make.conf mają pierwszeństwo przed ustawieniami w /etc/make.conf.

Zmienne

Istnieje wiele możliwych zmiennych, które można dostosować w make.conf. Tylko najczęściej używane są wyjaśnione w dalszej części tego artykułu, niektóre wraz z przykładem i linkiem do bardziej szczegółowego artykułu. Aby uzyskać więcej informacji i pełną listę zmiennych, zapoznaj się z stronami podręcznika make.conf, uruchamiając:

user $man make.conf

Większość zmiennych jest opcjonalna, może obejmować wiele wierszy, ale nie może pojawiać się więcej niż raz.

Informacja
Różne konfiguracje będą wymagać ustawienia różnych zmiennych. Poniższych przykładów nie należy traktować jako ostatecznej listy, ani minimalnego zestawu wymagań - ustaw tylko potrzebne zmienne.

CHOST

Zmienna CHOST jest przekazywana na etapie konfiguracji ebuildów w celu ustawienia hosta kompilacji systemu. Należy pamiętać, że profil Gentoo ma już ustawioną odpowiednią wartość CHOST, a jej aktualizacja wymaga wiedzy i doświadczenia w łańcuchach kompilacji.

See also
Zobacz artykuł CHOST, aby uzyskać więcej informacji.

CFLAGS i CXXFLAGS

Zmienne CFLAGS i CXXFLAGS definiują flagi budowania i kompilacji, które będą używane we wszystkich wdrożeniach pakietów (istnieją pewne wyjątki, niezależnie od tego, kto odfiltrowuje flagi, których użycie może spowodować problemy z pakietem). Zmienna CFLAGS jest przeznaczona dla aplikacji opartych na C, natomiast CXXFLAGS jest przeznaczona dla aplikacji opartych na C++. Większość użytkowników zachowa tę samą zawartość obu zmiennych.

FILE /etc/portage/make.confNajczęściej używane, rozsądne ustawienia dla CFLAGS oraz CXXFLAGS
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
See also
Więcej informacji znajdziesz w artykule Optymalizacja GCC i w Podręczniku Gentoo CFLAGS i CXXFLAGS. Zobacz również FAQ.

CONFIG_PROTECT

The CONFIG_PROTECT variable contains a space-delimited list of files and/or directories that Portage will protect from automatic modification. Proposed changes to protected configuration locations will require manual merge(s) from the system administrator (see dispatch-conf or similar merge tools).

A current list of presently protected locations can be displayed with portageq:

user $portageq envvar CONFIG_PROTECT
/etc /usr/share/config /usr/share/gnupg/qualified.txt

Using portageq is a short hand alternative to running a regular expression search on verbose, informational output from the emerge command:

user $emerge --verbose --info | grep -E '^CONFIG_PROTECT='
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"

Files or subdirectories defined within the CONFIG_PROTECT can be excluded from protection through the CONFIG_PROTECT_MASK variable. Masking is useful when a parent directory should be protected, but a certain child directory beneath it.

The variable has a sane default setting handled by the Portage installation and the users' Gentoo profile. It can be extended through the system environment (which is often used by applications that update the variable through their /etc/env.d file) and the users' /etc/portage/make.conf setting.

FILE /etc/portage/make.confPrzykładowy CONFIG_PROTECT w make.conf
CONFIG_PROTECT="/var/bind"

Zobacz również rozdział Zmienne środowiskowe w Podręczniku Gentoo.


FEATURES

The FEATURES variable contains a list of Portage features that the user wants enabled on the system, effectively influencing Portage's behavior. It is set by default via /usr/share/portage/config/make.globals, but can be easily updated through /etc/portage/make.conf. Since this is an incremental variable, FEATURES values can be added without directly overriding the ones implemented through the Gentoo profile.

FILE /etc/portage/make.confAdding keepwork to FEATURES in Portage
FEATURES="keepwork"

For more information, please see Portage features in the Gentoo Handbook and the FEATURES article. For a complete list of available features, see man 5 make.conf.

See also
Zobacz artykuł FEATURES, aby uzyskać więcej informacji.

GENTOO_MIRRORS

See also
Zobacz artykuł GENTOO_MIRRORS.

MAKEOPTS

Zmienna MAKEOPTS służy do określenia argumentów przekazywanych do make, gdy pakiety są budowane ze źródła.

FILE /etc/portage/make.confZalecane ustawienie dla dwurdzeniowego procesora z włączoną funkcją Hyper-Threading i 8 GB pamięci RAM
MAKEOPTS="-j4"
See also
Zobacz artykuł MAKEOPTS, aby uzyskać więcej informacji.
Informacja
Przeczytaj EMERGE_DEFAULT_OPTS, ponieważ ta zmienna wpływa również na zachowanie kompilacji.

EMERGE_DEFAULT_OPTS

EMERGE DEFAULT OPTS/pl

PORTAGE_SCHEDULING_POLICY

See also
Zobacz artykuł Piękno Portage.

PORTAGE_TMPDIR

The PORTAGE_TMPDIR variable defines the location of the temporary files for Portage. The value defaults to /var/tmp, resulting in /var/tmp/portage for the build location, /var/tmp/ccache for Portage's ccache support and so forth.

FILE /etc/portage/make.confDefault PORTAGE_TMPDIR setting
PORTAGE_TMPDIR="/var/tmp"

If enough memory is available, building packages can be accelerated by mounting PORTAGE_TMPDIR in RAM. See the article on Portage TMPDIR on tmpfs for more details.

DISTDIR

PKGDIR

USE

Zmienna USE umożliwia ustawienie lub wyłączenie flagi USE w całym systemie, w liście oddzielonej spacjami.

FILE /etc/portage/make.confGlobal USE flags example
USE="-kde -qt5 ldap"
See also
See the article on USE flags for full explanation. See per package control of USE flags, and the /etc/portage/package.use file, about setting USE flags for an individual package.
Informacja
Always consider whether it is worth setting a USE flag globally and what implications this will have on the system, or if it is preferable to just set a flag for one or several packages individually.
Wskazówka
A USE flag may be temporarily set on the command line to check what effect it will have, before writing it to the world file: USE="[USE flag to test]" emerge --pretend --verbose --update --deep --newuse world

ACCEPT_LICENSE

Zmienna ACCEPT_LICENSE informuje Portage, które licencje oprogramowania są dozwolone. Pakiety, których licencja nie jest akceptowalna, nie mogą być zainstalowane w systemie.

FILE /etc/portage/make.confAby zaakceptować wszystkie licencje na wszystkich pakietach (niezbyt dobry pomysł)
ACCEPT_LICENSE="*"
FILE /etc/portage/make.confAby zaakceptować tylko wolne oprogramowanie
ACCEPT_LICENSE="-* @FREE"

LINGUAS

FILE /etc/portage/make.conf
LINGUAS="de pt_BR en en_US en_GB"

USE_EXPAND

The USE_EXPAND variable is a list set in profiles/base/make.defaults as of Portage 2.0.51.20.[1]

CPU_FLAGS_*

Aby uzyskać więcej informacji, zobacz artykuł CPU_FLAGS_X86.

The CPU_FLAGS_* variable informs Portage about the CPU flags (features) permitted by the CPU. This information is used to optimize package builds specifically for the targeted features. Currently supported CPU_FLAGS_X86 (for amd64 and x86 architectures), CPU_FLAGS_ARM (for arm and arm64 architectures), and CPU_FLAGS_PPC (for ppc and ppc64 architectures).

The cpuid2cpuflags utility (found in the app-portage/cpuid2cpuflags package) can be used to query a complete listing of CPU flags supported by the system's processor. After emerging the package, issue:

user $cpuid2cpuflags
CPU_FLAGS_X86: aes avx f16c mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3

Te flagi można następnie dodać do /etc/portage/make.conf lub /etc/portage/package.use/. Zauważ, że jest to skuteczne tylko na architekturach x86 i amd64.

INPUT_DEVICES

See the make.conf section of the Xorg/Guide article and the possible values.

L10N

FILE /etc/portage/make.conf
# Defining localization values
L10N="de pt-BR en en-US en-GB"
Informacja
While common two letter language codes (like de or fr) are identical in LINGUAS and L10N, more complex entries have a different syntax because L10N uses IETF language tags (aka BCP 47). For example, pt_BR and sr@latin in LINGUAS become pt-BR and sr-Latn in L10N, respectively.

VIDEO_CARDS

For possible values of this USE_EXPAND variable see VIDEO_CARDS.

Portage uses the USE_EXPAND variable called VIDEO_CARDS to enable support for various graphics cards in packages. Setting VIDEO_CARDS to appropriate value(s) will pull in the correct driver(s):

FILE /etc/portage/make.confSet VIDEO_CARDS to intel nvidia radeon vesa
VIDEO_CARDS="intel nvidia radeon vesa"

Substitute the name of the driver(s) to be used. Common choices include nouveau, nvidia, radeon, and intel. </translate> <translate> After setting or altering VIDEO_CARDS values remember to update the system using the following command so the changes take effect:

root #emerge --ask --changed-use --deep @world
FILE /etc/portage/make.confSet VIDEO_CARDS to intel nvidia radeon vesa
VIDEO_CARDS="intel nvidia radeon vesa"

Substitute the name of the driver(s) to be used. The following table are for common combinations of machines and video cards:

Machine Discrete video card VIDEO_CARDS
Intel x86 None See Intel#Feature support
x86/ARM Nvidia nvidia
Any Nvidia except Maxwell, Pascal and Volta nouveau
Any AMD since Sea Islands amdgpu radeonsi
Any ATI and older AMD See radeon#Feature support
Any Intel intel
Raspberry Pi N/A vc4
QEMU/KVM Any virgl
WSL Any d3d12

After setting or altering VIDEO_CARDS values remember to update the system using the following command so the changes take effect:

root #emerge --ask --changed-use --deep @world

For the average user, if a graphical desktop environment is to be used this variable should be explicitly defined. For further information see the Xorg Guide make.conf section.

Aby uzyskać więcej informacji, zobacz artykuł AMDGPU lub NVIDIA.

Zobacz również

Źródła zewnętrzne

Referencje