Patchwork [00/22] hybrid systemd/sysvinit, and systemd fixes

login
register
mail settings
Submitter Ross Burton
Date March 22, 2013, 5:38 p.m.
Message ID <cover.1363973088.git.ross.burton@intel.com>
Download mbox
Permalink /patch/46711/
State Not Applicable
Headers show

Pull-request

git://git.yoctoproject.org/poky-contrib ross/systemd

Comments

Ross Burton - March 22, 2013, 5:38 p.m.
Hi,

This series changes the package groups and distro feature setup to allow
simultaneous use of sysvinit and systemd, with a number of fixes that were
discovered on the way.

As before there are sysvinit and systemd DISTRO_FEATURES.  These are not
mutually exclusive, and sysvinit is backfilled for compatibility.

Common Scenarios
===

"I want sysvinit, just like before"

Do nothing, sysvinit is backfilled and the image is effectively identical as it
was before this series.

"I just want systemd"

Add systemd to DISTRO_FEATURES, and sysvinit to
DISTRO_FEATURES_BACKFILL_CONSIDERED.  You'll only get the sysvinit scripts where
required: when a package doesn't have systemd support.

"I want my main image to boot using systemd, but a rescue image to use sysvinit"

This is less elegant, but can probably be improved later.  Add systemd to
DISTRO_FEATURES and sysvinit will be backfilled for you (feel free to add it
explicitly for clarity).  Then set VIRTUAL-RUNTIME_init_manager to "systemd" and
any images using package-group-core-boot will boot using systemd.  For your
rescue/minimal images I expect you're not using package-group-core-boot anyway,
so pull sysvinit+initscripts into those images however you wish.


Future Plans
===

Mainly, finish integrating the bulk of meta-systemd into oe-core!

There's potential for reducing the footprint of the hwdb by building/patching
udevadm on the host to generate the hwdb.bin file at image construction time,
and then removing the source files leaving just the binary cache.  As it is,
udev-hwdb is a recommendation so if your system doesn't actually need it, you
can blacklist it.

Cheers,
Ross

