Difference between pages "FLOP:No-systemd system" and "Wim42gnu's-setup"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
{{FLOP
WIM42GNU's Funtoo Setup
|Created on=2015/02/09
|Summary=How systemd sneaks in into Funtoo, and possible solutions for removing it.
|Author=Mgorny,
|Reference Bug=FL-2091
}}
== 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 :
This is for everybody who might have seen my funtoo setup and liked it!
* ''virtual/udev'',
This is also for myself to keep track on my system. I have used most of the Linux distributions out there and I am currently most happy with funtoo.  
* ''virtual/libudev'',
My reasons are:
* ''virtual/libgudev''.
# Gentoo/Funtoo is a rolling release distribution, meaning you only have to install it once and update it frequently.
# Gentoo/Funtoo is only what you make out of it, no unnesecary rubish like in Ubuntu, OpenSuse or Fedora will be installed by default. In the mean time being aware that Gentoo/Funtoo is for advanced users not careing that much about GUIs for Settings or Configs.
# Gentoo/Funtoo runs fast due to multiple reasons. (Compiling your own software,USE-Flags,...)
# Philosophy, one would think that Slackware would suite me most (KISS,Unix) but the fact is that these distributions require you more energy and time to work with. I want to get my jobs done, not careing to much about the system. It is okay to have tools that do things for you as long they are designed well - like in funtoo.


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


Obtrusive support is when systemd support:
'''1. Install Funtoo'''
* 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.  
''Follow the install instructions and setup a minimal system.''http://www.funtoo.org/Funtoo_Linux_Installation


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.
'''2. Install your WindowManager or DesktopEnviroment'''


== Current state in Funtoo ==
''My favourite Window Manager at the time is i3 followed by xfce and openbox.''
=== 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.
'''i3 setup:'''


A number of packages install systemd-related files (the ''unobtrusive support'' from Gentoo). This includes:
1) install these packages:  
* systemd units (services) in ''/usr/lib/systemd/system'' installed by multiple packages,
<console> emerge --ask i3 i3status dmenu lxappeareance
* binfmt descriptions in ''/usr/lib/binfmt.d'' (''dev-dotnet/pe-format'', used by OpenRC as well),
</console>
* modules loaded at boot in ''/usr/lib/modules-load.d'' (not yet observed, TODO: check if OpenRC uses it),
'' If you want to know what these packages are research them.''
* 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 ===
Do not forget the keymap setting at <code>/etc/X11/xorg.conf</code> otherwise you need to use <code>setxkbmap</code>
The no-systemd mix-in additionally:
  Section "InputClass"
* masks sys-fs/udev and sys-apps/systemd,
    Identifier        "keyboard-all"
* adds INSTALL_MASK to remove systemd files in ''/usr/lib/systemd'' (and the incorrect ''/lib/systemd'' directory).
    Driver            "evdev"
    MatchIsKeyboard    "on"
  ''' Option        "XkbLayout" "de"'''
EndSection


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.
'''additional software'''


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.
1) File Manager:
<console> emerge --ask thunar </console>
''thunar - filemanager that supports automounting''
''Make sure you create this rule: <code> /etc/polkit-1/rules.d/10-drives.rules</code>
  polkit.addRule(function(action, subject) {
  if (action.id.indexOf("org.freedesktop.udisks2.") == 0){
  return polkit.Result.YES;
  }
  }
  );


== Possible changes for Funtoo ==
''Also you should have <code>udisk</code> installed''
=== 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:
# mask alternative udev providers,
# mask USE=systemd and other flags requiring systemd,
# 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 {{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.
 
{{FLOPFooter}}

Revision as of 10:28, February 12, 2015

WIM42GNU's Funtoo Setup

This is for everybody who might have seen my funtoo setup and liked it! This is also for myself to keep track on my system. I have used most of the Linux distributions out there and I am currently most happy with funtoo. My reasons are:

  1. Gentoo/Funtoo is a rolling release distribution, meaning you only have to install it once and update it frequently.
  2. Gentoo/Funtoo is only what you make out of it, no unnesecary rubish like in Ubuntu, OpenSuse or Fedora will be installed by default. In the mean time being aware that Gentoo/Funtoo is for advanced users not careing that much about GUIs for Settings or Configs.
  3. Gentoo/Funtoo runs fast due to multiple reasons. (Compiling your own software,USE-Flags,...)
  4. Philosophy, one would think that Slackware would suite me most (KISS,Unix) but the fact is that these distributions require you more energy and time to work with. I want to get my jobs done, not careing to much about the system. It is okay to have tools that do things for you as long they are designed well - like in funtoo.


1. Install Funtoo

Follow the install instructions and setup a minimal system.http://www.funtoo.org/Funtoo_Linux_Installation

2. Install your WindowManager or DesktopEnviroment

My favourite Window Manager at the time is i3 followed by xfce and openbox.

i3 setup:

1) install these packages:

 emerge --ask i3 i3status dmenu lxappeareance

If you want to know what these packages are research them.

Do not forget the keymap setting at /etc/X11/xorg.conf otherwise you need to use setxkbmap

 Section "InputClass"
   Identifier         "keyboard-all"
   Driver             "evdev"
   MatchIsKeyboard    "on"
   Option         "XkbLayout" "de"

EndSection

additional software

1) File Manager:

 emerge --ask thunar 

thunar - filemanager that supports automounting Make sure you create this rule: /etc/polkit-1/rules.d/10-drives.rules

 polkit.addRule(function(action, subject) {
 if (action.id.indexOf("org.freedesktop.udisks2.") == 0){
 return polkit.Result.YES;
 }
 }
 );

Also you should have udisk installed