Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton)
Date: Wed, 22 Jun 2016 21:07:41 +0200	[thread overview]
Message-ID: <cover.1466622379.git.yann.morin.1998@free.fr> (raw)

Hello All!

This series is a proposal to fix our handling of systemd as an init
system.

Our default skeleton is not well suited for systemd:

  - we have /var/log a symlink to /tmp/log, but the way systemd starts
    hides the journals:
    - start systemd-journald, stores journals in /tmp/log/ (because of
      the redirection above)
    - mounts a tmpfs over /tmp, thus hidding the journals.

  - on a read-only rootfs, systemd expects /var to be read-write, which
    we do not provide.


All of this sounds trivial, but fixing it is definitely not.

The overall idea is that we need different skeletons, one for each of
the init systems (and as can be seen later, there is in fact none for
systeemd).

Also, the organisation of the rootfs is different between the different
init systems, with different mount points in some cases.

First comes a long and rather boring sub-series aimed at preparing for
the various skeletons, with patches 1-11 some cleanups and re-factoring
of the system sub-menu, plus limiting our tweaks in the custom skeleton.

Then comes more in-depth preparatory works in the core infra: allow
packages to explicitly declare target-finalize hooks, or avoid the
dependency on the skeleton.

Third, we split the current skeleton into various parts: one skeleton
for the sysv-like init systems (busybox, sysv-init), one skeleton for
sysv-like network management (because shared between sysv and
systemd-without-networkd) and a third to handle the custom skeleton.

Finally, we introduce the skeleton for systemd, add missing pieces it
really needs (timezones) and make it work flawlessly on a read-only
rootfs.

Please have a look at the various commit logs for more in-depth
explanations for the vairious pieces.

With this series, I was able to build and run without issues those
combinations:

    init system         rootfs      DHCP?   target
    ----------------------------------------------------
    busybox             ext4        no      rpi0
    busybox             ext4        eth0    rpi1-B
    busybox             squashfs    no      rpi0
    busybox             squashfs    eth0    rpi1-B
  * systemd-minimal     ext4        no      rpi0
    systemd-minimal     ext4        eth0    rpi1-B
    systemd-minimal     squashfs    no      rpi0
    systemd-minimal     squashfs    eth0    rpi1-B
 ** systemd-full        ext4        no      rpi0
    systemd-full        ext4        eth0    rpi1-B
    systemd-full        squashfs    no      rpi0
    systemd-full        squashfs    eth0    rpi1-B


*  systemd-minimal: only what gets selected automatically when systemd
   is used as init system, with all other options unset

** systemd-full: all systemd options enabled


To be noted for future work:

  - systemd-230 (which we currently have) has dropped support for legacy
    libs, patch should be trivial;

  - systemd-230 also ditched systemd-bootchartd, which is now a separate
    package; until recently it did not compile against systemd-230; its
    repository was recently updated to supposedly fix this issue, but I
    did not have time to test;

  - I also had a look at all the pending patches on the list; I'll
    handle them after this series has been completed (i.e. applied after
    any necessary rework). I don;t want to carry a series with tens and
    tens of patches... ;-)


Changes v1 -> v2:
  - enhance the commit logs


Regards,
Yann E. MORIN.


The following changes since commit aed1ac36ecfc834618a0210e70bfbbff68c02e51

  strace: fix build with kernel headers before v3.11 (2016-06-22 17:01:07 +0200)


are available in the git repository at:

  https://git.buildroot.org/~ymorin/git/buildroot

for you to fetch changes up to f1c505051eef3830d3cea769967f7218bd70e7c9

  system: allow DHCP interface with systemd-networkd (2016-06-22 19:29:15 +0200)


