Difference between pages "Welcome" and "FLOP:No-systemd system"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
<div class="container" style="font-family: Open Sans; font-size: 14px; line-height: 20px;"><div class="row"><div class="col-xs-12 col-md-8 col-lg-8">
{{FLOP
{{Slideshow}}
|Created on=2015/02/09
</div><div class="col-xs-12 col-md-4 col-lg-4">
|Summary=How systemd sneaks in into Funtoo, and possible solutions for removing it.
'''Funtoo Linux''' is a Linux-based operating system that is a variant of [http://en.wikipedia.org/wiki/Gentoo_Linux Gentoo Linux], led by [[User:Drobbins|Daniel Robbins]] (the creator and former Chief Architect of Gentoo) who serves as benevolent dictator for life (BDFL) of the project. ''Funtoo Linux is optimized for the best possible performance, supporting Intel Core i7, AMD FX Processors, and others.''  [[Subarches|See what we support.]] See [[#Distinctives|Distinctives]], below, for more information about what makes us special.
|Author=Mgorny,
 
|Reference Bug=FL-2091
'''Other Funtoo Projects include''':
*  '''[[Keychain]]''', an SSH/GPG agent front-end.
* '''[[Metro]]''', automated Funtoo build engine.
 
 
'''Ebuild pages recently updated:''' {{#ask: [[Category:Ebuilds]]
| order=descending
| sort=Modification date
| format=list
| limit=10
| searchlabel=more...
}}
}}
== 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.


'''Want to submit a screenshot? [http://forums.funtoo.org/index.php?/topic/180-screenshots/ See here.]'''
The existence of those providers is acknowledged by the following virtuals, see http://www.funtoo.org/Virtual_Packages :
</div></div><div class="row"><div class="col-xs-12">
* ''virtual/udev'',
{{Announce|[[Support Funtoo]] and help us grow! '''Donate $15 per month and get a free SSD-based [[Funtoo Hosting|Funtoo Virtual Container]].'''}}
* ''virtual/libudev'',
</div></div><div class="row"><div class="col-xs-12 col-md-4 col-lg-4">
* ''virtual/libgudev''.
=== News ===
{{NewsList|3}}
[[News|View More News...]]
 
=== Expand the wiki! ===
 
The [[:Help:Funtoo_Editing_Guidelines | How to 'wiki']] will help get you started on wiki editing. Have a look at [[Requested-Documents]] and [[:Category:Needs_Updates | pages that need to be updated.]]
 
See [[:Category:Ebuilds|Ebuilds]] for a list of all ebuild pages, and [[Adding an Ebuild to the Wiki]] for information on how to add one.
</div><div class="col-sm-12 col-xs-12 col-md-4 col-lg-4">
=== Distinctives ===
 
Funtoo Linux is a meta-distribution, which means it is built (fully automatically) with the functionality and optimizations that ''you'' want, not what some distro maintainer thought was best for you. Packages are installed directly from source code, thanks to the [http://en.wikipedia.org/wiki/Portage_(software) Portage ports system], inspired by the FreeBSD ports system, written in Python and with full advanced package management functionality.  


''Benefits for desktops'': leaner, optimized, faster system. ''Additional benefits for servers'': enable only what you actually need to reduce attack surface, thus improving security.
=== systemd support in packages ===
Gentoo has separate methods of handling ''obtrusive'' and ''unobtrusive'' systemd support in packages.


We use [http://en.wikipedia.org/wiki/Git_(software) Git] for all our development, and we also use Git to deliver our ports tree to you.
Obtrusive support is when systemd support:
* collides with OpenRC support,
* requires systemd being installed (e.g. linking to systemd libraries).


In contrast to Gentoo Linux, we offer a number of innovations, including our extensive use of git, [[Funtoo 1.0 Profile|our profile system]], [[Package:Boot-Update|boot-update]] boot management tool, our incredibly flexible [[Funtoo Linux Networking|template-based networking scripts]], [[Metro Quick Start Tutorial|Metro]] distribution build system, support of Debian, RHEL and other kernels, [[Creating_Python-related_Ebuilds|enhanced Python support]], Portage mini-manifests, user-centric distribution model, and a large number of community infrastructure improvements.
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.  
</div><div class="col-sm-12 col-xs-12 col-md-4 col-lg-4">
=== Getting Started ===


'''[[Funtoo Linux Installation|Install Funtoo Linux]]''' and get involved in our user community. Get to know fellow users on our '''[http://forums.funtoo.org forums]'''. Funtoo Linux has a very active [http://en.wikipedia.org/wiki/IRC IRC] community on [http://freenode.net Freenode] (in the <code>#funtoo</code> channel) and you are encouraged to hang out with us.
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.  


'''[[Reporting Bugs|We welcome bug reports and suggestions]]'''. You are strongly encouraged to report them on our '''[http://bugs.funtoo.org bug tracker]'''. We take all bugs seriously, and all work performed is tracked on our bug tracker, for purposes of transparency.
Currently, by default, when using and running OpenRC, unobtrusive scenario implemented by means even when USE=systemd disabled and systemd ebuild masked, ebuilds installing units, sockets, etc. We find this policy controversial to user's needs.


'''{{CreateAccount}}''', which allows you to log in to the wiki, [http://forums.funtoo.org forums] and [https://bugs.funtoo.org bug tracker], and then add yourself to our [[Usermap]]. See the [[Funtoo Authentication FAQ|Auth FAQ]] for more info about account creation.
== 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.


'''[[:Category:Articles|Learn Linux fundamentals]]''' from Daniel Robbins, including Open Source tools such as [[Sed_by_Example,_Part_1|Sed]], [[Awk_by_Example,_Part_1|Awk]]. [[Bash_by_Example,_Part_1|Bash]] and more.
However, sys-apps/systemd and sys-fs/udev are not masked, so attempt at installing either of them will result in hard-to-understand blockers. Furthermore, USE=systemd is not masked, so users can enable it and be confused by the resulting blockers.


'''See our [[Funtoo Linux FAQ|FAQ]] for answers to common questions.'''
A number of packages install systemd-related files (the ''unobtrusive support'' from Gentoo). This includes:
* systemd units (services) in ''/usr/lib/systemd/system'' installed by multiple packages,
* binfmt descriptions in ''/usr/lib/binfmt.d'' (''dev-dotnet/pe-format'', used by OpenRC as well),
* modules loaded at boot in ''/usr/lib/modules-load.d'' (not yet observed, TODO: check if OpenRC uses it),
* sysctl settings in ''/usr/lib/sysctl.d'' (not yet observed),
* declarations of system users & groups in ''/usr/lib/sysusers.d'' (not yet observed outside systemd),
* tmpfiles.d in ''/usr/lib/tmpfiles.d'' installed by multiple packages (used by OpenRC as well),
* potentially other configuration files in ''/usr/lib/systemd'' (''sys-power/upower''),
* potentially any other executable in ''/usr/lib/systemd'' (unsupported ''sys-fs/udev''), sometimes used outside systemd as well.


Other resources include [http://larrythecow.org larrythecow.org], the Gentoo blog aggregator, [http://kernel-seeds.org kernel-seeds.org], and [http://git.funtoo.org git.funtoo.org], our cgit repository browser.
=== no-systemd mix-in ===
</div></div></div>
The no-systemd mix-in additionally:
* masks sys-fs/udev and sys-apps/systemd,
* adds INSTALL_MASK to remove systemd files in ''/usr/lib/systemd'' (and the incorrect ''/lib/systemd'' directory).


__NOTITLE__
After enabling the mix-in, new packages no longer install directly systemd-related files. However, files from existing packages are kept until all the packages that were installing them are rebuilt. The {{Package|app-portage/install-mask}} script can be used to find packages needing rebuild. Alternatively, the user can remove those directories manually.
__NOEDITSECTION__
{{#subobject:|slideIndex=0|slideCaption=
<h4>h3nnn4n</h4>


Awesome WM / Conky / screenfetch
It should be noted that removing ''/usr/lib/systemd'' may be unsafe. While this particular example is irrelevant to Funtoo, sys-fs/udev installs its udev daemon there and the daemon is used by OpenRC as well. Therefore removing the directory results in defunct udev. Other packages may follow a similar logic of installing system daemons in ''/usr/lib/systemd'' while the daemons can be used on OpenRC systems.
|slideImage=File:H3nnn4n.jpg}}
{{#subobject:|slideIndex=1|slideCaption=
<h4>brushdemon</h4>


OpenBox / screenfetch
== Possible changes for Funtoo ==
|slideImage=File:brushdemon.jpg}}
=== Consistent no-systemd setup by default ===
{{#subobject:|slideIndex=2|slideCaption=
Since Funtoo does not support systemd, the explicit no-systemd mix-in seems redundant. Instead, the base profile could specifically:
<h4>drobbins</h4>
# mask alternative udev providers,
# mask USE=systemd and other flags requiring systemd,
# disable installing systemd files in safe way.


[[GNOME First Steps|GNOME 3.14]]  / [[Funtoo_Linux_FAQ#Do_you_support_systemd.3F|without systemd]] / Badgers optional
=== systemd units controlled via USE flags ===
|slideImage=File:gnome3122.jpg|slideLink=GNOME First Steps}}
It has been suggested that the ebuilds installing systemd-related files can gain USE=systemd even for non-obtrusive uses. To avoid forking numerous ebuilds, this could be done via modifying ''systemd.eclass''. However, the eclass isn't suited for conditional install (and so aren't some build systems) and focuses on providing the install paths.


{{#subobject:|slideIndex=3|slideCaption=
Instead, the eclass could be modified to return a well-known discard directory — and the directory would be either added to INSTALL_MASK, or stripped directly in Portage. However, I don't see any clear advantage over using standard install locations and stripping them via INSTALL_MASK.
<h4>spectromas</h4>


[[Package:Awesome_(Window_Manager)|Awesome WM]]
=== Improved INSTALL_MASK handling ===
|slideImage=File:awesome.jpg|slideLink=Package:Awesome (Window Manager)}}
A semi-related potential improvement is to port the features provided by {{Package|app-portage/install-mask}} directly into Portage. This would specifically involve:
# support for named sets of directories (alike USE flags), e.g. instead of ''/usr/lib/systemd/system /usr/lib/systemd/user …'', you'd use ''@systemd'',
# options to cause rebuilds/binpkg reinstalls when the files effectively installed by package would change (due to change in INSTALL_MASK),
# ''emaint'' function to directly remove files in directories added to INSTALL_MASK.


{{#seo:
{{FLOPFooter}}
|title=Funtoo Linux
|keywords=funtoo,linux,gentoo,Daniel Robbins
|description=Funtoo Linux is a Gentoo-based OS that uses a git-based Portage tree. Run by Daniel Robbins, creator of Gentoo.
}}

Latest revision as of 09:00, February 10, 2015

Created on
2015/02/09
Original Author(s)
Mgorny
Status
Reference Bug
FL-2091

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, see http://www.funtoo.org/Virtual_Packages :

  • 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.

Currently, by default, when using and running OpenRC, unobtrusive scenario implemented by means even when USE=systemd disabled and systemd ebuild masked, ebuilds installing units, sockets, etc. We find this policy controversial to user's needs.

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.

However, sys-apps/systemd and sys-fs/udev are not masked, so attempt at installing either of them will result in hard-to-understand blockers. Furthermore, USE=systemd is not masked, so users can enable it and be confused by the resulting blockers.

A number of packages install systemd-related files (the unobtrusive support from Gentoo). This includes:

  • systemd units (services) in /usr/lib/systemd/system installed by multiple packages,
  • binfmt descriptions in /usr/lib/binfmt.d (dev-dotnet/pe-format, used by OpenRC as well),
  • modules loaded at boot in /usr/lib/modules-load.d (not yet observed, TODO: check if OpenRC uses it),
  • sysctl settings in /usr/lib/sysctl.d (not yet observed),
  • declarations of system users & groups in /usr/lib/sysusers.d (not yet observed outside systemd),
  • tmpfiles.d in /usr/lib/tmpfiles.d installed by multiple packages (used by OpenRC as well),
  • potentially other configuration files in /usr/lib/systemd (sys-power/upower),
  • potentially any other executable in /usr/lib/systemd (unsupported sys-fs/udev), sometimes used outside systemd as well.

no-systemd mix-in

The no-systemd mix-in additionally:

  • masks sys-fs/udev and sys-apps/systemd,
  • adds INSTALL_MASK to remove systemd files in /usr/lib/systemd (and the incorrect /lib/systemd directory).

After enabling the mix-in, new packages no longer install directly systemd-related files. However, files from existing packages are kept until all the packages that were installing them are rebuilt. The No results script can be used to find packages needing rebuild. Alternatively, the user can remove those directories manually.

It should be noted that removing /usr/lib/systemd may be unsafe. While this particular example is irrelevant to Funtoo, sys-fs/udev installs its udev daemon there and the daemon is used by OpenRC as well. Therefore removing the directory results in defunct udev. Other packages may follow a similar logic of installing system daemons in /usr/lib/systemd while the daemons can be used on OpenRC systems.

Possible changes for Funtoo

Consistent no-systemd setup by default

Since Funtoo does not support systemd, the explicit no-systemd mix-in seems redundant. Instead, the base profile could specifically:

  1. mask alternative udev providers,
  2. mask USE=systemd and other flags requiring systemd,
  3. disable installing systemd files in safe way.

systemd units controlled via USE flags

It has been suggested that the ebuilds installing systemd-related files can gain USE=systemd even for non-obtrusive uses. To avoid forking numerous ebuilds, this could be done via modifying systemd.eclass. However, the eclass isn't suited for conditional install (and so aren't some build systems) and focuses on providing the install paths.

Instead, the eclass could be modified to return a well-known discard directory — and the directory would be either added to INSTALL_MASK, or stripped directly in Portage. However, I don't see any clear advantage over using standard install locations and stripping them via INSTALL_MASK.

Improved INSTALL_MASK handling

A semi-related potential improvement is to port the features provided by No results directly into Portage. This would specifically involve:

  1. support for named sets of directories (alike USE flags), e.g. instead of /usr/lib/systemd/system /usr/lib/systemd/user …, you'd use @systemd,
  2. options to cause rebuilds/binpkg reinstalls when the files effectively installed by package would change (due to change in INSTALL_MASK),
  3. emaint function to directly remove files in directories added to INSTALL_MASK.