The following changes since commit 6211a2bdd32f7b2c8de7a5d75353c0522c8d4230:

  scripts/qemu-testlib: Add more debugging information (2013-03-21 17:05:15 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib ross/systemd

for you to fetch changes up to 0e1da1e227c8e52087f7a52f8501a81cd28e76c7:

  systemd: recommend systemd-compat-units (2013-03-22 17:24:21 +0000)

----------------------------------------------------------------
Andreas Oberritter (1):
      Revert "base-files: add fstab for systemd based systems"

Radu Moisan (1):
      busybox: enable systemd integration for syslogd

Ross Burton (20):
      busybox: add strictatime support to mount
      systemd: make xz support (compressed journal) optional, defaulting to on.
      systemd: merge udev-systemd into udev
      core-image-minimal-initramfs: don't install busybox-syslog
      systemd: don't depend on the PCI/USB databases
      systemd: split out the hwdb data
      default-providers: change udev selection logic
      update-rcd.bbclass: handle both sysvinit and systemd features being present
      util-linux: split uuidd into it's own package, and enable for systemd
      update-rcd: drop depends to recommends, check for update-rcd in scripts
      systemd: check for systemctl first, and don't force systemd to be installed.
      systemd: add udev init script for hybrid sysvinit/systemd usage
      update-rc.d/systemd: change communication variable name
      default-distrovars: don't add INITMAN to DISTRO_FEATURES and DISTRO_FEATURES_BACKFILL
      bitbake.conf: explicitly backfill sysvinit, not DISTRO_FEATURES_INITMAN
      local.conf.sample.extended: remove obsolete DISTRO_FEATURES_INITMAN reference
      default-distrovars: remove obsolete DISTRO_FEATURES_INITMAN reference
      packagegroup-core-boot: revert to specifying sysvinit as default init manager
      systemd-compat-units: disable dbus-1
      systemd: recommend systemd-compat-units

 meta-yocto/conf/local.conf.sample.extended         |    4 -
 meta/classes/systemd.bbclass                       |   38 ++++----
 meta/classes/update-rc.d.bbclass                   |   22 +++--
 meta/conf/bitbake.conf                             |    2 +-
 meta/conf/distro/include/default-distrovars.inc    |    3 +-
 meta/conf/distro/include/default-providers.inc     |    2 +-
 .../base-files/base-files/fstab.systemd            |    9 --
 meta/recipes-core/base-files/base-files_3.0.14.bb  |    7 +-
 .../busybox/busybox-1.20.2/strict-atime.patch      |   49 ++++++++++
 meta/recipes-core/busybox/busybox.inc              |   18 +++-
 meta/recipes-core/busybox/busybox_1.20.2.bb        |    5 +-
 .../busybox/files/busybox-klogd.service.in         |    8 ++
 .../busybox/files/busybox-syslog.service.in        |   13 +++
 .../images/core-image-minimal-initramfs.bb         |    2 +
 .../packagegroups/packagegroup-core-boot.bb        |    6 +-
 meta/recipes-core/systemd/systemd-compat-units.bb  |    1 +
 meta/recipes-core/systemd/systemd/init             |  101 ++++++++++++++++++++
 meta/recipes-core/systemd/systemd_197.bb           |   49 +++++++---
 meta/recipes-core/util-linux/util-linux.inc        |   11 ++-
 19 files changed, 280 insertions(+), 70 deletions(-)
 delete mode 100644 meta/recipes-core/base-files/base-files/fstab.systemd
 create mode 100644 meta/recipes-core/busybox/busybox-1.20.2/strict-atime.patch
 create mode 100644 meta/recipes-core/busybox/files/busybox-klogd.service.in
 create mode 100644 meta/recipes-core/busybox/files/busybox-syslog.service.in
 create mode 100644 meta/recipes-core/systemd/systemd/init

Andreas Oberritter (1):
  Revert "base-files: add fstab for systemd based systems"

Radu Moisan (1):
  busybox: enable systemd integration for syslogd

Ross Burton (20):
  busybox: add strictatime support to mount
  systemd: make xz support (compressed journal) optional, defaulting to
    on.
  systemd: merge udev-systemd into udev
  core-image-minimal-initramfs: don't install busybox-syslog
  systemd: don't depend on the PCI/USB databases
  systemd: split out the hwdb data
  default-providers: change udev selection logic
  update-rcd.bbclass: handle both sysvinit and systemd features being
    present
  util-linux: split uuidd into it's own package, and enable for systemd
  update-rcd: drop depends to recommends, check for update-rcd in
    scripts
  systemd: check for systemctl first, and don't force systemd to be
    installed.
  systemd: add udev init script for hybrid sysvinit/systemd usage
  update-rc.d/systemd: change communication variable name
  default-distrovars: don't add INITMAN to DISTRO_FEATURES and
    DISTRO_FEATURES_BACKFILL
  bitbake.conf: explicitly backfill sysvinit, not
    DISTRO_FEATURES_INITMAN
  local.conf.sample.extended: remove obsolete DISTRO_FEATURES_INITMAN
    reference
  default-distrovars: remove obsolete DISTRO_FEATURES_INITMAN reference
  packagegroup-core-boot: revert to specifying sysvinit as default init
    manager
  systemd-compat-units: disable dbus-1
  systemd: recommend systemd-compat-units

 meta-yocto/conf/local.conf.sample.extended         |    4 -
 meta/classes/systemd.bbclass                       |   38 ++++----
 meta/classes/update-rc.d.bbclass                   |   22 +++--
 meta/conf/bitbake.conf                             |    2 +-
 meta/conf/distro/include/default-distrovars.inc    |    3 +-
 meta/conf/distro/include/default-providers.inc     |    2 +-
 .../base-files/base-files/fstab.systemd            |    9 --
 meta/recipes-core/base-files/base-files_3.0.14.bb  |    7 +-
 .../busybox/busybox-1.20.2/strict-atime.patch      |   49 ++++++++++
 meta/recipes-core/busybox/busybox.inc              |   18 +++-
 meta/recipes-core/busybox/busybox_1.20.2.bb        |    5 +-
 .../busybox/files/busybox-klogd.service.in         |    8 ++
 .../busybox/files/busybox-syslog.service.in        |   13 +++
 .../images/core-image-minimal-initramfs.bb         |    2 +
 .../packagegroups/packagegroup-core-boot.bb        |    6 +-
 meta/recipes-core/systemd/systemd-compat-units.bb  |    1 +
 meta/recipes-core/systemd/systemd/init             |  101 ++++++++++++++++++++
 meta/recipes-core/systemd/systemd_197.bb           |   49 +++++++---
 meta/recipes-core/util-linux/util-linux.inc        |   11 ++-
 19 files changed, 280 insertions(+), 70 deletions(-)
 delete mode 100644 meta/recipes-core/base-files/base-files/fstab.systemd
 create mode 100644 meta/recipes-core/busybox/busybox-1.20.2/strict-atime.patch
 create mode 100644 meta/recipes-core/busybox/files/busybox-klogd.service.in
 create mode 100644 meta/recipes-core/busybox/files/busybox-syslog.service.in
 create mode 100644 meta/recipes-core/systemd/systemd/init
Martin Jansa - March 22, 2013, 7:04 p.m.
On Fri, Mar 22, 2013 at 05:38:29PM +0000, Ross Burton wrote:
> Run the helper if the sysvinit feature is present, or if the systemd feature is
> present but the systemd class hasn't been inherited.  We want to run in the
> latter case as systemd has sysvinit compatibility, but we don't want to always
> run so that pure systemd images don't have redundant sysvinit files.
> 
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> ---
>  meta/classes/update-rc.d.bbclass                          |    9 ++++++---
>  meta/recipes-core/packagegroups/packagegroup-core-boot.bb |    4 ++--
>  2 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
> index 65bf022..06b91c1 100644
> --- a/meta/classes/update-rc.d.bbclass
> +++ b/meta/classes/update-rc.d.bbclass
> @@ -75,9 +75,12 @@ python populate_packages_updatercd () {
>          postrm += d.getVar('updatercd_postrm', True)
>          d.setVar('pkg_postrm_%s' % pkg, postrm)
>  
> -    # If the systemd class has also been inherited, then don't do anything as
> -    # the systemd units will override anything created by update-rc.d.
> -    if not d.getVar("SYSTEMD_BBCLASS_ENABLED", True):
> +    # Run if the sysvinit feature is present, or if the systemd feature is present
> +    # but the systemd class hasn't been inherited.  We want to run in the latter case
> +    # as systemd has sysvinit compatibility, but we don't want to always so that
> +    # pure systemd images don't have redundent sysvinit files.
> +    if "sysvinit" in d.getVar("DISTRO_FEATURES").split() or \
> +       ("systemd" in d.getVar("DISTRO_FEATURES").split() and not d.getVar("SYSTEMD_BBCLASS_ENABLED", True)):
>          pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
>          if pkgs == None:
>              pkgs = d.getVar('UPDATERCPN', True)
> diff --git a/meta/recipes-core/packagegroups/packagegroup-core-boot.bb b/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
> index b9183a8..e73b46e 100644
> --- a/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
> +++ b/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
> @@ -27,7 +27,7 @@ RCONFLICTS_${PN} = "task-core-boot"
>  VIRTUAL-RUNTIME_dev_manager ?= "udev"
>  VIRTUAL-RUNTIME_login_manager ?= "tinylogin"
>  VIRTUAL-RUNTIME_init_manager ?= "${DISTRO_FEATURES_INITMAN}"
> -VIRTUAL-RUNTIME_initscripts ?= "${@base_contains('DISTRO_FEATURES', 'sysvinit', 'initscripts', '',d)}"
> +VIRTUAL-RUNTIME_initscripts ?= "${@base_contains('DISTRO_FEATURES_INITMAN', 'sysvinit', 'initscripts', '',d)}"
>  VIRTUAL-RUNTIME_keymaps ?= "keymaps"
>  
>  RDEPENDS_${PN} = "\
> @@ -42,7 +42,7 @@ RDEPENDS_${PN} = "\
>      ${VIRTUAL-RUNTIME_login_manager} \
>      ${VIRTUAL-RUNTIME_init_manager} \
>      ${VIRTUAL-RUNTIME_initscripts} \
> -    ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd-compat-units', '',d)} \
> +    ${@base_contains('DISTRO_FEATURES_INITMAN', 'systemd', 'systemd-compat-units', '',d)} \
>      ${VIRTUAL-RUNTIME_dev_manager} \
>      ${VIRTUAL-RUNTIME_update-alternatives} \
>      ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}"

Isn't DISTRO_FEATURES_INITMAN removed later in this series?
Ross Burton - March 22, 2013, 7:11 p.m.
On 22 March 2013 19:04, Martin Jansa <martin.jansa@gmail.com> wrote:
> Isn't DISTRO_FEATURES_INITMAN removed later in this series?

Yes.  I reviewed this series entirely twice and still this slipped
through.  Consider the chunks mentioning INITMAN gone.

Ross