----------------------------------------------------------------
Yann E. MORIN (24):
      package/skeleton: remove useless .empty file
      system: sysvinit only selects busybox-show-others if busybox is enabled
      package/skeleton: respect variables namespace
      system/skeleton: update etc/mtab with a more sensible link
      system: systemd only really supports a R/W rootfs
      package/systemd: disabling tty1 getty is a post-install hook
      system: provide no default for custom skeleton path
      system: move the rootfs skeleton choice
      system: do not handle network settings for custom skeleton
      package/perl: use dummy hostname
      system: do not set hostname and issue for custom skeleton
      core/pkg-generic: add variable to skip skeleton dependency
      package/skeleton: add macro to rsync skeleton directory
      core/pkg-generic: allow packages to declare target-finalize hooks
      packages: use the <PKG>_TARGET_FINALIZE_HOOKS
      package/skeleton: split into sysv and custom skeleton
      package/skeleton: make it a virtual package
      package/skeleton-sysv: split into skeleton-common
      system: split skeleton
      package/skeleton-systemd: new package
      system/systemd: needs timezone
      fs: add pre- and post-command hooks
      system: make systemd work on a read-only rootfs
      system: allow DHCP interface with systemd-networkd

 docs/manual/adding-packages-hooks.txt              |   7 +
 fs/common.mk                                       |   4 +
 package/Config.in                                  |   4 +
 package/google-breakpad/google-breakpad.mk         |   6 +-
 package/libglib2/libglib2.mk                       |   6 +-
 package/libgtk3/libgtk3.mk                         |   4 +-
 package/luarocks/luarocks.mk                       |   3 +-
 package/perl/perl.mk                               |   6 +-
 package/pkg-generic.mk                             |  13 +-
 package/python/python.mk                           |  10 +-
 package/python3/python3.mk                         |  10 +-
 package/skeleton-common/Config.in                  |   2 +
 package/skeleton-common/skeleton-common.mk         |  99 ++++++++++
 package/skeleton-custom/Config.in                  |   6 +
 package/skeleton-custom/skeleton-custom.mk         | 114 +++++++++++
 package/skeleton-systemd/Config.in                 |   7 +
 package/skeleton-systemd/skeleton-systemd.mk       | 107 +++++++++++
 package/skeleton-sysv/Config.in                    |   7 +
 package/skeleton-sysv/skeleton-sysv.mk             |  79 ++++++++
 package/skeleton/Config.in                         |  11 ++
 package/skeleton/skeleton.mk                       | 213 +++------------------
 package/systemd/systemd.mk                         |  12 +-
 system/Config.in                                   |  78 ++++----
 .../etc/network/if-down.d}/.empty                  |   0
 .../etc/network/if-post-down.d}/.empty             |   0
 .../etc/network/if-pre-up.d/wait_iface             |   0
 .../etc/network/if-up.d}/.empty                    |   0
 system/{skeleton => skeleton-sysv}/dev/log         |   0
 .../if-down.d => skeleton-sysv/dev/pts}/.empty     |   0
 system/{skeleton => skeleton-sysv}/dev/shm/.empty  |   0
 system/{skeleton => skeleton-sysv}/etc/fstab       |   0
 system/{skeleton => skeleton-sysv}/etc/resolv.conf |   0
 system/{skeleton => skeleton-sysv}/var/cache       |   0
 system/{skeleton => skeleton-sysv}/var/lib/misc    |   0
 system/{skeleton => skeleton-sysv}/var/lock        |   0
 system/{skeleton => skeleton-sysv}/var/log         |   0
 system/{skeleton => skeleton-sysv}/var/run         |   0
 system/{skeleton => skeleton-sysv}/var/spool       |   0
 system/{skeleton => skeleton-sysv}/var/tmp         |   0
 system/skeleton/dev/{pts => }/.empty               |   0
 system/skeleton/etc/mtab                           |   2 +-
 41 files changed, 550 insertions(+), 260 deletions(-)
 create mode 100644 package/skeleton-common/Config.in
 create mode 100644 package/skeleton-common/skeleton-common.mk
 create mode 100644 package/skeleton-custom/Config.in
 create mode 100644 package/skeleton-custom/skeleton-custom.mk
 create mode 100644 package/skeleton-systemd/Config.in
 create mode 100644 package/skeleton-systemd/skeleton-systemd.mk
 create mode 100644 package/skeleton-sysv/Config.in
 create mode 100644 package/skeleton-sysv/skeleton-sysv.mk
 rename system/{skeleton/etc/network/if-up.d => skeleton-net/etc/network/if-down.d}/.empty (100%)
 rename system/{skeleton/etc/network/if-pre-up.d => skeleton-net/etc/network/if-post-down.d}/.empty (100%)
 rename system/{skeleton => skeleton-net}/etc/network/if-pre-up.d/wait_iface (100%)
 rename system/{skeleton/etc/network/if-post-down.d => skeleton-net/etc/network/if-up.d}/.empty (100%)
 rename system/{skeleton => skeleton-sysv}/dev/log (100%)
 rename system/{skeleton/etc/network/if-down.d => skeleton-sysv/dev/pts}/.empty (100%)
 rename system/{skeleton => skeleton-sysv}/dev/shm/.empty (100%)
 rename system/{skeleton => skeleton-sysv}/etc/fstab (100%)
 rename system/{skeleton => skeleton-sysv}/etc/resolv.conf (100%)
 rename system/{skeleton => skeleton-sysv}/var/cache (100%)
 rename system/{skeleton => skeleton-sysv}/var/lib/misc (100%)
 rename system/{skeleton => skeleton-sysv}/var/lock (100%)
 rename system/{skeleton => skeleton-sysv}/var/log (100%)
 rename system/{skeleton => skeleton-sysv}/var/run (100%)
 rename system/{skeleton => skeleton-sysv}/var/spool (100%)
 rename system/{skeleton => skeleton-sysv}/var/tmp (100%)
 rename system/skeleton/dev/{pts => }/.empty (100%)

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

             reply	other threads:[~2016-06-22 19:07 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 19:07 Yann E. MORIN [this message]
2016-06-22 19:07 ` [Buildroot] [PATCH 01/24 v2] package/skeleton: remove useless .empty file Yann E. MORIN
2016-07-04  7:28   ` Arnout Vandecappelle
2016-07-05 13:57   ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 02/24 v2] system: sysvinit only selects busybox-show-others if busybox is enabled Yann E. MORIN
2016-07-03  7:53   ` Romain Naour
2016-07-04 16:49     ` Yann E. MORIN
2016-07-05 13:59       ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 03/24 v2] package/skeleton: respect variables namespace Yann E. MORIN
2016-07-03  8:15   ` Romain Naour
2016-07-05 13:28   ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 04/24 v2] system/skeleton: update etc/mtab with a more sensible link Yann E. MORIN
2016-07-03  8:28   ` Romain Naour
2016-07-04  7:27   ` Arnout Vandecappelle
2016-07-05 13:28   ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 05/24 v2] system: systemd only really supports a R/W rootfs Yann E. MORIN
2016-07-03  8:31   ` Romain Naour
2016-07-05 13:29   ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 06/24 v2] package/systemd: disabling tty1 getty is a post-install hook Yann E. MORIN
2016-07-03  8:37   ` Romain Naour
2016-07-04 17:13     ` Yann E. MORIN
2016-07-05 13:41   ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 07/24 v2] system: provide no default for custom skeleton path Yann E. MORIN
2016-07-03  8:42   ` Romain Naour
2016-07-04  7:30     ` Arnout Vandecappelle
2016-07-04 17:21     ` Yann E. MORIN
2016-07-05 13:59   ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 08/24 v2] system: move the rootfs skeleton choice Yann E. MORIN
2016-07-03  8:50   ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 09/24 v2] system: do not handle network settings for custom skeleton Yann E. MORIN
2016-07-03  9:00   ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 10/24 v2] package/perl: use dummy hostname Yann E. MORIN
2016-07-03  9:05   ` Romain Naour
2016-07-05 13:59   ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 11/24 v2] system: do not set hostname and issue for custom skeleton Yann E. MORIN
2016-07-03  9:11   ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 12/24 v2] core/pkg-generic: add variable to skip skeleton dependency Yann E. MORIN
2016-07-03  9:30   ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 13/24 v2] package/skeleton: add macro to rsync skeleton directory Yann E. MORIN
2016-07-03  9:39   ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 14/24 v2] core/pkg-generic: allow packages to declare target-finalize hooks Yann E. MORIN
2016-07-03  9:53   ` Romain Naour
2016-07-05 14:00   ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 15/24 v2] packages: use the <PKG>_TARGET_FINALIZE_HOOKS Yann E. MORIN
2016-07-03 10:02   ` Romain Naour
2016-07-04 18:05     ` Yann E. MORIN
2016-07-05 14:01   ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 16/24 v2] package/skeleton: split into sysv and custom skeleton Yann E. MORIN
2016-07-03 10:27   ` Romain Naour
2016-07-05  7:26     ` Yann E. MORIN
2016-06-22 19:07 ` [Buildroot] [PATCH 17/24 v2] package/skeleton: make it a virtual package Yann E. MORIN
2016-07-03 10:47   ` Romain Naour
2016-07-05  7:45     ` Yann E. MORIN
2016-06-22 19:07 ` [Buildroot] [PATCH 18/24 v2] package/skeleton-sysv: split into skeleton-common Yann E. MORIN
2016-07-03 11:05   ` Romain Naour
2016-07-05  7:49     ` Yann E. MORIN
2016-06-22 19:07 ` [Buildroot] [PATCH 19/24 v2] system: split skeleton Yann E. MORIN
2016-07-03 11:22   ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 20/24 v2] package/skeleton-systemd: new package Yann E. MORIN
2016-07-03 11:34   ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 21/24 v2] system/systemd: needs timezone Yann E. MORIN
2016-07-03 11:41   ` Romain Naour
2016-07-05  8:03     ` Yann E. MORIN
2016-06-22 19:07 ` [Buildroot] [PATCH 22/24 v2] fs: add pre- and post-command hooks Yann E. MORIN
2016-07-03 11:49   ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 23/24 v2] system: make systemd work on a read-only rootfs Yann E. MORIN
2016-07-03 12:54   ` Romain Naour
2016-07-05  8:12     ` Yann E. MORIN
2016-06-22 19:07 ` [Buildroot] [PATCH 24/24 v2] system: allow DHCP interface with systemd-networkd Yann E. MORIN
2016-07-03 12:59   ` Romain Naour
2016-07-06 21:49 ` [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Thomas Petazzoni
2016-07-06 22:34   ` Yann E. MORIN
2016-07-17  8:49     ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1466622379.git.yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox