|Summary=This is the official package manager/ports system for Funtoo Linux.

+

|Created on=2015/02/09

−

|CatPkg=sys-apps/portage

+

|Summary=How systemd sneaks in into Funtoo, and possible solutions for removing it.

−

|Maintainer=Drobbins, Mgorny, Oleg

+

|Author=Mgorny,

−

|Repository=Funtoo Overlay

+

|Reference Bug=FL-2091

}}

}}

−

=== Introduction ===

+

== State inherited from Gentoo ==

+

=== udev implementations ===

+

Gentoo has three udev providers:

+

* ''sys-apps/systemd'' provides udev as a part of standard systemd installation,

+

* ''sys-fs/udev'' provides the systemd variant of udev decoupled from systemd, with some Gentoo patches,

+

* ''sys-fs/eudev'' provides the Gentoo fork of udev from before it was coupled into systemd.

−

[http://en.wikipedia.org/wiki/Portage_(software) Portage] is the official package manager of Funtoo Linux. Daniel Robbins maintains a slightly different version from upstream Gentoo Linux, with support for mini-manifests and other features.

+

The existence of those providers is acknowledged by the following virtuals:

+

* ''virtual/udev'',

+

* ''virtual/libudev'',

+

* ''virtual/libgudev''.

−

=== Portage Commands ===

+

=== systemd support in packages ===

+

Gentoo has separate methods of handling ''obtrusive'' and ''unobtrusive'' systemd support in packages.

Unobtrusive support is when the package can support both OpenRC and systemd simultaneously without issues. Examples of unobtrusive support is portable, conditional code (i.e. runtime detection of init) and installation of unit files that are not used when systemd is not used.

−

;{{c|dispatch-conf}}

+

−

:tools to manage /etc/configurations

+

−

=== Portage Specifications ===

+

For obtrusive conditional support Gentoo uses USE=systemd flag. For unobtrusive support, Gentoo enables relevant features or installs relevant files unconditionally. This aimed to ease switching to systemd and back by reducing the number of rebuilds.

−

The latest progress and changes related to EAPI/PMS and Portage can often be found in the Gentoo Council meeting logs, which are listed on the [https://wiki.gentoo.org/wiki/Project:Council Gentoo Council page].

+

== Current state in Funtoo ==

+

=== Common changes ===

+

Funtoo overrides all udev virtuals to support only eudev as udev provider. This also implicitly blocks installing systemd or udev.

−

The latest PMS specification to be approved by the Gentoo Council is available: [http://dev.gentoo.org/~ulm/pms/5/pms.pdf eapi-5-approved-2012-09-20]. The PMS specification is an attempt to codify the inner workings of Portage, and is authored by Stephen Bennett, Christian Faulhammer, Ciaran McCreesh and Ulrich Müller as a Gentoo-hosted project.

+

=== no-systemd mix-in ===

+

The no-systemd mix-in additionally:

+

* masks sys-fs/udev and sys-apps/systemd,

+

* adds INSTALL_MASK to remove systemd unit files.

−

=== Portage Profiles ===

+

== Proposed future state in Funtoo ==

−

+

TODO

−

Portage uses [[Portage Profiles|profiles]] to define settings for various architectures and types of Funtoo/Gentoo systems. See the [[Portage Profiles]] page for detailed information on how Portage handles profiles. Look at [[Creating_Profiles]] to learn how to create them and at [[Funtoo_1.0_Profile]] to learn about the Funtoo 1.0 profile.

+

{{FLOPFooter}}

−

+

−

===Portage Variables ===

+

−

+

−

Portage's behavior can be controlled by a number of configuration settings other variables that can be defined within the ebuild itself. In addition, a number of these variables are defined for the ebuild automatically by Portage. These variables are now documented on their own page: [[Portage Variables]].

+

−

=== Multiple ABI Support ===

+

−

+

−

Portage contains support for multiple ABIs (Application Binary Interfaces) co-existing on the same system. This functionality has been extensively documented and has been moved to its own page: [[Multiple ABI Support]].

+

−

+

−

=== Ebuild Functions ===

+

−

+

−

An ebuild developer has the ability to define [[Ebuild Functions]] that define steps to perform during a particular part of the ebuild lifecycle. These steps are now documented on their own page: [[Ebuild Functions]].

+

−

+

−

=== Funtoo Portage Development ===

+

−

+

−

The Funtoo Core Team is currently working on a general-purpose plug-in system so that the GNU info file regeneration, news update display, and scanning of files that need updating in /etc can be pulled out of the official Portage emerge code. In addition, this plug-in system will allow other types of things to be hooked into various phases of emerge. This will allow various new plug-ins to be developed and used on systems, such as periodic security checks, etc.

+

−

+

−

=== Portage Logs ===

+

−

Logs of portage actions can be found at <code>/var/log/emerge.log</code> & <code>/var/log/portage/elog/summary.log-(date the log is generated)</code>

+

−

+

−

=== TODO ===

+

−

+

−

Add support to portage, so that when an ebuild is merged, the /var/db/pkg entry contains a list of all currently-installed versions of all ebuilds upon which that ebuild RDEPENDs. This, combined with a comprehensive set of past USE settings (may need to implement this too,) can be used to detect when an ebuild needs to be rebuilt. This could help to address issues like those in [http://bugs.gentoo.org/167662 Gentoo Bug 167662] and allow easier implementation of support for things like perl-cleaner. Currently, perl-cleaner doesn't detect that vim uses perl and moving from -ithreads to ithreads causes vim to die, so it needs to be manually rebuilt.

+

−

+

−

Add support for portage to understand which version of a particular app is the "active" version that it was built against, and record this information in /var/db/pkg. This can help to implement perl-cleaner-like support in Portage.

+

−

+

−

=== Funtoo Features/Changes ===

+

−

+

−

==== In Funtoo stable/current Portage ====

+

−

+

−

;emerge --sync from git

+

−

:If a git-based Portage tree is already in place, <tt>emerge --sync</tt> will run "git pull" to update the underlying Portage tree. If one is not in place, the contents of the SYNC variable will be used as the remote URI from which to clone a git tree (2.2). In addition, SYNC_USER and SYNC_UMASK (defaulting to root and 022) can be used to define the user account to use for cloning/syncing, as well as the umask to use. (2.2).

+

−

+

−

;Sed Wrapper Symlink and PATH fix

+

−

: The Funtoo version of Portage has replaced the BSD-only sed wrapper with a symlink. This will eventually be deprecated. The sed wrapper was a way to provide BSD systems with a "sed" command that could be used inside ebuilds that worked similarly to GNU sed. A PATH fix has been applied so that /bin/sed will be detected first anyway.

+

−

+

−

;mini-manifest

+

−

:Funtoo's Portage supports a special mode of operation where Manifests only contain digests for distfiles and not for files in the Portage tree. This is to eliminate redundant digests since git already provides SHA1 digests. This feature is currently enabled by adding "mini-manifest" to FEATURES in /etc/make.conf but the intention is to eventually move it to a repo-specific option (note: this has now been done, as "thin-manifest" functionality has been integrated into recent versions of Portage, and is being beta tested in Funtoo.) Funtoo provides a special "mini-manifest" tree that is smaller than the full-size Portage tree, and is intended to be used with the mini-manifest feature.

+

−

+

−

;preserve bindist through USE filtering

+

−

: Normally, anything not in an ebuild's IUSE is stripped from the USE passed to ebuild.sh. This patch allows "bindist" to not be stripped, so it can be used as a means to disable pre-merge sanity checks that may exist in pkg_setup() and pkg_pretend() but will not otherwise affect the resultant build. If "bindist" will affect some functionality in the package, then it should be added to an ebuild's IUSE. This patch allows pkg_setup() and pkg_pretend() to look for "bindist", which indicates that the ebuild is being built for release, typically in an automated fashion, and thus runtime sanity checks that might otherwise run can be optionally skipped. This check is used by the udev-160-r1.ebuild to see if we should fail if we are merging udev on a system where the kernel will not support it. In Metro, this is not a big deal, but on a ''real'' production system, merging the udev on an incompatible system will render the kernel inoperable.

+

−

+

−

;safetydance FEATURE

+

−

:A new FEATURE setting is used by Funtoo's udev ebuild called "safetydance" which can be used to manually bypass sanity checks. This is an alternative to the "bindist" approach above. udev-160 in Funtoo Linux supports both approaches and Metro sets "safetydance" by default.

+

−

+

−

;GLEP 55 removal

+

−

:Some code to support GLEP 55 has been removed.

+

−

+

−

;new metadata format (experimental)

+

−

:Some tweaks to ebuild.sh have been made so that it is easier to support new metadata formats in the future.

+

−

+

−

;xz-utils auto-dependency

+

−

:There are several ebuilds in the Gentoo Portage repository that use .xz files but do not explicitly depend on xz-utils. A workaround has been added to ebuild.sh to add this dependency to metadata automatically if a .xz file exists in SRC_URI. This change is not yet in the official Portage sources but is being used on the Funtoo side when generating our git-based Portage trees.

: Normally, anything not in an ebuild's IUSE is stripped from the USE passed to ebuild.sh. This patch allows "bindist" to not be stripped, so it can be used as a means to disable pre-merge sanity checks that may exist in pkg_setup() and pkg_pretend() but will not otherwise affect the resultant build. If "bindist" will affect some functionality in the package, then it should be added to an ebuild's IUSE. This patch allows pkg_setup() and pkg_pretend() to look for "bindist", which indicates that the ebuild is being built for release, typically in an automated fashion, and thus runtime sanity checks that might otherwise run can be optionally skipped. This check is used by the udev-160-r1.ebuild to see if we should fail if we are merging udev on a system where the kernel will not support it. In Metro, this is not a big deal, but on a ''real'' production system, merging the udev on an incompatible system will render the kernel inoperable.

Funtoo Linux Optimization Proposal: No-systemd system

How systemd sneaks in into Funtoo, and possible solutions for removing it.

State inherited from Gentoo

udev implementations

Gentoo has three udev providers:

sys-apps/systemd provides udev as a part of standard systemd installation,

sys-fs/udev provides the systemd variant of udev decoupled from systemd, with some Gentoo patches,

sys-fs/eudev provides the Gentoo fork of udev from before it was coupled into systemd.

The existence of those providers is acknowledged by the following virtuals:

virtual/udev,

virtual/libudev,

virtual/libgudev.

systemd support in packages

Gentoo has separate methods of handling obtrusive and unobtrusive systemd support in packages.

Obtrusive support is when systemd support:

collides with OpenRC support,

requires systemd being installed (e.g. linking to systemd libraries).

Unobtrusive support is when the package can support both OpenRC and systemd simultaneously without issues. Examples of unobtrusive support is portable, conditional code (i.e. runtime detection of init) and installation of unit files that are not used when systemd is not used.

For obtrusive conditional support Gentoo uses USE=systemd flag. For unobtrusive support, Gentoo enables relevant features or installs relevant files unconditionally. This aimed to ease switching to systemd and back by reducing the number of rebuilds.

Current state in Funtoo

Common changes

Funtoo overrides all udev virtuals to support only eudev as udev provider. This also implicitly blocks installing systemd or udev.