[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    Re: [OE-core] [PATCH 1/1] runit: Add runit and related recipes
From:       Alexander Kanavin <alex.kanavin () gmail ! com>
Date:       2020-01-31 10:51:33
Message-ID: CANNYZj-umaTRHOB7CUw3ukdZrGrTYXWzHBqboqvpNgRWM7v=Aw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


1. Does this really need to be in core? Who is the target audience and use
cases that aren't served by existing options?
2. There are no tests or image configurations for this. How will this be
checked?
3. The amount of patches is alarming. Can you get them upstream first
please?

Alex

On Fri, 31 Jan 2020 at 10:32, Khem Raj <raj.khem@gmail.com> wrote:

> * Another init system, very small in size with application life
> cycle management
> * Add runit-services recipe for additional runit services from void linux
> * socklog is a system/kernel logger
> * Add socklog-services to provide additional logging services
> 
> * disable the chkshsgr tests in socklog
> 
> Running the chkhsgr test during cross compile fails
> 
> ./chkshsgr || ( cat warn-shsgr; exit 1 )
> Oops. Your getgroups() returned 0, and setgroups() failed; this means
> that I can't reliably do my shsgr test. Please either ``make'' as root
> or ``make'' while you're in one or more supplementary groups.
> 
> All OE based targets have working getgroups()/setgroups()
> implementation, so its a safe assumption and therefore make the test
> to be a dummy
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/conf/distro/include/maintainers.inc      |   2 +
> meta/conf/layer.conf                          |   1 +
> meta/recipes-core/runit/runit-serialgetty.bb  |  43 ++++++++
> .../runit/runit-serialgetty/finish            |   2 +
> meta/recipes-core/runit/runit-serialgetty/run |   2 +
> meta/recipes-core/runit/runit-services.bb     |  50 +++++++++
> ...y-for-services-on-Debian-is-etc-servi.diff |  87 +++++++++++++++
> ...t-nosync-file-to-make-sync-on-shutdow.diff |  95 ++++++++++++++++
> ...03-utmpset.c-mixes-int32_t-and-time_t.diff |  57 ++++++++++
> ...-t-use-static-to-link-runit-runit-ini.diff |  30 ++++++
> .../0005-patch-etc-runit-2-for-FHS.patch      |  17 +++
> ...0006-make-buildsystem-respect-CFLAGS.patch |  21 ++++
> .../runit/0007-move-communication-files.patch | 102 ++++++++++++++++++
> .../runit/0008-emulate-sysv-runlevel-5.patch  |  20 ++++
> .../runit/0009-fix-error-in-manpage.patch     |  23 ++++
> meta/recipes-core/runit/runit/clearmem.patch  |  22 ++++
> meta/recipes-core/runit/runit/cross.patch     |  50 +++++++++
> ...h-disable-chkshgrp-test-that-fails-i.patch |  19 ++++
> ...h-fix-spin-lock-on-systems-with-poor.patch |  20 ++++
> ...h-make-build-system-print-compilatio.patch |  15 +++
> meta/recipes-core/runit/runit/svlogd.patch    |  19 ++++
> meta/recipes-core/runit/runit_2.1.2.bb        |  68 ++++++++++++
> meta/recipes-core/runit/socklog-services.bb   |  23 ++++
> ...-options-to-cp-to-ensure-proper-mods.patch |  33 ++++++
> meta/recipes-core/runit/socklog/cross.patch   |  58 ++++++++++
> meta/recipes-core/runit/socklog_2.1.0.bb      |  32 ++++++
> 26 files changed, 911 insertions(+)
> create mode 100644 meta/recipes-core/runit/runit-serialgetty.bb
> create mode 100644 meta/recipes-core/runit/runit-serialgetty/finish
> create mode 100644 meta/recipes-core/runit/runit-serialgetty/run
> create mode 100644 meta/recipes-core/runit/runit-services.bb
> create mode 100644
> meta/recipes-core/runit/runit/0001-default-directory-for-services-on-Debian-is-etc-servi.diff
>  create mode 100644
> meta/recipes-core/runit/runit/0002-support-etc-runit-nosync-file-to-make-sync-on-shutdow.diff
>  create mode 100644
> meta/recipes-core/runit/runit/0003-utmpset.c-mixes-int32_t-and-time_t.diff
> create mode 100644
> meta/recipes-core/runit/runit/0004-src-Makefile-don-t-use-static-to-link-runit-runit-ini.diff
>  create mode 100644
> meta/recipes-core/runit/runit/0005-patch-etc-runit-2-for-FHS.patch
> create mode 100644
> meta/recipes-core/runit/runit/0006-make-buildsystem-respect-CFLAGS.patch
> create mode 100644
> meta/recipes-core/runit/runit/0007-move-communication-files.patch
> create mode 100644
> meta/recipes-core/runit/runit/0008-emulate-sysv-runlevel-5.patch
> create mode 100644
> meta/recipes-core/runit/runit/0009-fix-error-in-manpage.patch
> create mode 100644 meta/recipes-core/runit/runit/clearmem.patch
> create mode 100644 meta/recipes-core/runit/runit/cross.patch
> create mode 100644
> meta/recipes-core/runit/runit/patch-disable-chkshgrp-test-that-fails-i.patch
> create mode 100644
> meta/recipes-core/runit/runit/patch-fix-spin-lock-on-systems-with-poor.patch
> create mode 100644
> meta/recipes-core/runit/runit/patch-make-build-system-print-compilatio.patch
> create mode 100644 meta/recipes-core/runit/runit/svlogd.patch
> create mode 100644 meta/recipes-core/runit/runit_2.1.2.bb
> create mode 100644 meta/recipes-core/runit/socklog-services.bb
> create mode 100644
> meta/recipes-core/runit/socklog-services/0001-Use-options-to-cp-to-ensure-proper-mods.patch
>  create mode 100644 meta/recipes-core/runit/socklog/cross.patch
> create mode 100644 meta/recipes-core/runit/socklog_2.1.0.bb
> 
> diff --git a/meta/conf/distro/include/maintainers.inc
> b/meta/conf/distro/include/maintainers.inc
> index a80e85a2f6..5e79dc3892 100644
> --- a/meta/conf/distro/include/maintainers.inc
> +++ b/meta/conf/distro/include/maintainers.inc
> @@ -616,6 +616,8 @@ RECIPE_MAINTAINER_pn-rsync = "Yi Zhao <
> yi.zhao@windriver.com>"
> RECIPE_MAINTAINER_pn-rt-tests = "Alexander Kanavin <
> alex.kanavin@gmail.com>"
> RECIPE_MAINTAINER_pn-ruby = "Ross Burton <ross.burton@intel.com>"
> RECIPE_MAINTAINER_pn-run-postinsts = "Ross Burton <ross.burton@intel.com
> > "
> +RECIPE_MAINTAINER_pn-runit = "Khem Raj <raj.khem@gmail.com>"
> +RECIPE_MAINTAINER_pn-runit-serialgetty = "Khem Raj <raj.khem@gmail.com>"
> RECIPE_MAINTAINER_pn-rxvt-unicode = "Armin Kuster <akuster808@gmail.com>"
> RECIPE_MAINTAINER_pn-sato-screenshot = "Ross Burton <
> ross.burton@intel.com>"
> RECIPE_MAINTAINER_pn-sbc = "Tanu Kaskinen <tanuk@iki.fi>"
> diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
> index fcdf9ae5a3..07d9a9e32d 100644
> --- a/meta/conf/layer.conf
> +++ b/meta/conf/layer.conf
> @@ -35,6 +35,7 @@ SIGGEN_EXCLUDERECIPES_ABISAFE += " \
> keymaps \
> udev-extraconf \
> packagegroup-x11-xserver \
> +  runit-serialgetty \
> systemd-serialgetty \
> initscripts \
> shadow \
> diff --git a/meta/recipes-core/runit/runit-serialgetty.bb
> b/meta/recipes-core/runit/runit-serialgetty.bb
> new file mode 100644
> index 0000000000..780a74bafa
> --- /dev/null
> +++ b/meta/recipes-core/runit/runit-serialgetty.bb
> @@ -0,0 +1,43 @@
> +# Copyright (C) 2017 Khem Raj <raj.khem@gmail.com>
> +# Released under the MIT license (see COPYING.MIT for the terms)
> +
> +DESCRIPTION = "Serial terminal support for runit"
> +
> +SECTION = "base utils"
> +LICENSE = "MIT"
> +LIC_FILES_CHKSUM =
> "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
> +
> +INHIBIT_DEFAULT_DEPS = "1"
> +
> +SRC_URI = "\
> +           file://run \
> +           file://finish \
> +"
> +
> +S = "${WORKDIR}"
> +
> +SERIAL_CONSOLES ??= "115200;ttyS0"
> +
> +do_install() {
> +       install -d ${D}${sysconfdir}/service
> ${D}${sysconfdir}/runit/runsvdir/default
> +       tmp="${SERIAL_CONSOLES}"
> +       for i in $tmp
> +       do
> +               baudrate=`echo $i | sed 's/\;.*//'`
> +               ttydev=`echo $i | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
> +               install -d ${D}${sysconfdir}/sv/getty-${ttydev}
> +               install -m 755 ${WORKDIR}/run
> ${D}${sysconfdir}/sv/getty-${ttydev}
> +               install -m 755 ${WORKDIR}/finish
> ${D}${sysconfdir}/sv/getty-${ttydev}
> +               sed -i -e s/\@BAUDRATE\@/$baudrate/g
> ${D}${sysconfdir}/sv/getty-${ttydev}/run
> +               sed -i -e s/\@BAUDRATE\@/$baudrate/g
> ${D}${sysconfdir}/sv/getty-${ttydev}/finish
> +               sed -i -e s/\@TTY\@/$ttydev/g
> ${D}${sysconfdir}/sv/getty-${ttydev}/run
> +               sed -i -e s/\@TTY\@/$ttydev/g
> ${D}${sysconfdir}/sv/getty-${ttydev}/finish
> +               ln -s ${localstatedir}/run/sv.getty-${ttydev}
> ${D}${sysconfdir}/sv/getty-${ttydev}/supervise
> +               ln -s ${sysconfdir}/sv/getty-${ttydev}
> ${D}${sysconfdir}/service/getty-${ttydev}
> +               ln -s ${sysconfdir}/sv/getty-${ttydev}
> ${D}${sysconfdir}/runit/runsvdir/default/getty-${ttydev}
> +       done
> +}
> +# Since SERIAL_CONSOLES is likely to be set from the machine configuration
> +PACKAGE_ARCH = "${MACHINE_ARCH}"
> +
> +FILES_${PN} = "${sysconfdir}"
> diff --git a/meta/recipes-core/runit/runit-serialgetty/finish
> b/meta/recipes-core/runit/runit-serialgetty/finish
> new file mode 100644
> index 0000000000..860c07d64d
> --- /dev/null
> +++ b/meta/recipes-core/runit/runit-serialgetty/finish
> @@ -0,0 +1,2 @@
> +#!/bin/sh
> +exec utmpset -w @TTY@
> diff --git a/meta/recipes-core/runit/runit-serialgetty/run
> b/meta/recipes-core/runit/runit-serialgetty/run
> new file mode 100644
> index 0000000000..2070fbd711
> --- /dev/null
> +++ b/meta/recipes-core/runit/runit-serialgetty/run
> @@ -0,0 +1,2 @@
> +#!/bin/sh
> +exec /sbin/getty @BAUDRATE@ @TTY@ vt102
> diff --git a/meta/recipes-core/runit/runit-services.bb
> b/meta/recipes-core/runit/runit-services.bb
> new file mode 100644
> index 0000000000..d24ed592dc
> --- /dev/null
> +++ b/meta/recipes-core/runit/runit-services.bb
> @@ -0,0 +1,50 @@
> +# Copyright (C) 2017 Khem Raj <raj.khem@gmail.com>
> +# Released under the MIT license (see COPYING.MIT for the terms)
> +
> +DESCRIPTION = "Additional runit scripts for OE based systems"
> +HOMEPAGE = "https://github.com/YoeDistro/oe-runit"
> +LICENSE = "PD"
> +LIC_FILES_CHKSUM =
> "file://README.md;beginline=41;endline=48;md5=f2f8535b84b11359cc7757b009cfd646"
> +SECTION = "base"
> +
> +PV = "20180623+git${SRCPV}"
> +
> +SRCREV = "8d5db5c26670e49524f33800aaf0337466495c84"
> +SRC_URI = "git://github.com/YoeDistro/oe-runit;branch=oe/master \
> +"
> +
> +S = "${WORKDIR}/git"
> +
> +EXTRA_OEMAKE = "PREFIX=${exec_prefix}"
> +
> +do_install() {
> +       oe_runmake DESTDIR=${D} install
> +       install -d ${D}${base_bindir} ${D}${sysconfdir}/runit/runsvdir
> +       for f in shutdown halt reboot poweroff
> +       do
> +               ln -sf ${bindir}/$f ${D}${base_bindir}/$f
> +       done
> +}
> +
> +pkg_postinst_ontarget_${PN} () {
> +        # Enable default services:
> +        #       - agetty-tty[1-4] (default)
> +        #       - udevd (default)
> +        #       - sulogin (single)
> +        mkdir -p $D/etc/runit/runsvdir/single
> +        ln -sf /etc/sv/sulogin $D/etc/runit/runsvdir/single
> +
> +        mkdir -p $D/etc/runit/runsvdir/default
> +        if [ ! -e $D/etc/runit/runsvdir/current ]; then
> +               ln -sf default $D/etc/runit/runsvdir/current
> +       fi
> +        if [ -e $D/etc/sv/udevd/run ]; then
> +               ln -sf /etc/sv/udevd $D/etc/runit/runsvdir/default
> +       fi
> +}
> +
> +RDEPENDS_${PN} = "runit findutils util-linux-fsck coreutils"
> +
> +PACKAGES =+ "${PN}-dracut"
> +
> +FILES_${PN}-dracut = "${nonarch_libdir}/dracut"
> diff --git
> a/meta/recipes-core/runit/runit/0001-default-directory-for-services-on-Debian-is-etc-servi.diff
>  b/meta/recipes-core/runit/runit/0001-default-directory-for-services-on-Debian-is-etc-servi.diff
>  new file mode 100644
> index 0000000000..afc1bc5564
> --- /dev/null
> +++
> b/meta/recipes-core/runit/runit/0001-default-directory-for-services-on-Debian-is-etc-servi.diff
>  @@ -0,0 +1,87 @@
> +From d99515f6c8427e5f1c8f252532df8858bdef1007 Mon Sep 17 00:00:00 2001
> +From: Gerrit Pape <pape@smarden.org>
> +Date: Wed, 7 May 2008 23:51:16 +0000
> +Subject: [PATCH] default directory for services on Debian is
> /etc/service/,
> + not /service/
> +
> +---
> + runit-2.1.2/man/runsv.8      | 4 ++--
> + runit-2.1.2/man/runsvchdir.8 | 4 ++--
> + runit-2.1.2/man/sv.8         | 4 ++--
> + runit-2.1.2/src/sv.c         | 2 +-
> + 4 files changed, 7 insertions(+), 7 deletions(-)
> +
> +diff --git a/runit-2.1.2/man/runsv.8 b/runit-2.1.2/man/runsv.8
> +index 7c5abfc..75bc73a 100644
> +--- a/runit-2.1.2/man/runsv.8
> ++++ b/runit-2.1.2/man/runsv.8
> +@@ -157,9 +157,9 @@ This command is ignored if it is given to
> + .IR service /log/supervise/control.
> + .P
> + Example: to send a TERM signal to the socklog-unix service, either do
> +-  # sv term /service/socklog-unix
> ++  # sv term /etc/service/socklog-unix
> +  or
> +-  # printf t >/service/socklog-unix/supervise/control
> ++  # printf t >/etc/service/socklog-unix/supervise/control
> + .P
> + .BR printf (1)
> + usually blocks if no
> +diff --git a/runit-2.1.2/man/runsvchdir.8 b/runit-2.1.2/man/runsvchdir.8
> +index f7f94dc..a5fc180 100644
> +--- a/runit-2.1.2/man/runsvchdir.8
> ++++ b/runit-2.1.2/man/runsvchdir.8
> +@@ -27,13 +27,13 @@ with a symlink pointing to
> + .IR dir .
> + .P
> + Normally
> +-.I /service
> ++.I /etc/service
> + is a symlink to
> + .IR current ,
> + and
> + .BR runsvdir (8)
> + is running
> +-.IR /service/ .
> ++.IR /etc/service/ .
> + .SH EXIT CODES
> + .B runsvchdir
> + prints an error message and exits 111 on error.
> +diff --git a/runit-2.1.2/man/sv.8 b/runit-2.1.2/man/sv.8
> +index 7ed9852..fa56443 100644
> +--- a/runit-2.1.2/man/sv.8
> ++++ b/runit-2.1.2/man/sv.8
> +@@ -30,7 +30,7 @@ If
> + .I service
> + doesn't start with a dot or slash and doesn't end with a slash, it is
> + searched in the default services directory
> +-.IR /service/ ,
> ++.IR /etc/service/ ,
> + otherwise relative to the current directory.
> + .P
> + .I command
> +@@ -232,7 +232,7 @@ This option implies
> + .TP
> + .B SVDIR
> + The environment variable $SVDIR overrides the default services directory
> +-.IR /service/ .
> ++.IR /etc/service/ .
> + .TP
> + .B SVWAIT
> + The environment variable $SVWAIT overrides the default 7 seconds to wait
> +diff --git a/runit-2.1.2/src/sv.c b/runit-2.1.2/src/sv.c
> +index 0125795..887e9d1 100644
> +--- a/runit-2.1.2/src/sv.c
> ++++ b/runit-2.1.2/src/sv.c
> +@@ -32,7 +32,7 @@
> + char *progname;
> + char *action;
> + char *acts;
> +-char *varservice ="/service/";
> ++char *varservice ="/etc/service/";
> + char **service;
> + char **servicex;
> + unsigned int services;
> +--
> +2.0.1
> +
> diff --git
> a/meta/recipes-core/runit/runit/0002-support-etc-runit-nosync-file-to-make-sync-on-shutdow.diff
>  b/meta/recipes-core/runit/runit/0002-support-etc-runit-nosync-file-to-make-sync-on-shutdow.diff
>  new file mode 100644
> index 0000000000..91f9e947e1
> --- /dev/null
> +++
> b/meta/recipes-core/runit/runit/0002-support-etc-runit-nosync-file-to-make-sync-on-shutdow.diff
>  @@ -0,0 +1,95 @@
> +From aed8774b9aa813cbb3e8b732f6f7ae132f86c82b Mon Sep 17 00:00:00 2001
> +From: Andras Korn <korn-debbugs@elan.rulez.org>
> +Date: Thu, 6 Dec 2012 16:57:06 +0100
> +Subject: [PATCH] support /etc/runit/nosync file to make sync on
> + shutdown/reboot optional
> +
> +https://bugs.debian.org/695281
> +---
> + runit-2.1.2/doc/runit.8.html |  2 ++
> + runit-2.1.2/man/runit.8      |  5 +++++
> + runit-2.1.2/src/runit.c      | 15 ++++++++++-----
> + runit-2.1.2/src/runit.h      |  1 +
> + 4 files changed, 18 insertions(+), 5 deletions(-)
> +
> +--- a/runit-2.1.2/doc/runit.8.html
> ++++ b/runit-2.1.2/doc/runit.8.html
> +@@ -34,6 +34,8 @@ stage 2 if it is running, and runs <i>/e
> + and possibly halt or reboot the system are done here. If stage 3 returns,
> + <b>runit</b> checks if the file <i>/etc/runit/reboot</i> exists and has
> the execute by
> + owner permission set. If so, the system is rebooted, it&rsquo;s halted
> otherwise.
> ++If <i>/etc/runit/nosync</i> exists, <b>runit</b> doesn&rsquo;t invoke
> ++sync(). This is useful in vservers.
> +
> + <h2><a name='sect6'>Ctrl-alt-del</a></h2>
> + If <b>runit</b> receives the ctrl-alt-del keyboard request and the file
> +--- a/runit-2.1.2/man/runit.8
> ++++ b/runit-2.1.2/man/runit.8
> +@@ -48,6 +48,11 @@ checks if the file
> + .I /etc/runit/reboot
> + exists and has the execute by owner permission set.
> + If so, the system is rebooted, it's halted otherwise.
> ++If
> ++.I /etc/runit/nosync
> ++exists,
> ++.B runit
> ++doesn't invoke sync(). This is useful in vservers.
> + .SH CTRL-ALT-DEL
> + If
> + .B runit
> +--- a/runit-2.1.2/src/runit.c
> ++++ b/runit-2.1.2/src/runit.c
> +@@ -41,6 +41,11 @@ void sig_int_handler (void) {
> + }
> + void sig_child_handler (void) { write(selfpipe[1], "", 1); }
> +
> ++void sync_if_needed() {
> ++  struct stat s;
> ++  if (stat(NOSYNC, &s) == -1) sync();
> ++}
> ++
> + int main (int argc, const char * const *argv, char * const *envp) {
> +   const char * prog[2];
> +   int pid, pid2;
> +@@ -305,28 +310,28 @@ int main (int argc, const char * const *
> +   case -1:
> +   if ((stat(REBOOT, &s) != -1) && (s.st_mode & S_IXUSR)) {
> +     strerr_warn2(INFO, "system reboot.", 0);
> +-    sync();
> ++    sync_if_needed();
> +     reboot_system(RB_AUTOBOOT);
> +   }
> +   else {
> + #ifdef RB_POWER_OFF
> +     strerr_warn2(INFO, "power off...", 0);
> +-    sync();
> ++    sync_if_needed();
> +     reboot_system(RB_POWER_OFF);
> +     sleep(2);
> + #endif
> + #ifdef RB_HALT_SYSTEM
> +     strerr_warn2(INFO, "system halt.", 0);
> +-    sync();
> ++    sync_if_needed();
> +     reboot_system(RB_HALT_SYSTEM);
> + #else
> + #ifdef RB_HALT
> +     strerr_warn2(INFO, "system halt.", 0);
> +-    sync();
> ++    sync_if_needed();
> +     reboot_system(RB_HALT);
> + #else
> +     strerr_warn2(INFO, "system reboot.", 0);
> +-    sync();
> ++    sync_if_needed();
> +     reboot_system(RB_AUTOBOOT);
> + #endif
> + #endif
> +--- a/runit-2.1.2/src/runit.h
> ++++ b/runit-2.1.2/src/runit.h
> +@@ -1,4 +1,5 @@
> + #define RUNIT "/sbin/runit"
> + #define STOPIT "/etc/runit/stopit"
> + #define REBOOT "/etc/runit/reboot"
> ++#define NOSYNC "/run/runit.nosync"
> + #define CTRLALTDEL "/etc/runit/ctrlaltdel"
> diff --git
> a/meta/recipes-core/runit/runit/0003-utmpset.c-mixes-int32_t-and-time_t.diff
> b/meta/recipes-core/runit/runit/0003-utmpset.c-mixes-int32_t-and-time_t.diff
> new file mode 100644
> index 0000000000..6b21bbb40e
> --- /dev/null
> +++
> b/meta/recipes-core/runit/runit/0003-utmpset.c-mixes-int32_t-and-time_t.diff
> @@ -0,0 +1,57 @@
> +From 20a0afcd367666efc17c59cf121a0d991ff1bd09 Mon Sep 17 00:00:00 2001
> +From: Gerrit Pape <pape@smarden.org>
> +Date: Thu, 31 Jul 2014 12:25:49 +0000
> +Subject: [PATCH] utmpset.c: mixes "int32_t *" and "time_t *"
> +
> +Don't pass int32_t to time(), thx Lorenzo Beretta,
> +https://bugs.debian.org/754849
> +---
> + runit-2.1.2/src/utmpset.c | 8 ++++++--
> + 1 file changed, 6 insertions(+), 2 deletions(-)
> +
> +diff --git a/runit-2.1.2/src/utmpset.c b/runit-2.1.2/src/utmpset.c
> +index eea41a5..2e8a525 100644
> +--- a/runit-2.1.2/src/utmpset.c
> ++++ b/runit-2.1.2/src/utmpset.c
> +@@ -24,6 +24,7 @@ void usage(void) { strerr_die4x(1, "usage: ", progname,
> USAGE, "\n"); }
> + int utmp_logout(const char *line) {
> +   int fd;
> +   uw_tmp ut;
> ++  time_t t;
> +   int ok =-1;
> +
> +   if ((fd =open(UW_TMP_UFILE, O_RDWR, 0)) < 0)
> +@@ -35,7 +36,8 @@ int utmp_logout(const char *line) {
> +     if (!ut.ut_name[0] || (str_diff(ut.ut_line, line) != 0)) continue;
> +     memset(ut.ut_name, 0, sizeof ut.ut_name);
> +     memset(ut.ut_host, 0, sizeof ut.ut_host);
> +-    if (time(&ut.ut_time) == -1) break;
> ++    if (time(&t) == -1) break;
> ++    ut.ut_time = t;
> + #ifdef DEAD_PROCESS
> +     ut.ut_type =DEAD_PROCESS;
> + #endif
> +@@ -52,6 +54,7 @@ int wtmp_logout(const char *line) {
> +   int len;
> +   struct stat st;
> +   uw_tmp ut;
> ++  time_t t;
> +
> +   if ((fd = open_append(UW_TMP_WFILE)) == -1)
> +     strerr_die4sys(111, FATAL, "unable to open ", UW_TMP_WFILE, ": ");
> +@@ -65,10 +68,11 @@ int wtmp_logout(const char *line) {
> +   memset(&ut, 0, sizeof(uw_tmp));
> +   if ((len =str_len(line)) > sizeof ut.ut_line) len =sizeof ut.ut_line
> -2;
> +   byte_copy(ut.ut_line, len, line);
> +-  if (time(&ut.ut_time) == -1) {
> ++  if (time(&t) == -1) {
> +     close(fd);
> +     return(-1);
> +   }
> ++  ut.ut_time = t;
> + #ifdef DEAD_PROCESS
> +   ut.ut_type =DEAD_PROCESS;
> + #endif
> +--
> +2.0.1
> +
> diff --git
> a/meta/recipes-core/runit/runit/0004-src-Makefile-don-t-use-static-to-link-runit-runit-ini.diff
>  b/meta/recipes-core/runit/runit/0004-src-Makefile-don-t-use-static-to-link-runit-runit-ini.diff
>  new file mode 100644
> index 0000000000..c2cdfc8881
> --- /dev/null
> +++
> b/meta/recipes-core/runit/runit/0004-src-Makefile-don-t-use-static-to-link-runit-runit-ini.diff
>  @@ -0,0 +1,30 @@
> +From 77d0f60701a401ea0de0925d9422c78fb560b4f6 Mon Sep 17 00:00:00 2001
> +From: Gerrit Pape <pape@smarden.org>
> +Date: Thu, 31 Jul 2014 12:54:32 +0000
> +Subject: [PATCH] src/Makefile: don't use -static to link runit,
> runit-init on
> + Debian
> +
> +---
> + runit-2.1.2/src/Makefile | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/runit-2.1.2/src/Makefile b/runit-2.1.2/src/Makefile
> +index d9624de..507a419 100644
> +--- a/runit-2.1.2/src/Makefile
> ++++ b/runit-2.1.2/src/Makefile
> +@@ -6,10 +6,10 @@ check: $(IT)
> +       ./check-local $(IT)
> +
> + runit: load runit.o unix.a byte.a
> +-      ./load runit unix.a byte.a -static
> ++      ./load runit unix.a byte.a
> +
> + runit-init: load runit-init.o unix.a byte.a
> +-      ./load runit-init unix.a byte.a -static
> ++      ./load runit-init unix.a byte.a
> +
> + runsv: load runsv.o unix.a byte.a time.a
> +       ./load runsv unix.a byte.a time.a
> +--
> +2.0.1
> +
> diff --git
> a/meta/recipes-core/runit/runit/0005-patch-etc-runit-2-for-FHS.patch
> b/meta/recipes-core/runit/runit/0005-patch-etc-runit-2-for-FHS.patch
> new file mode 100644
> index 0000000000..8bcfe8801c
> --- /dev/null
> +++ b/meta/recipes-core/runit/runit/0005-patch-etc-runit-2-for-FHS.patch
> @@ -0,0 +1,17 @@
> +Description: Make /etc/runit/2 respect FHS
> + On Debian system services directory is /etc/service, not /service.
> +Author: Dmitry Bogatov <KAction@gnu.org>
> +Last-Update: 2016-05-31
> +---
> +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
> +--- a/runit-2.1.2/etc/2
> ++++ b/runit-2.1.2/etc/2
> +@@ -1,6 +1,6 @@
> + #!/bin/sh
> +
> 
> +-PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
>  
> ++PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
> +
> + exec env - PATH=$PATH \
> +-runsvdir -P /service 'log:
> .................................................................................... \
> .................................................................................... \
> .................................................................................... \
> ...............................................................................................................................................'
>  ++runsvdir -P /etc/service 'log:
> .................................................................................... \
> .................................................................................... \
> .................................................................................... \
> ...............................................................................................................................................'
>                 
> diff --git
> a/meta/recipes-core/runit/runit/0006-make-buildsystem-respect-CFLAGS.patch
> b/meta/recipes-core/runit/runit/0006-make-buildsystem-respect-CFLAGS.patch
> new file mode 100644
> index 0000000000..269d79a49b
> --- /dev/null
> +++
> b/meta/recipes-core/runit/runit/0006-make-buildsystem-respect-CFLAGS.patch
> @@ -0,0 +1,21 @@
> +Description: Make buildsystem respect dpkg-buildflags
> +Author: Dmitry Bogatov <KAction@gnu.org>
> +Last-Update: 2016-06-01
> +---
> +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
> +--- a/runit-2.1.2/src/print-cc.sh
> ++++ b/runit-2.1.2/src/print-cc.sh
> +@@ -2,4 +2,4 @@ cc="`head -n1 conf-cc`"
> + systype="`cat systype`"
> +
> + cat warn-auto.sh
> +-echo exec "$cc" '-c ${1+"$@"}'
> ++echo exec "$cc" "$CPPFLAGS" "$CFLAGS" '-c ${1+"$@"}'
> +--- a/runit-2.1.2/src/print-ld.sh
> ++++ b/runit-2.1.2/src/print-ld.sh
> +@@ -3,4 +3,4 @@ systype="`cat systype`"
> +
> + cat warn-auto.sh
> + echo 'main="$1"; shift'
> +-echo exec "$ld" '-o "$main" "$main".o ${1+"$@"}'
> ++echo exec "$ld" "$LDFLAGS" '-o "$main" "$main".o ${1+"$@"}'
> diff --git
> a/meta/recipes-core/runit/runit/0007-move-communication-files.patch
> b/meta/recipes-core/runit/runit/0007-move-communication-files.patch
> new file mode 100644
> index 0000000000..bfcbac8015
> --- /dev/null
> +++ b/meta/recipes-core/runit/runit/0007-move-communication-files.patch
> @@ -0,0 +1,102 @@
> +Description: Move communication files under /run
> + Runit by default uses files /etc/runit/stop and /etc/runit/reboot.
> + This configuration will not work when /etc is mounted read-only,
> + as such this patch renames this files into /run/runit.stop and
> + /run/runit.reboot
> +Author: Dmitry Bogatov <KAction@gnu.org>
> +Last-Update: 2016-06-02
> +---
> +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
> +--- a/runit-2.1.2/etc/debian/1
> ++++ b/runit-2.1.2/etc/debian/1
> +@@ -6,5 +6,5 @@ PATH=/command:/sbin:/bin:/usr/sbin:/usr/
> + /etc/init.d/rcS
> + /etc/init.d/rmnologin
> +
> +-touch /etc/runit/stopit
> +-chmod 0 /etc/runit/stopit
> ++touch /run/runit.stopit
> ++chmod 0 /run/runit.stopit
> +--- a/runit-2.1.2/etc/debian/3
> ++++ b/runit-2.1.2/etc/debian/3
> +@@ -4,7 +4,7 @@ exec 2>&1
> + PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin
> +
> + LAST=0
> +-test -x /etc/runit/reboot && LAST=6
> ++test -x /run/runit.reboot && LAST=6
> +
> + echo 'Waiting for services to stop...'
> + sv -w196 force-stop /service/*
> +--- a/runit-2.1.2/etc/debian/ctrlaltdel
> ++++ b/runit-2.1.2/etc/debian/ctrlaltdel
> +@@ -4,6 +4,6 @@ PATH=/bin:/usr/bin
> + MSG="System is going down in 14 seconds..."
> +
> + # echo 'disabled.' ; exit
> +-touch /etc/runit/stopit
> +-chmod 100 /etc/runit/stopit && echo "$MSG" | wall
> ++touch /etc/runit.stopit
> ++chmod 100 /etc/runit.stopit && echo "$MSG" | wall
> + /bin/sleep 14
> +--- a/runit-2.1.2/man/runit-init.8
> ++++ b/runit-2.1.2/man/runit-init.8
> +@@ -26,9 +26,9 @@ To signal
> + the system halt request,
> + .B runit-init
> + removes all permissions of the file
> +-.I /etc/runit/reboot
> ++.I /run/runit.reboot
> + (chmod 0), and sets the execute by owner permission of the file
> +-.I /etc/runit/stopit
> ++.I /run/runit.stopit
> + (chmod 100).
> + Then a CONT signal is sent to
> + .BR runit (8).
> +@@ -40,9 +40,9 @@ To signal
> + the system reboot request,
> + .B runit-init
> + sets the execute by owner permission of the files
> +-.I /etc/runit/reboot
> ++.I /run/runit.reboot
> + and
> +-.I /etc/runit/stopit
> ++.I /run/runit.stopit
> + (chmod 100). Then a CONT signal is sent to
> + .BR runit (8).
> + .SH EXIT CODES
> +--- a/runit-2.1.2/man/runit.8
> ++++ b/runit-2.1.2/man/runit.8
> +@@ -45,11 +45,11 @@ done here.
> + If stage 3 returns,
> + .B runit
> + checks if the file
> +-.I /etc/runit/reboot
> ++.I /run/runit.reboot
> + exists and has the execute by owner permission set.
> + If so, the system is rebooted, it's halted otherwise.
> + If
> +-.I /etc/runit/nosync
> ++.I /run/runit.nosync
> + exists,
> + .B runit
> + doesn't invoke sync(). This is useful in vservers.
> +@@ -70,7 +70,7 @@ only accepts signals in stage 2.
> + If
> + .B runit
> + receives a CONT signal and the file
> +-.I /etc/runit/stopit
> ++.I /run/runit.stopit
> + exists and has the execute by owner permission set,
> + .B runit
> + is told to shutdown the system.
> +--- a/runit-2.1.2/src/runit.h
> ++++ b/runit-2.1.2/src/runit.h
> +@@ -1,5 +1,5 @@
> + #define RUNIT "/sbin/runit"
> +-#define STOPIT "/etc/runit/stopit"
> +-#define REBOOT "/etc/runit/reboot"
> ++#define STOPIT "/run/runit.stopit"
> ++#define REBOOT "/run/runit.reboot"
> + #define NOSYNC "/run/runit.nosync"
> + #define CTRLALTDEL "/etc/runit/ctrlaltdel"
> diff --git
> a/meta/recipes-core/runit/runit/0008-emulate-sysv-runlevel-5.patch
> b/meta/recipes-core/runit/runit/0008-emulate-sysv-runlevel-5.patch
> new file mode 100644
> index 0000000000..0d370c8fe7
> --- /dev/null
> +++ b/meta/recipes-core/runit/runit/0008-emulate-sysv-runlevel-5.patch
> @@ -0,0 +1,20 @@
> +Description: Emulalate sysv runlevel 5 by default
> + Currently, not many daemons in Debian provides proper runscripts, so
> + if user switches to runit, she will on next reboot, that none of daemons,
> + including essential, like cron, are started.
> + .
> + This patch starts them in sysv-init style -- unmanaged, in background.
> + It is sub-par solution, but allows one-by-one transition.
> +Author: Dmitry Bogatov
> +Forwarded: not-needed
> +Last-Update: 2016-06-09
> +---
> +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
> +--- a/runit-2.1.2/etc/debian/1
> ++++ b/runit-2.1.2/etc/debian/1
> +@@ -8,3 +8,5 @@ PATH=/command:/sbin:/bin:/usr/sbin:/usr/
> +
> + touch /run/runit.stopit
> + chmod 0 /run/runit.stopit
> ++
> ++[ -e /etc/runit/no-emulate-sysv ] || /etc/init.d/rc 5
> diff --git a/meta/recipes-core/runit/runit/0009-fix-error-in-manpage.patch
> b/meta/recipes-core/runit/runit/0009-fix-error-in-manpage.patch
> new file mode 100644
> index 0000000000..5803b0a387
> --- /dev/null
> +++ b/meta/recipes-core/runit/runit/0009-fix-error-in-manpage.patch
> @@ -0,0 +1,23 @@
> +Description: Fix factual error in manpage.
> + Log ./finish script is not actually invoked. It is not clear, whether
> this
> + limitation is worth lifting.
> +Author: Dmitry Bogatov <KAction@gnu.org>
> +Forwarded: no
> +Last-Update: 2016-08-31
> +---
> +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
> +--- a/runit-2.1.2/man/runsv.8
> ++++ b/runit-2.1.2/man/runsv.8
> +@@ -54,10 +54,8 @@ and
> + .IR service /finish's
> + standard output to the pipe, switches to the directory
> + .IR service /log
> +-and starts ./run (and ./finish) exactly as described above for the
> +-.I service
> +-directory.
> +-The standard input of the log service is redirected to read from the
> pipe.
> ++and starts ./run script. The standard input of the log service
> ++is redirected to read from the pipe.
> + .P
> + .B runsv
> + maintains status information in a binary format (compatible to the
> diff --git a/meta/recipes-core/runit/runit/clearmem.patch
> b/meta/recipes-core/runit/runit/clearmem.patch
> new file mode 100644
> index 0000000000..3fa28a7006
> --- /dev/null
> +++ b/meta/recipes-core/runit/runit/clearmem.patch
> @@ -0,0 +1,22 @@
> +fix segfault in svlogd discovered on armv7hf-musl.
> +
> +Code in svlogd.c allocates some memory at startup which is
> +not zeroed, and other code was using those garbage values.
> +I have no idea why this has never caused a problem before, but
> +for me, svlogd consistently segfaults on armv7hf-musl when
> +it is called by socklog.
> +
> +Upstream-Status: Pending
> +Author: Christopher Brannon <chris@the-brannons.com>
> +
> +diff -Naur runit-2.1.2/src/svlogd.c runit-2.1.2/src/svlogd.c
> +--- runit-2.1.2/src/svlogd.c   2014-08-10 11:22:34.000000000 -0700
> ++++ runit-2.1.2/src/svlogd.c   2018-03-03 03:28:08.243085845 -0800
> +@@ -705,6 +705,7 @@
> +   coe(fdwdir);
> +   dir =(struct logdir*)alloc(dirn *sizeof(struct logdir));
> +   if (! dir) die_nomem();
> ++  memset(dir, 0, dirn * sizeof(struct logdir));
> +   for (i =0; i < dirn; ++i) {
> +     dir[i].fddir =-1; dir[i].fdcur =-1;
> +     dir[i].btmp =(char*)alloc(buflen *sizeof(char));
> diff --git a/meta/recipes-core/runit/runit/cross.patch
> b/meta/recipes-core/runit/runit/cross.patch
> new file mode 100644
> index 0000000000..3a9dcd8afe
> --- /dev/null
> +++ b/meta/recipes-core/runit/runit/cross.patch
> @@ -0,0 +1,50 @@
> +chskshsgr must be built for the host.
> +
> +Index: runit-2.1.2/src/Makefile
> +===================================================================
> +--- runit-2.1.2.orig/src/Makefile
> ++++ runit-2.1.2/src/Makefile
> +@@ -170,11 +170,11 @@ byte_diff.o: byte.h byte_diff.c compile
> + byte_rchr.o: byte.h byte_rchr.c compile
> +       ./compile byte_rchr.c
> +
> +-chkshsgr: chkshsgr.o load
> +-      ./load chkshsgr
> ++chkshsgr: chkshsgr.o loadhost
> ++      ./loadhost chkshsgr
> +
> +-chkshsgr.o: chkshsgr.c compile
> +-      ./compile chkshsgr.c
> ++chkshsgr.o: chkshsgr.c compilehost
> ++      ./compilehost chkshsgr.c
> +
> + choose: choose.sh warn-auto.sh
> +       rm -f choose
> +@@ -185,6 +185,11 @@ choose: choose.sh warn-auto.sh
> + coe.o: coe.c coe.h compile
> +       ./compile coe.c
> +
> ++compilehost:
> ++      cat warn-auto.sh > compilehost
> ++      @echo 'exec ${BUILD_CC} ${BUILD_CFLAGS} -c $${1+"$$@"}' >>
> compilehost
> ++      chmod 555 compilehost
> ++
> + compile: conf-cc print-cc.sh systype warn-auto.sh
> +       rm -f compile
> +       sh print-cc.sh > compile
> +@@ -246,6 +251,15 @@ iopause.h: choose compile iopause.h1 iop
> + iopause.o: compile iopause.c iopause.h select.h tai.h taia.h uint64.h
> +       ./compile iopause.c
> +
> ++loadhost:
> ++      rm -f loadhost
> ++      @echo > loadhost
> ++      @echo 'systype="`cat systype`"' >> loadhost
> ++      @echo 'cat warn-auto.sh' >> loadhost
> ++      @echo 'main="$$1"; shift' >> loadhost
> ++      @echo 'exec ${BUILD_CC} ${BUILD_LDFLAGS}  -o "$$main" "$$main".o
> $${1+"$$@"}' >> loadhost
> ++      chmod 555 loadhost
> ++
> + load: conf-ld print-ld.sh systype warn-auto.sh
> +       rm -f load
> +       sh print-ld.sh > load
> diff --git
> a/meta/recipes-core/runit/runit/patch-disable-chkshgrp-test-that-fails-i.patch
> b/meta/recipes-core/runit/runit/patch-disable-chkshgrp-test-that-fails-i.patch
> new file mode 100644
> index 0000000000..6753dff4ef
> --- /dev/null
> +++
> b/meta/recipes-core/runit/runit/patch-disable-chkshgrp-test-that-fails-i.patch
> @@ -0,0 +1,19 @@
> +From: Dmitry Bogatov <KAction@gnu.org>
> +Date: Sun, 13 May 2018 10:38:20 +0300
> +X-Dgit-Generated: 2.1.2-14 2c8a08023e964bf54344e7030573ef7ad6881880
> +Subject: [PATCH] Disable chkshgrp test, that fails in whalebuilder
> +
> +Upstream-Status: Pending
> +
> +---
> +
> +--- runit-2.1.2.orig/runit-2.1.2/src/Makefile
> ++++ runit-2.1.2/runit-2.1.2/src/Makefile
> +@@ -234,7 +234,6 @@ hassgprm.h: choose compile hassgprm.h1 h
> +
> + hasshsgr.h: chkshsgr choose compile hasshsgr.h1 hasshsgr.h2 load \
> + tryshsgr.c warn-shsgr
> +-      ./chkshsgr || ( cat warn-shsgr; exit 1 )
> +       ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h
> +
> + haswaitp.h: choose compile haswaitp.h1 haswaitp.h2 load trywaitp.c
> diff --git
> a/meta/recipes-core/runit/runit/patch-fix-spin-lock-on-systems-with-poor.patch
> b/meta/recipes-core/runit/runit/patch-fix-spin-lock-on-systems-with-poor.patch
> new file mode 100644
> index 0000000000..6f15e92779
> --- /dev/null
> +++
> b/meta/recipes-core/runit/runit/patch-fix-spin-lock-on-systems-with-poor.patch
> @@ -0,0 +1,20 @@
> +From: Dmitry Bogatov <KAction@gnu.org>
> +Date: Mon, 28 May 2018 21:46:39 +0300
> +X-Dgit-Generated: 2.1.2-15 7791b76917a00ca44e3a5c297675214a40f7f215
> +Subject: [PATCH] Fix spin lock on systems with poor clock
> +
> +Upstream-Status: Pending
> +
> +---
> +
> +--- runit-2.1.2.orig/runit-2.1.2/src/svlogd.c
> ++++ runit-2.1.2/runit-2.1.2/src/svlogd.c
> +@@ -234,7 +234,7 @@ void rmoldest(struct logdir *ld) {
> +         if (unlink(f->d_name) == -1)
> +           warn2("unable to unlink processor leftover", f->d_name);
> +       }
> +-      else {
> ++      else if (f->d_name[26] != 'u') {
> +         ++n;
> +         if (str_diff(f->d_name, oldest) < 0) byte_copy(oldest, 27,
> f->d_name);
> +       }
> diff --git
> a/meta/recipes-core/runit/runit/patch-make-build-system-print-compilatio.patch
> b/meta/recipes-core/runit/runit/patch-make-build-system-print-compilatio.patch
> new file mode 100644
> index 0000000000..f62dfa36d3
> --- /dev/null
> +++
> b/meta/recipes-core/runit/runit/patch-make-build-system-print-compilatio.patch
> @@ -0,0 +1,15 @@
> +From: Dmitry Bogatov <KAction@gnu.org>
> +Date: Tue, 10 Apr 2018 20:08:14 +0300
> +X-Dgit-Generated: 2.1.2-10 9187ce34534181446afc87277ec0d460e5575f9c
> +Subject: [PATCH] Make build system print compilation commands
> +
> +Upstream-Status: Pending
> +
> +---
> +
> +--- runit-2.1.2.orig/runit-2.1.2/src/warn-auto.sh
> ++++ runit-2.1.2/runit-2.1.2/src/warn-auto.sh
> +@@ -1,2 +1,2 @@
> +-#!/bin/sh
> ++#!/bin/sh -x
> + # WARNING: This file was auto-generated. Do not edit!
> diff --git a/meta/recipes-core/runit/runit/svlogd.patch
> b/meta/recipes-core/runit/runit/svlogd.patch
> new file mode 100644
> index 0000000000..468fdb2ae4
> --- /dev/null
> +++ b/meta/recipes-core/runit/runit/svlogd.patch
> @@ -0,0 +1,19 @@
> +Initialize all fields of sockaddr_in.
> +
> http://skarnet.org/cgi-bin/archive.cgi?2:mss:1163:201602:gpiglpbjdemlioaeabbn
> +
> +set all fields of sockaddr_in in svlogd.
> +
> +Upstream-Status: Submitted
> +
> +Author: Leah Neukirchen <leah@vuxu.org>
> +
> +--- runit-2.1.2/src/svlogd.c 2014-08-10 15:22:34.000000000 -0300
> ++++ runit-2.1.2/src/svlogd.c 2016-02-04 22:53:52.910965361 -0300
> +@@ -430,6 +430,7 @@
> +   ld->name =(char*)fn;
> +   ld->ppid =0;
> +   ld->match ='+';
> ++  ld->udpaddr.sin_family =AF_INET;
> +   ld->udpaddr.sin_port =0;
> +   ld->udponly =0;
> +   while (! stralloc_copys(&ld->prefix, "")) pause_nomem();
> diff --git a/meta/recipes-core/runit/runit_2.1.2.bb
> b/meta/recipes-core/runit/runit_2.1.2.bb
> new file mode 100644
> index 0000000000..affb309be1
> --- /dev/null
> +++ b/meta/recipes-core/runit/runit_2.1.2.bb
> @@ -0,0 +1,68 @@
> +# Copyright (C) 2017 Khem Raj <raj.khem@gmail.com>
> +# Released under the MIT license (see COPYING.MIT for the terms)
> +
> +DESCRIPTION = "A UNIX init scheme with service supervision"
> +HOMEPAGE = "http://smarden.org/runit/"
> +LICENSE = "BSD-3-Clause"
> +SECTION = "base"
> +
> +LIC_FILES_CHKSUM =
> "file://package/COPYING;md5=c9e8a560732fc8b860b6a91341cc603b"
> +
> +inherit update-alternatives
> +
> +SRC_URI = "http://smarden.org/${BPN}/${BP}.tar.gz \
> +
> file://0001-default-directory-for-services-on-Debian-is-etc-servi.diff;striplevel=2
> \
> +
> file://0002-support-etc-runit-nosync-file-to-make-sync-on-shutdow.diff;striplevel=2
> \
> +
> file://0003-utmpset.c-mixes-int32_t-and-time_t.diff;striplevel=2 \
> +
> file://0004-src-Makefile-don-t-use-static-to-link-runit-runit-ini.diff;striplevel=2
> \
> +           file://0005-patch-etc-runit-2-for-FHS.patch;striplevel=2 \
> +           file://0006-make-buildsystem-respect-CFLAGS.patch;striplevel=2
> \
> +           file://0007-move-communication-files.patch;striplevel=2 \
> +           file://0008-emulate-sysv-runlevel-5.patch;striplevel=2 \
> +           file://0009-fix-error-in-manpage.patch;striplevel=2 \
> +
> file://patch-make-build-system-print-compilatio.patch;striplevel=2 \
> +
> file://patch-disable-chkshgrp-test-that-fails-i.patch;striplevel=2 \
> +
> file://patch-fix-spin-lock-on-systems-with-poor.patch;striplevel=2 \
> +           file://cross.patch \
> +           file://clearmem.patch \
> +           file://svlogd.patch \
> +"
> +
> +SRC_URI[md5sum] = "6c985fbfe3a34608eb3c53dc719172c4"
> +SRC_URI[sha256sum] =
> "6fd0160cb0cf1207de4e66754b6d39750cff14bb0aa66ab49490992c0c47ba18"
> +
> +S = "${WORKDIR}/admin/${BPN}-${PV}"
> +
> +do_compile() {
> +       cd ${S}/src
> +       sed -e 's,sbin/runit,usr/bin/runit,g' -i ${S}/src/runit.h
> +       echo "$CC -D_GNU_SOURCE $CFLAGS" >conf-cc
> +       echo "$CC $LDFLAGS -Wl,-z -Wl,noexecstack" >conf-ld
> +       # change type short to gid_t for getgroups(2) and setgroups(2)
> +       sed -i -e 's:short x\[4\];$:gid_t x[4];:' ${S}/src/chkshsgr.c
> +       oe_runmake
> +
> +}
> +
> +do_install() {
> +       cd ${S}/src
> +       install -d ${D}${bindir}
> +       for f in chpst runit runit-init runsv runsvchdir runsvdir \
> +               sv svlogd utmpset; do
> +               install -m 0755 $f ${D}${bindir}
> +       done
> +       install -d ${D}${sysconfdir}/runit
> +       for f in 1 2 3 ctrlaltdel; do
> +               install -m 0755 ${S}/etc/debian/$f
> ${D}${sysconfdir}/runit/$f
> +       done
> +       sed -e 's,rmnologin,rmnologin.sh,g' -i ${D}${sysconfdir}/runit/1
> +       ln -s ${localstatedir}/run/runit.stopit
> ${D}${sysconfdir}/runit/stopit
> +        rm -rf ${D}${sysconfdir}/runit/{1,2,3,stopit,ctrlaltdel}
> +}
> +
> +RDEPENDS_${PN} += "runit-serialgetty socklog socklog-services"
> +
> +ALTERNATIVE_${PN} = "init"
> +ALTERNATIVE_TARGET[init] = "${bindir}/runit-init"
> +ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
> +ALTERNATIVE_PRIORITY[init] ?= "300"
> diff --git a/meta/recipes-core/runit/socklog-services.bb
> b/meta/recipes-core/runit/socklog-services.bb
> new file mode 100644
> index 0000000000..795bf8f390
> --- /dev/null
> +++ b/meta/recipes-core/runit/socklog-services.bb
> @@ -0,0 +1,23 @@
> +# Copyright (C) 2017 Khem Raj <raj.khem@gmail.com>
> +# Released under the MIT license (see COPYING.MIT for the terms)
> +
> +DESCRIPTION = "Additional socklog configurations from Void Distro"
> +HOMEPAGE = "https://github.com/void-linux/void-socklog"
> +LICENSE = "PD"
> +LIC_FILES_CHKSUM =
> "file://nanoklogd.c;beginline=3;endline=6;md5=8c10698c7abd64f01ac4245e2b11ab64"
> +SECTION = "base"
> +
> +PV = "20150726+git${SRCPV}"
> +
> +SRCREV = "e6b8b91dcd38ebcfbb0d41753d814edf78b06989"
> +SRC_URI = "git://github.com/void-linux/socklog-void \
> +           file://0001-Use-options-to-cp-to-ensure-proper-mods.patch \
> +"
> +
> +S = "${WORKDIR}/git"
> +
> +EXTRA_OEMAKE = "PREFIX=${exec_prefix}"
> +
> +do_install() {
> +       oe_runmake DESTDIR=${D} install
> +}
> diff --git
> a/meta/recipes-core/runit/socklog-services/0001-Use-options-to-cp-to-ensure-proper-mods.patch
>  b/meta/recipes-core/runit/socklog-services/0001-Use-options-to-cp-to-ensure-proper-mods.patch
>  new file mode 100644
> index 0000000000..edd5bae2ef
> --- /dev/null
> +++
> b/meta/recipes-core/runit/socklog-services/0001-Use-options-to-cp-to-ensure-proper-mods.patch
>  @@ -0,0 +1,33 @@
> +From b1f46a4d7273ba9b446527dc3f50aa4c318acdd3 Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Fri, 4 Jan 2019 18:15:18 -0800
> +Subject: [PATCH] Use options to cp to ensure proper mods
> +
> +This ensures that permissions are in line when using staged installed in
> +OE e.g.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +---
> + Makefile | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/Makefile b/Makefile
> +index 4f96b6e..4889229 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -5,8 +5,8 @@ install: all
> +       install -Dm755 svlogtail ${DESTDIR}/usr/bin/svlogtail
> +       install -Dm755 syslog-stripdate ${DESTDIR}/usr/bin/syslog-stripdate
> +       mkdir -p ${DESTDIR}/etc ${DESTDIR}/var/log
> +-      cp -a sv ${DESTDIR}/etc
> +-      cp -a socklog ${DESTDIR}/var/log
> ++      cp -R --no-dereference --preserve=mode,links sv ${DESTDIR}/etc
> ++      cp -R --no-dereference --preserve=mode,links socklog
> ${DESTDIR}/var/log
> +
> + clean:
> +       rm -f nanoklogd
> +--
> +2.20.1
> +
> diff --git a/meta/recipes-core/runit/socklog/cross.patch
> b/meta/recipes-core/runit/socklog/cross.patch
> new file mode 100644
> index 0000000000..bc0385f54e
> --- /dev/null
> +++ b/meta/recipes-core/runit/socklog/cross.patch
> @@ -0,0 +1,58 @@
> +chskshsgr must be built for the host.
> +
> +Original at:
> https://github.com/void-linux/void-packages/blob/master/srcpkgs/socklog/patches/cross.patch
>  +
> +Upstream-Status: Inappropriate [Cross-compile Specific]
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +
> +--- a/src/Makefile
> ++++ b/src/Makefile
> +@@ -117,11 +117,11 @@ byte_rchr.o: byte.h byte_rchr.c compile
> + byte_zero.o: byte.h byte_zero.c compile
> +       ./compile byte_zero.c
> +
> +-chkshsgr: chkshsgr.o load
> +-      ./load chkshsgr
> ++chkshsgr: chkshsgr.o loadhost
> ++      ./loadhost chkshsgr
> +
> +-chkshsgr.o: chkshsgr.c compile
> +-      ./compile chkshsgr.c
> ++chkshsgr.o: chkshsgr.c compilehost
> ++      ./compilehost chkshsgr.c
> +
> + choose: choose.sh warn-auto.sh
> +       rm -f choose
> +@@ -137,6 +137,11 @@ compile: conf-cc print-cc.sh systype war
> +       sh print-cc.sh > compile
> +       chmod 555 compile
> +
> ++compilehost:
> ++      cat warn-auto.sh > compilehost
> ++      @echo 'gcc -c $${1+"$$@"}' >> compilehost
> ++      chmod 555 compilehost
> ++
> + direntry.h: choose compile direntry.h1 direntry.h2 trydrent.c
> +       ./choose c trydrent direntry.h1 direntry.h2 > direntry.h
> +
> +@@ -198,6 +203,15 @@ load: conf-ld print-ld.sh systype warn-a
> +       sh print-ld.sh > load
> +       chmod 555 load
> +
> ++loadhost:
> ++      rm -f loadhost
> ++      @echo > loadhost
> ++      @echo 'systype="`cat systype`"' >> loadhost
> ++      @echo 'cat warn-auto.sh' >> loadhost
> ++      @echo 'main="$$1"; shift' >> loadhost
> ++      @echo 'gcc -o "$$main" "$$main".o $${1+"$$@"}' >> loadhost
> ++      chmod 555 loadhost
> ++
> + lock_ex.o: compile hasflock.h lock.h lock_ex.c
> +       ./compile lock_ex.c
> +
> +@@ -410,4 +424,3 @@ wait_nohang.o: compile haswaitp.h wait_n
> +
> + wait_pid.o: compile error.h haswaitp.h wait_pid.c
> +       ./compile wait_pid.c
> +-
> diff --git a/meta/recipes-core/runit/socklog_2.1.0.bb
> b/meta/recipes-core/runit/socklog_2.1.0.bb
> new file mode 100644
> index 0000000000..fc3fbd9826
> --- /dev/null
> +++ b/meta/recipes-core/runit/socklog_2.1.0.bb
> @@ -0,0 +1,32 @@
> +# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com>
> +# Released under the MIT license (see COPYING.MIT for the terms)
> +
> +SUMMARY = "Small and secure syslogd replacement for use with runit"
> +HOMEPAGE = "http://smarden.org/socklog/"
> +LICENSE = "BSD-3-Clause"
> +SECTION = "base"
> +
> +LIC_FILES_CHKSUM =
> "file://package/COPYING;md5=c7a77593c4b489904800014396f3f742"
> +SRC_URI = "http://smarden.org/${BPN}/${BP}.tar.gz \
> +           file://cross.patch \
> +"
> +SRC_URI[md5sum] = "5d0e8e28c9329ad3af982c5241df9ff1"
> +SRC_URI[sha256sum] =
> "aa869a787ee004da4e5509b5a0031bcc17a4ab4ac650c2ce8d4e488123acb455"
> +
> +S = "${WORKDIR}/admin/${BPN}-${PV}"
> +
> +do_compile() {
> +       cd ${S}/src
> +       echo "$CC -D_GNU_SOURCE $CFLAGS" >conf-cc
> +       echo "$CC $LDFLAGS -Wl,-z -Wl,noexecstack" >conf-ld
> +       echo "int main() { return 0; }" >${S}/src/chkshsgr.c
> +       oe_runmake
> +}
> +
> +do_install() {
> +       cd ${S}/src
> +       install -d ${D}${bindir}
> +       for f in socklog socklog-conf socklog-check uncat tryto; do
> +               install -m 0755 $f ${D}${bindir}
> +       done
> +}
> --
> 2.25.0
> 
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 


[Attachment #5 (text/html)]

<div dir="ltr"><div>1. Does this really need to be in core? Who is the target \
audience and use cases that aren&#39;t served by existing options?<br></div><div>2. \
There are no tests or image configurations for this. How will this be \
checked?</div><div>3. The amount of patches is alarming. Can you get them upstream \
first please?</div><div><br></div><div>Alex<br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 31 Jan 2020 at 10:32, \
Khem Raj &lt;<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">* Another init system, \
very small in size with application life<br>  cycle management<br>
* Add runit-services recipe for additional runit services from void linux<br>
* socklog is a system/kernel logger<br>
* Add socklog-services to provide additional logging services<br>
<br>
* disable the chkshsgr tests in socklog<br>
<br>
Running the chkhsgr test during cross compile fails<br>
<br>
./chkshsgr || ( cat warn-shsgr; exit 1 )<br>
Oops. Your getgroups() returned 0, and setgroups() failed; this means<br>
that I can&#39;t reliably do my shsgr test. Please either ``make&#39;&#39; as \
root<br> or ``make&#39;&#39; while you&#39;re in one or more supplementary \
groups.<br> <br>
All OE based targets have working getgroups()/setgroups()<br>
implementation, so its a safe assumption and therefore make the test<br>
to be a dummy<br>
<br>
Signed-off-by: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" \
                target="_blank">raj.khem@gmail.com</a>&gt;<br>
---<br>
  meta/conf/distro/include/maintainers.inc         |     2 +<br>
  meta/conf/layer.conf                                       |     1 +<br>
  meta/recipes-core/runit/<a href="http://runit-serialgetty.bb" rel="noreferrer" \
                target="_blank">runit-serialgetty.bb</a>   |   43 ++++++++<br>
  .../runit/runit-serialgetty/finish                  |     2 +<br>
  meta/recipes-core/runit/runit-serialgetty/run |     2 +<br>
  meta/recipes-core/runit/<a href="http://runit-services.bb" rel="noreferrer" \
                target="_blank">runit-services.bb</a>        |   50 +++++++++<br>
  ...y-for-services-on-Debian-is-etc-servi.diff |   87 +++++++++++++++<br>
  ...t-nosync-file-to-make-sync-on-shutdow.diff |   95 ++++++++++++++++<br>
  ...03-utmpset.c-mixes-int32_t-and-time_t.diff |   57 ++++++++++<br>
  ...-t-use-static-to-link-runit-runit-ini.diff |   30 ++++++<br>
  .../0005-patch-etc-runit-2-for-FHS.patch         |   17 +++<br>
  ...0006-make-buildsystem-respect-CFLAGS.patch |   21 ++++<br>
  .../runit/0007-move-communication-files.patch | 102 ++++++++++++++++++<br>
  .../runit/0008-emulate-sysv-runlevel-5.patch   |   20 ++++<br>
  .../runit/0009-fix-error-in-manpage.patch        |   23 ++++<br>
  meta/recipes-core/runit/runit/clearmem.patch   |   22 ++++<br>
  meta/recipes-core/runit/runit/cross.patch        |   50 +++++++++<br>
  ...h-disable-chkshgrp-test-that-fails-i.patch |   19 ++++<br>
  ...h-fix-spin-lock-on-systems-with-poor.patch |   20 ++++<br>
  ...h-make-build-system-print-compilatio.patch |   15 +++<br>
  meta/recipes-core/runit/runit/svlogd.patch      |   19 ++++<br>
  meta/recipes-core/runit/<a href="http://runit_2.1.2.bb" rel="noreferrer" \
target="_blank">runit_2.1.2.bb</a>            |   68 ++++++++++++<br>  \
meta/recipes-core/runit/<a href="http://socklog-services.bb" rel="noreferrer" \
                target="_blank">socklog-services.bb</a>     |   23 ++++<br>
  ...-options-to-cp-to-ensure-proper-mods.patch |   33 ++++++<br>
  meta/recipes-core/runit/socklog/cross.patch     |   58 ++++++++++<br>
  meta/recipes-core/runit/<a href="http://socklog_2.1.0.bb" rel="noreferrer" \
target="_blank">socklog_2.1.0.bb</a>         |   32 ++++++<br>  26 files changed, 911 \
insertions(+)<br>  create mode 100644 meta/recipes-core/runit/<a \
href="http://runit-serialgetty.bb" rel="noreferrer" \
target="_blank">runit-serialgetty.bb</a><br>  create mode 100644 \
meta/recipes-core/runit/runit-serialgetty/finish<br>  create mode 100644 \
meta/recipes-core/runit/runit-serialgetty/run<br>  create mode 100644 \
meta/recipes-core/runit/<a href="http://runit-services.bb" rel="noreferrer" \
target="_blank">runit-services.bb</a><br>  create mode 100644 \
meta/recipes-core/runit/runit/0001-default-directory-for-services-on-Debian-is-etc-servi.diff<br>
  create mode 100644 \
meta/recipes-core/runit/runit/0002-support-etc-runit-nosync-file-to-make-sync-on-shutdow.diff<br>
  create mode 100644 \
meta/recipes-core/runit/runit/0003-utmpset.c-mixes-int32_t-and-time_t.diff<br>  \
create mode 100644 meta/recipes-core/runit/runit/0004-src-Makefile-don-t-use-static-to-link-runit-runit-ini.diff<br>
  create mode 100644 \
meta/recipes-core/runit/runit/0005-patch-etc-runit-2-for-FHS.patch<br>  create mode \
100644 meta/recipes-core/runit/runit/0006-make-buildsystem-respect-CFLAGS.patch<br>  \
create mode 100644 meta/recipes-core/runit/runit/0007-move-communication-files.patch<br>
  create mode 100644 \
meta/recipes-core/runit/runit/0008-emulate-sysv-runlevel-5.patch<br>  create mode \
100644 meta/recipes-core/runit/runit/0009-fix-error-in-manpage.patch<br>  create mode \
100644 meta/recipes-core/runit/runit/clearmem.patch<br>  create mode 100644 \
meta/recipes-core/runit/runit/cross.patch<br>  create mode 100644 \
meta/recipes-core/runit/runit/patch-disable-chkshgrp-test-that-fails-i.patch<br>  \
create mode 100644 meta/recipes-core/runit/runit/patch-fix-spin-lock-on-systems-with-poor.patch<br>
  create mode 100644 \
meta/recipes-core/runit/runit/patch-make-build-system-print-compilatio.patch<br>  \
create mode 100644 meta/recipes-core/runit/runit/svlogd.patch<br>  create mode 100644 \
meta/recipes-core/runit/<a href="http://runit_2.1.2.bb" rel="noreferrer" \
target="_blank">runit_2.1.2.bb</a><br>  create mode 100644 meta/recipes-core/runit/<a \
href="http://socklog-services.bb" rel="noreferrer" \
target="_blank">socklog-services.bb</a><br>  create mode 100644 \
meta/recipes-core/runit/socklog-services/0001-Use-options-to-cp-to-ensure-proper-mods.patch<br>
  create mode 100644 meta/recipes-core/runit/socklog/cross.patch<br>
  create mode 100644 meta/recipes-core/runit/<a href="http://socklog_2.1.0.bb" \
rel="noreferrer" target="_blank">socklog_2.1.0.bb</a><br> <br>
diff --git a/meta/conf/distro/include/maintainers.inc \
b/meta/conf/distro/include/maintainers.inc<br> index a80e85a2f6..5e79dc3892 \
                100644<br>
--- a/meta/conf/distro/include/maintainers.inc<br>
+++ b/meta/conf/distro/include/maintainers.inc<br>
@@ -616,6 +616,8 @@ RECIPE_MAINTAINER_pn-rsync = &quot;Yi Zhao &lt;<a \
href="mailto:yi.zhao@windriver.com" \
target="_blank">yi.zhao@windriver.com</a>&gt;&quot;<br>  \
RECIPE_MAINTAINER_pn-rt-tests = &quot;Alexander Kanavin &lt;<a \
href="mailto:alex.kanavin@gmail.com" \
target="_blank">alex.kanavin@gmail.com</a>&gt;&quot;<br>  RECIPE_MAINTAINER_pn-ruby = \
&quot;Ross Burton &lt;<a href="mailto:ross.burton@intel.com" \
target="_blank">ross.burton@intel.com</a>&gt;&quot;<br>  \
RECIPE_MAINTAINER_pn-run-postinsts = &quot;Ross Burton &lt;<a \
href="mailto:ross.burton@intel.com" \
target="_blank">ross.burton@intel.com</a>&gt;&quot;<br> +RECIPE_MAINTAINER_pn-runit = \
&quot;Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" \
target="_blank">raj.khem@gmail.com</a>&gt;&quot;<br> \
+RECIPE_MAINTAINER_pn-runit-serialgetty = &quot;Khem Raj &lt;<a \
href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt;&quot;<br> \
RECIPE_MAINTAINER_pn-rxvt-unicode = &quot;Armin Kuster &lt;<a \
href="mailto:akuster808@gmail.com" \
target="_blank">akuster808@gmail.com</a>&gt;&quot;<br>  \
RECIPE_MAINTAINER_pn-sato-screenshot = &quot;Ross Burton &lt;<a \
href="mailto:ross.burton@intel.com" \
target="_blank">ross.burton@intel.com</a>&gt;&quot;<br>  RECIPE_MAINTAINER_pn-sbc = \
&quot;Tanu Kaskinen &lt;<a href="mailto:tanuk@iki.fi" \
                target="_blank">tanuk@iki.fi</a>&gt;&quot;<br>
diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf<br>
index fcdf9ae5a3..07d9a9e32d 100644<br>
--- a/meta/conf/layer.conf<br>
+++ b/meta/conf/layer.conf<br>
@@ -35,6 +35,7 @@ SIGGEN_EXCLUDERECIPES_ABISAFE += &quot; \<br>
     keymaps \<br>
     udev-extraconf \<br>
     packagegroup-x11-xserver \<br>
+   runit-serialgetty \<br>
     systemd-serialgetty \<br>
     initscripts \<br>
     shadow \<br>
diff --git a/meta/recipes-core/runit/<a href="http://runit-serialgetty.bb" \
rel="noreferrer" target="_blank">runit-serialgetty.bb</a> \
b/meta/recipes-core/runit/<a href="http://runit-serialgetty.bb" rel="noreferrer" \
target="_blank">runit-serialgetty.bb</a><br> new file mode 100644<br>
index 0000000000..780a74bafa<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/<a href="http://runit-serialgetty.bb" rel="noreferrer" \
target="_blank">runit-serialgetty.bb</a><br> @@ -0,0 +1,43 @@<br>
+# Copyright (C) 2017 Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" \
target="_blank">raj.khem@gmail.com</a>&gt;<br> +# Released under the MIT license (see \
COPYING.MIT for the terms)<br> +<br>
+DESCRIPTION = &quot;Serial terminal support for runit&quot;<br>
+<br>
+SECTION = &quot;base utils&quot;<br>
+LICENSE = &quot;MIT&quot;<br>
+LIC_FILES_CHKSUM = &quot;file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420&quot;<br>
 +<br>
+INHIBIT_DEFAULT_DEPS = &quot;1&quot;<br>
+<br>
+SRC_URI = &quot;\<br>
+                 file://run \<br>
+                 file://finish \<br>
+&quot;<br>
+<br>
+S = &quot;${WORKDIR}&quot;<br>
+<br>
+SERIAL_CONSOLES ??= &quot;115200;ttyS0&quot;<br>
+<br>
+do_install() {<br>
+           install -d ${D}${sysconfdir}/service \
${D}${sysconfdir}/runit/runsvdir/default<br> +           \
tmp=&quot;${SERIAL_CONSOLES}&quot;<br> +           for i in $tmp<br>
+           do<br>
+                       baudrate=`echo $i | sed &#39;s/\;.*//&#39;`<br>
+                       ttydev=`echo $i | sed -e &#39;s/^[0-9]*\;//&#39; -e \
&#39;s/\;.*//&#39;`<br> +                       install -d \
${D}${sysconfdir}/sv/getty-${ttydev}<br> +                       install -m 755 \
${WORKDIR}/run ${D}${sysconfdir}/sv/getty-${ttydev}<br> +                       \
install -m 755 ${WORKDIR}/finish ${D}${sysconfdir}/sv/getty-${ttydev}<br> +           \
sed -i -e s/\@BAUDRATE\@/$baudrate/g ${D}${sysconfdir}/sv/getty-${ttydev}/run<br> +   \
sed -i -e s/\@BAUDRATE\@/$baudrate/g ${D}${sysconfdir}/sv/getty-${ttydev}/finish<br> \
+                       sed -i -e s/\@TTY\@/$ttydev/g \
${D}${sysconfdir}/sv/getty-${ttydev}/run<br> +                       sed -i -e \
s/\@TTY\@/$ttydev/g ${D}${sysconfdir}/sv/getty-${ttydev}/finish<br> +                 \
ln -s ${localstatedir}/run/sv.getty-${ttydev} \
${D}${sysconfdir}/sv/getty-${ttydev}/supervise<br> +                       ln -s \
${sysconfdir}/sv/getty-${ttydev} ${D}${sysconfdir}/service/getty-${ttydev}<br> +      \
ln -s ${sysconfdir}/sv/getty-${ttydev} \
${D}${sysconfdir}/runit/runsvdir/default/getty-${ttydev}<br> +           done<br>
+}<br>
+# Since SERIAL_CONSOLES is likely to be set from the machine configuration<br>
+PACKAGE_ARCH = &quot;${MACHINE_ARCH}&quot;<br>
+<br>
+FILES_${PN} = &quot;${sysconfdir}&quot;<br>
diff --git a/meta/recipes-core/runit/runit-serialgetty/finish \
b/meta/recipes-core/runit/runit-serialgetty/finish<br> new file mode 100644<br>
index 0000000000..860c07d64d<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit-serialgetty/finish<br>
@@ -0,0 +1,2 @@<br>
+#!/bin/sh<br>
+exec utmpset -w @TTY@<br>
diff --git a/meta/recipes-core/runit/runit-serialgetty/run \
b/meta/recipes-core/runit/runit-serialgetty/run<br> new file mode 100644<br>
index 0000000000..2070fbd711<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit-serialgetty/run<br>
@@ -0,0 +1,2 @@<br>
+#!/bin/sh<br>
+exec /sbin/getty @BAUDRATE@ @TTY@ vt102<br>
diff --git a/meta/recipes-core/runit/<a href="http://runit-services.bb" \
rel="noreferrer" target="_blank">runit-services.bb</a> b/meta/recipes-core/runit/<a \
href="http://runit-services.bb" rel="noreferrer" \
target="_blank">runit-services.bb</a><br> new file mode 100644<br>
index 0000000000..d24ed592dc<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/<a href="http://runit-services.bb" rel="noreferrer" \
target="_blank">runit-services.bb</a><br> @@ -0,0 +1,50 @@<br>
+# Copyright (C) 2017 Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" \
target="_blank">raj.khem@gmail.com</a>&gt;<br> +# Released under the MIT license (see \
COPYING.MIT for the terms)<br> +<br>
+DESCRIPTION = &quot;Additional runit scripts for OE based systems&quot;<br>
+HOMEPAGE = &quot;<a href="https://github.com/YoeDistro/oe-runit" rel="noreferrer" \
target="_blank">https://github.com/YoeDistro/oe-runit</a>&quot;<br> +LICENSE = \
&quot;PD&quot;<br> +LIC_FILES_CHKSUM = \
&quot;file://README.md;beginline=41;endline=48;md5=f2f8535b84b11359cc7757b009cfd646&quot;<br>
 +SECTION = &quot;base&quot;<br>
+<br>
+PV = &quot;20180623+git${SRCPV}&quot;<br>
+<br>
+SRCREV = &quot;8d5db5c26670e49524f33800aaf0337466495c84&quot;<br>
+SRC_URI = &quot;git://<a \
href="http://github.com/YoeDistro/oe-runit;branch=oe/master" rel="noreferrer" \
target="_blank">github.com/YoeDistro/oe-runit;branch=oe/master</a> \<br> +&quot;<br>
+<br>
+S = &quot;${WORKDIR}/git&quot;<br>
+<br>
+EXTRA_OEMAKE = &quot;PREFIX=${exec_prefix}&quot;<br>
+<br>
+do_install() {<br>
+           oe_runmake DESTDIR=${D} install<br>
+           install -d ${D}${base_bindir} ${D}${sysconfdir}/runit/runsvdir<br>
+           for f in shutdown halt reboot poweroff<br>
+           do<br>
+                       ln -sf ${bindir}/$f ${D}${base_bindir}/$f<br>
+           done<br>
+}<br>
+<br>
+pkg_postinst_ontarget_${PN} () {<br>
+            # Enable default services:<br>
+            #           - agetty-tty[1-4] (default)<br>
+            #           - udevd (default)<br>
+            #           - sulogin (single)<br>
+            mkdir -p $D/etc/runit/runsvdir/single<br>
+            ln -sf /etc/sv/sulogin $D/etc/runit/runsvdir/single<br>
+<br>
+            mkdir -p $D/etc/runit/runsvdir/default<br>
+            if [ ! -e $D/etc/runit/runsvdir/current ]; then<br>
+                       ln -sf default $D/etc/runit/runsvdir/current<br>
+           fi<br>
+            if [ -e $D/etc/sv/udevd/run ]; then<br>
+                       ln -sf /etc/sv/udevd $D/etc/runit/runsvdir/default<br>
+           fi<br>
+}<br>
+<br>
+RDEPENDS_${PN} = &quot;runit findutils util-linux-fsck coreutils&quot;<br>
+<br>
+PACKAGES =+ &quot;${PN}-dracut&quot;<br>
+<br>
+FILES_${PN}-dracut = &quot;${nonarch_libdir}/dracut&quot;<br>
diff --git a/meta/recipes-core/runit/runit/0001-default-directory-for-services-on-Debian-is-etc-servi.diff \
b/meta/recipes-core/runit/runit/0001-default-directory-for-services-on-Debian-is-etc-servi.diff<br>
 new file mode 100644<br>
index 0000000000..afc1bc5564<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/0001-default-directory-for-services-on-Debian-is-etc-servi.diff<br>
 @@ -0,0 +1,87 @@<br>
+From d99515f6c8427e5f1c8f252532df8858bdef1007 Mon Sep 17 00:00:00 2001<br>
+From: Gerrit Pape &lt;<a href="mailto:pape@smarden.org" \
target="_blank">pape@smarden.org</a>&gt;<br> +Date: Wed, 7 May 2008 23:51:16 \
+0000<br> +Subject: [PATCH] default directory for services on Debian is \
/etc/service/,<br> + not /service/<br>
+<br>
+---<br>
+ runit-2.1.2/man/runsv.8         | 4 ++--<br>
+ runit-2.1.2/man/runsvchdir.8 | 4 ++--<br>
+ runit-2.1.2/man/sv.8              | 4 ++--<br>
+ runit-2.1.2/src/sv.c              | 2 +-<br>
+ 4 files changed, 7 insertions(+), 7 deletions(-)<br>
+<br>
+diff --git a/runit-2.1.2/man/runsv.8 b/runit-2.1.2/man/runsv.8<br>
+index 7c5abfc..75bc73a 100644<br>
+--- a/runit-2.1.2/man/runsv.8<br>
++++ b/runit-2.1.2/man/runsv.8<br>
+@@ -157,9 +157,9 @@ This command is ignored if it is given to<br>
+ .IR service /log/supervise/control.<br>
+ .P<br>
+ Example: to send a TERM signal to the socklog-unix service, either do<br>
+-   # sv term /service/socklog-unix<br>
++   # sv term /etc/service/socklog-unix<br>
+   or<br>
+-   # printf t &gt;/service/socklog-unix/supervise/control<br>
++   # printf t &gt;/etc/service/socklog-unix/supervise/control<br>
+ .P<br>
+ .BR printf (1)<br>
+ usually blocks if no<br>
+diff --git a/runit-2.1.2/man/runsvchdir.8 b/runit-2.1.2/man/runsvchdir.8<br>
+index f7f94dc..a5fc180 100644<br>
+--- a/runit-2.1.2/man/runsvchdir.8<br>
++++ b/runit-2.1.2/man/runsvchdir.8<br>
+@@ -27,13 +27,13 @@ with a symlink pointing to<br>
+ .IR dir .<br>
+ .P<br>
+ Normally <br>
+-.I /service<br>
++.I /etc/service<br>
+ is a symlink to<br>
+ .IR current ,<br>
+ and<br>
+ .BR runsvdir (8)<br>
+ is running<br>
+-.IR /service/ .<br>
++.IR /etc/service/ .<br>
+ .SH EXIT CODES<br>
+ .B runsvchdir<br>
+ prints an error message and exits 111 on error.<br>
+diff --git a/runit-2.1.2/man/sv.8 b/runit-2.1.2/man/sv.8<br>
+index 7ed9852..fa56443 100644<br>
+--- a/runit-2.1.2/man/sv.8<br>
++++ b/runit-2.1.2/man/sv.8<br>
+@@ -30,7 +30,7 @@ If<br>
+ .I service<br>
+ doesn&#39;t start with a dot or slash and doesn&#39;t end with a slash, it is<br>
+ searched in the default services directory<br>
+-.IR /service/ ,<br>
++.IR /etc/service/ ,<br>
+ otherwise relative to the current directory.<br>
+ .P<br>
+ .I command<br>
+@@ -232,7 +232,7 @@ This option implies<br>
+ .TP<br>
+ .B SVDIR<br>
+ The environment variable $SVDIR overrides the default services directory<br>
+-.IR /service/ .<br>
++.IR /etc/service/ .<br>
+ .TP<br>
+ .B SVWAIT<br>
+ The environment variable $SVWAIT overrides the default 7 seconds to wait<br>
+diff --git a/runit-2.1.2/src/sv.c b/runit-2.1.2/src/sv.c<br>
+index 0125795..887e9d1 100644<br>
+--- a/runit-2.1.2/src/sv.c<br>
++++ b/runit-2.1.2/src/sv.c<br>
+@@ -32,7 +32,7 @@<br>
+ char *progname;<br>
+ char *action;<br>
+ char *acts;<br>
+-char *varservice =&quot;/service/&quot;;<br>
++char *varservice =&quot;/etc/service/&quot;;<br>
+ char **service;<br>
+ char **servicex;<br>
+ unsigned int services;<br>
+-- <br>
+2.0.1<br>
+<br>
diff --git a/meta/recipes-core/runit/runit/0002-support-etc-runit-nosync-file-to-make-sync-on-shutdow.diff \
b/meta/recipes-core/runit/runit/0002-support-etc-runit-nosync-file-to-make-sync-on-shutdow.diff<br>
 new file mode 100644<br>
index 0000000000..91f9e947e1<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/0002-support-etc-runit-nosync-file-to-make-sync-on-shutdow.diff<br>
 @@ -0,0 +1,95 @@<br>
+From aed8774b9aa813cbb3e8b732f6f7ae132f86c82b Mon Sep 17 00:00:00 2001<br>
+From: Andras Korn &lt;<a href="mailto:korn-debbugs@elan.rulez.org" \
target="_blank">korn-debbugs@elan.rulez.org</a>&gt;<br> +Date: Thu, 6 Dec 2012 \
16:57:06 +0100<br> +Subject: [PATCH] support /etc/runit/nosync file to make sync \
on<br> + shutdown/reboot optional<br>
+<br>
+<a href="https://bugs.debian.org/695281" rel="noreferrer" \
target="_blank">https://bugs.debian.org/695281</a><br> +---<br>
+ runit-2.1.2/doc/runit.8.html |   2 ++<br>
+ runit-2.1.2/man/runit.8         |   5 +++++<br>
+ runit-2.1.2/src/runit.c         | 15 ++++++++++-----<br>
+ runit-2.1.2/src/runit.h         |   1 +<br>
+ 4 files changed, 18 insertions(+), 5 deletions(-)<br>
+<br>
+--- a/runit-2.1.2/doc/runit.8.html<br>
++++ b/runit-2.1.2/doc/runit.8.html<br>
+@@ -34,6 +34,8 @@ stage 2 if it is running, and runs &lt;i&gt;/e<br>
+ and possibly halt or reboot the system are done here. If stage 3 returns,<br>
+ &lt;b&gt;runit&lt;/b&gt; checks if the file &lt;i&gt;/etc/runit/reboot&lt;/i&gt; \
exists and has the execute by<br> + owner permission set. If so, the system is \
rebooted, it&amp;rsquo;s halted otherwise.<br> ++If \
&lt;i&gt;/etc/runit/nosync&lt;/i&gt; exists, &lt;b&gt;runit&lt;/b&gt; \
doesn&amp;rsquo;t invoke<br> ++sync(). This is useful in vservers.<br>
+ <br>
+ &lt;h2&gt;&lt;a name=&#39;sect6&#39;&gt;Ctrl-alt-del&lt;/a&gt;&lt;/h2&gt;<br>
+ If &lt;b&gt;runit&lt;/b&gt; receives the ctrl-alt-del keyboard request and the \
file<br> +--- a/runit-2.1.2/man/runit.8<br>
++++ b/runit-2.1.2/man/runit.8<br>
+@@ -48,6 +48,11 @@ checks if the file<br>
+ .I /etc/runit/reboot<br>
+ exists and has the execute by owner permission set.<br>
+ If so, the system is rebooted, it&#39;s halted otherwise.<br>
++If<br>
++.I /etc/runit/nosync<br>
++exists,<br>
++.B runit<br>
++doesn&#39;t invoke sync(). This is useful in vservers.<br>
+ .SH CTRL-ALT-DEL<br>
+ If<br>
+ .B runit<br>
+--- a/runit-2.1.2/src/runit.c<br>
++++ b/runit-2.1.2/src/runit.c<br>
+@@ -41,6 +41,11 @@ void sig_int_handler (void) {<br>
+ }<br>
+ void sig_child_handler (void) { write(selfpipe[1], &quot;&quot;, 1); }<br>
+ <br>
++void sync_if_needed() {<br>
++   struct stat s;<br>
++   if (stat(NOSYNC, &amp;s) == -1) sync();<br>
++}<br>
++<br>
+ int main (int argc, const char * const *argv, char * const *envp) {<br>
+     const char * prog[2];<br>
+     int pid, pid2;<br>
+@@ -305,28 +310,28 @@ int main (int argc, const char * const *<br>
+     case -1:<br>
+     if ((stat(REBOOT, &amp;s) != -1) &amp;&amp; (s.st_mode &amp; S_IXUSR)) {<br>
+        strerr_warn2(INFO, &quot;system reboot.&quot;, 0);<br>
+-      sync();<br>
++      sync_if_needed();<br>
+        reboot_system(RB_AUTOBOOT);<br>
+     }<br>
+     else {<br>
+ #ifdef RB_POWER_OFF<br>
+        strerr_warn2(INFO, &quot;power off...&quot;, 0);<br>
+-      sync();<br>
++      sync_if_needed();<br>
+        reboot_system(RB_POWER_OFF);<br>
+        sleep(2);<br>
+ #endif<br>
+ #ifdef RB_HALT_SYSTEM<br>
+        strerr_warn2(INFO, &quot;system halt.&quot;, 0);<br>
+-      sync();<br>
++      sync_if_needed();<br>
+        reboot_system(RB_HALT_SYSTEM);<br>
+ #else<br>
+ #ifdef RB_HALT<br>
+        strerr_warn2(INFO, &quot;system halt.&quot;, 0);<br>
+-      sync();<br>
++      sync_if_needed();<br>
+        reboot_system(RB_HALT);<br>
+ #else<br>
+        strerr_warn2(INFO, &quot;system reboot.&quot;, 0);<br>
+-      sync();<br>
++      sync_if_needed();<br>
+        reboot_system(RB_AUTOBOOT);<br>
+ #endif<br>
+ #endif<br>
+--- a/runit-2.1.2/src/runit.h<br>
++++ b/runit-2.1.2/src/runit.h<br>
+@@ -1,4 +1,5 @@<br>
+ #define RUNIT &quot;/sbin/runit&quot;<br>
+ #define STOPIT &quot;/etc/runit/stopit&quot;<br>
+ #define REBOOT &quot;/etc/runit/reboot&quot;<br>
++#define NOSYNC &quot;/run/runit.nosync&quot;<br>
+ #define CTRLALTDEL &quot;/etc/runit/ctrlaltdel&quot;<br>
diff --git a/meta/recipes-core/runit/runit/0003-utmpset.c-mixes-int32_t-and-time_t.diff \
b/meta/recipes-core/runit/runit/0003-utmpset.c-mixes-int32_t-and-time_t.diff<br> new \
file mode 100644<br> index 0000000000..6b21bbb40e<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/0003-utmpset.c-mixes-int32_t-and-time_t.diff<br>
@@ -0,0 +1,57 @@<br>
+From 20a0afcd367666efc17c59cf121a0d991ff1bd09 Mon Sep 17 00:00:00 2001<br>
+From: Gerrit Pape &lt;<a href="mailto:pape@smarden.org" \
target="_blank">pape@smarden.org</a>&gt;<br> +Date: Thu, 31 Jul 2014 12:25:49 \
+0000<br> +Subject: [PATCH] utmpset.c: mixes &quot;int32_t *&quot; and &quot;time_t \
*&quot;<br> +<br>
+Don&#39;t pass int32_t to time(), thx Lorenzo Beretta,<br>
+<a href="https://bugs.debian.org/754849" rel="noreferrer" \
target="_blank">https://bugs.debian.org/754849</a><br> +---<br>
+ runit-2.1.2/src/utmpset.c | 8 ++++++--<br>
+ 1 file changed, 6 insertions(+), 2 deletions(-)<br>
+<br>
+diff --git a/runit-2.1.2/src/utmpset.c b/runit-2.1.2/src/utmpset.c<br>
+index eea41a5..2e8a525 100644<br>
+--- a/runit-2.1.2/src/utmpset.c<br>
++++ b/runit-2.1.2/src/utmpset.c<br>
+@@ -24,6 +24,7 @@ void usage(void) { strerr_die4x(1, &quot;usage: &quot;, progname, \
USAGE, &quot;\n&quot;); }<br> + int utmp_logout(const char *line) {<br>
+     int fd;<br>
+     uw_tmp ut;<br>
++   time_t t;<br>
+     int ok =-1;<br>
+ <br>
+     if ((fd =open(UW_TMP_UFILE, O_RDWR, 0)) &lt; 0)<br>
+@@ -35,7 +36,8 @@ int utmp_logout(const char *line) {<br>
+        if (!ut.ut_name[0] || (str_diff(ut.ut_line, line) != 0)) continue;<br>
+        memset(ut.ut_name, 0, sizeof ut.ut_name);<br>
+        memset(ut.ut_host, 0, sizeof ut.ut_host);<br>
+-      if (time(&amp;ut.ut_time) == -1) break;<br>
++      if (time(&amp;t) == -1) break;<br>
++      ut.ut_time = t;<br>
+ #ifdef DEAD_PROCESS<br>
+        ut.ut_type =DEAD_PROCESS;<br>
+ #endif<br>
+@@ -52,6 +54,7 @@ int wtmp_logout(const char *line) {<br>
+     int len;<br>
+     struct stat st;<br>
+     uw_tmp ut;<br>
++   time_t t;<br>
+ <br>
+     if ((fd = open_append(UW_TMP_WFILE)) == -1)<br>
+        strerr_die4sys(111, FATAL, &quot;unable to open &quot;, UW_TMP_WFILE, \
&quot;: &quot;);<br> +@@ -65,10 +68,11 @@ int wtmp_logout(const char *line) {<br>
+     memset(&amp;ut, 0, sizeof(uw_tmp));<br>
+     if ((len =str_len(line)) &gt; sizeof ut.ut_line) len =sizeof ut.ut_line -2;<br>
+     byte_copy(ut.ut_line, len, line);<br>
+-   if (time(&amp;ut.ut_time) == -1) {<br>
++   if (time(&amp;t) == -1) {<br>
+        close(fd);<br>
+        return(-1);<br>
+     }<br>
++   ut.ut_time = t;<br>
+ #ifdef DEAD_PROCESS<br>
+     ut.ut_type =DEAD_PROCESS;<br>
+ #endif<br>
+-- <br>
+2.0.1<br>
+<br>
diff --git a/meta/recipes-core/runit/runit/0004-src-Makefile-don-t-use-static-to-link-runit-runit-ini.diff \
b/meta/recipes-core/runit/runit/0004-src-Makefile-don-t-use-static-to-link-runit-runit-ini.diff<br>
 new file mode 100644<br>
index 0000000000..c2cdfc8881<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/0004-src-Makefile-don-t-use-static-to-link-runit-runit-ini.diff<br>
 @@ -0,0 +1,30 @@<br>
+From 77d0f60701a401ea0de0925d9422c78fb560b4f6 Mon Sep 17 00:00:00 2001<br>
+From: Gerrit Pape &lt;<a href="mailto:pape@smarden.org" \
target="_blank">pape@smarden.org</a>&gt;<br> +Date: Thu, 31 Jul 2014 12:54:32 \
+0000<br> +Subject: [PATCH] src/Makefile: don&#39;t use -static to link runit, \
runit-init on<br> + Debian<br>
+<br>
+---<br>
+ runit-2.1.2/src/Makefile | 4 ++--<br>
+ 1 file changed, 2 insertions(+), 2 deletions(-)<br>
+<br>
+diff --git a/runit-2.1.2/src/Makefile b/runit-2.1.2/src/Makefile<br>
+index d9624de..507a419 100644<br>
+--- a/runit-2.1.2/src/Makefile<br>
++++ b/runit-2.1.2/src/Makefile<br>
+@@ -6,10 +6,10 @@ check: $(IT)<br>
+           ./check-local $(IT)<br>
+ <br>
+ runit: load runit.o unix.a byte.a<br>
+-         ./load runit unix.a byte.a -static<br>
++         ./load runit unix.a byte.a<br>
+ <br>
+ runit-init: load runit-init.o unix.a byte.a<br>
+-         ./load runit-init unix.a byte.a -static<br>
++         ./load runit-init unix.a byte.a<br>
+ <br>
+ runsv: load runsv.o unix.a byte.a time.a<br>
+           ./load runsv unix.a byte.a time.a<br>
+-- <br>
+2.0.1<br>
+<br>
diff --git a/meta/recipes-core/runit/runit/0005-patch-etc-runit-2-for-FHS.patch \
b/meta/recipes-core/runit/runit/0005-patch-etc-runit-2-for-FHS.patch<br> new file \
mode 100644<br> index 0000000000..8bcfe8801c<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/0005-patch-etc-runit-2-for-FHS.patch<br>
@@ -0,0 +1,17 @@<br>
+Description: Make /etc/runit/2 respect FHS<br>
+ On Debian system services directory is /etc/service, not /service.<br>
+Author: Dmitry Bogatov &lt;<a href="mailto:KAction@gnu.org" \
target="_blank">KAction@gnu.org</a>&gt;<br> +Last-Update: 2016-05-31<br>
+---<br>
+This patch header follows DEP-3: <a href="http://dep.debian.net/deps/dep3/" \
rel="noreferrer" target="_blank">http://dep.debian.net/deps/dep3/</a><br> +--- \
a/runit-2.1.2/etc/2<br> ++++ b/runit-2.1.2/etc/2<br>
+@@ -1,6 +1,6 @@<br>
+ #!/bin/sh<br>
+ <br>
+-PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin<br>
 ++PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin<br>
 + <br>
+ exec env - PATH=$PATH \<br>
+-runsvdir -P /service &#39;log: \
...................................................................................... \
...................................................................................... \
...................................................................................... \
.........................................................................................................................................&#39;<br>
 ++runsvdir -P /etc/service &#39;log: \
...................................................................................... \
...................................................................................... \
...................................................................................... \
.........................................................................................................................................&#39;<br>
                
diff --git a/meta/recipes-core/runit/runit/0006-make-buildsystem-respect-CFLAGS.patch \
b/meta/recipes-core/runit/runit/0006-make-buildsystem-respect-CFLAGS.patch<br> new \
file mode 100644<br> index 0000000000..269d79a49b<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/0006-make-buildsystem-respect-CFLAGS.patch<br>
@@ -0,0 +1,21 @@<br>
+Description: Make buildsystem respect dpkg-buildflags<br>
+Author: Dmitry Bogatov &lt;<a href="mailto:KAction@gnu.org" \
target="_blank">KAction@gnu.org</a>&gt;<br> +Last-Update: 2016-06-01<br>
+---<br>
+This patch header follows DEP-3: <a href="http://dep.debian.net/deps/dep3/" \
rel="noreferrer" target="_blank">http://dep.debian.net/deps/dep3/</a><br> +--- \
a/runit-2.1.2/src/print-cc.sh<br> ++++ b/runit-2.1.2/src/print-cc.sh<br>
+@@ -2,4 +2,4 @@ cc=&quot;`head -n1 conf-cc`&quot;<br>
+ systype=&quot;`cat systype`&quot;<br>
+ <br>
+ cat warn-auto.sh<br>
+-echo exec &quot;$cc&quot; &#39;-c ${1+&quot;$@&quot;}&#39;<br>
++echo exec &quot;$cc&quot; &quot;$CPPFLAGS&quot; &quot;$CFLAGS&quot; &#39;-c \
${1+&quot;$@&quot;}&#39;<br> +--- a/runit-2.1.2/src/print-ld.sh<br>
++++ b/runit-2.1.2/src/print-ld.sh<br>
+@@ -3,4 +3,4 @@ systype=&quot;`cat systype`&quot;<br>
+ <br>
+ cat warn-auto.sh<br>
+ echo &#39;main=&quot;$1&quot;; shift&#39;<br>
+-echo exec &quot;$ld&quot; &#39;-o &quot;$main&quot; &quot;$main&quot;.o \
${1+&quot;$@&quot;}&#39;<br> ++echo exec &quot;$ld&quot; &quot;$LDFLAGS&quot; &#39;-o \
                &quot;$main&quot; &quot;$main&quot;.o ${1+&quot;$@&quot;}&#39;<br>
diff --git a/meta/recipes-core/runit/runit/0007-move-communication-files.patch \
b/meta/recipes-core/runit/runit/0007-move-communication-files.patch<br> new file mode \
100644<br> index 0000000000..bfcbac8015<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/0007-move-communication-files.patch<br>
@@ -0,0 +1,102 @@<br>
+Description: Move communication files under /run<br>
+ Runit by default uses files /etc/runit/stop and /etc/runit/reboot.<br>
+ This configuration will not work when /etc is mounted read-only,<br>
+ as such this patch renames this files into /run/runit.stop and<br>
+ /run/runit.reboot<br>
+Author: Dmitry Bogatov &lt;<a href="mailto:KAction@gnu.org" \
target="_blank">KAction@gnu.org</a>&gt;<br> +Last-Update: 2016-06-02<br>
+---<br>
+This patch header follows DEP-3: <a href="http://dep.debian.net/deps/dep3/" \
rel="noreferrer" target="_blank">http://dep.debian.net/deps/dep3/</a><br> +--- \
a/runit-2.1.2/etc/debian/1<br> ++++ b/runit-2.1.2/etc/debian/1<br>
+@@ -6,5 +6,5 @@ PATH=/command:/sbin:/bin:/usr/sbin:/usr/<br>
+ /etc/init.d/rcS<br>
+ /etc/init.d/rmnologin<br>
+ <br>
+-touch /etc/runit/stopit<br>
+-chmod 0 /etc/runit/stopit<br>
++touch /run/runit.stopit<br>
++chmod 0 /run/runit.stopit<br>
+--- a/runit-2.1.2/etc/debian/3<br>
++++ b/runit-2.1.2/etc/debian/3<br>
+@@ -4,7 +4,7 @@ exec 2&gt;&amp;1<br>
+ PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin<br>
+ <br>
+ LAST=0<br>
+-test -x /etc/runit/reboot &amp;&amp; LAST=6<br>
++test -x /run/runit.reboot &amp;&amp; LAST=6<br>
+ <br>
+ echo &#39;Waiting for services to stop...&#39;<br>
+ sv -w196 force-stop /service/*<br>
+--- a/runit-2.1.2/etc/debian/ctrlaltdel<br>
++++ b/runit-2.1.2/etc/debian/ctrlaltdel<br>
+@@ -4,6 +4,6 @@ PATH=/bin:/usr/bin<br>
+ MSG=&quot;System is going down in 14 seconds...&quot;<br>
+ <br>
+ # echo &#39;disabled.&#39; ; exit<br>
+-touch /etc/runit/stopit<br>
+-chmod 100 /etc/runit/stopit &amp;&amp; echo &quot;$MSG&quot; | wall<br>
++touch /etc/runit.stopit<br>
++chmod 100 /etc/runit.stopit &amp;&amp; echo &quot;$MSG&quot; | wall<br>
+ /bin/sleep 14<br>
+--- a/runit-2.1.2/man/runit-init.8<br>
++++ b/runit-2.1.2/man/runit-init.8<br>
+@@ -26,9 +26,9 @@ To signal<br>
+ the system halt request,<br>
+ .B runit-init<br>
+ removes all permissions of the file<br>
+-.I /etc/runit/reboot<br>
++.I /run/runit.reboot<br>
+ (chmod 0), and sets the execute by owner permission of the file<br>
+-.I /etc/runit/stopit<br>
++.I /run/runit.stopit<br>
+ (chmod 100).<br>
+ Then a CONT signal is sent to<br>
+ .BR runit (8).<br>
+@@ -40,9 +40,9 @@ To signal<br>
+ the system reboot request,<br>
+ .B runit-init<br>
+ sets the execute by owner permission of the files<br>
+-.I /etc/runit/reboot<br>
++.I /run/runit.reboot<br>
+ and<br>
+-.I /etc/runit/stopit<br>
++.I /run/runit.stopit<br>
+ (chmod 100). Then a CONT signal is sent to<br>
+ .BR runit (8).<br>
+ .SH EXIT CODES<br>
+--- a/runit-2.1.2/man/runit.8<br>
++++ b/runit-2.1.2/man/runit.8<br>
+@@ -45,11 +45,11 @@ done here.<br>
+ If stage 3 returns,<br>
+ .B runit<br>
+ checks if the file<br>
+-.I /etc/runit/reboot<br>
++.I /run/runit.reboot<br>
+ exists and has the execute by owner permission set.<br>
+ If so, the system is rebooted, it&#39;s halted otherwise.<br>
+ If<br>
+-.I /etc/runit/nosync<br>
++.I /run/runit.nosync<br>
+ exists,<br>
+ .B runit<br>
+ doesn&#39;t invoke sync(). This is useful in vservers.<br>
+@@ -70,7 +70,7 @@ only accepts signals in stage 2.<br>
+ If<br>
+ .B runit<br>
+ receives a CONT signal and the file<br>
+-.I /etc/runit/stopit<br>
++.I /run/runit.stopit<br>
+ exists and has the execute by owner permission set,<br>
+ .B runit<br>
+ is told to shutdown the system.<br>
+--- a/runit-2.1.2/src/runit.h<br>
++++ b/runit-2.1.2/src/runit.h<br>
+@@ -1,5 +1,5 @@<br>
+ #define RUNIT &quot;/sbin/runit&quot;<br>
+-#define STOPIT &quot;/etc/runit/stopit&quot;<br>
+-#define REBOOT &quot;/etc/runit/reboot&quot;<br>
++#define STOPIT &quot;/run/runit.stopit&quot;<br>
++#define REBOOT &quot;/run/runit.reboot&quot;<br>
+ #define NOSYNC &quot;/run/runit.nosync&quot;<br>
+ #define CTRLALTDEL &quot;/etc/runit/ctrlaltdel&quot;<br>
diff --git a/meta/recipes-core/runit/runit/0008-emulate-sysv-runlevel-5.patch \
b/meta/recipes-core/runit/runit/0008-emulate-sysv-runlevel-5.patch<br> new file mode \
100644<br> index 0000000000..0d370c8fe7<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/0008-emulate-sysv-runlevel-5.patch<br>
@@ -0,0 +1,20 @@<br>
+Description: Emulalate sysv runlevel 5 by default<br>
+ Currently, not many daemons in Debian provides proper runscripts, so<br>
+ if user switches to runit, she will on next reboot, that none of daemons,<br>
+ including essential, like cron, are started.<br>
+ .<br>
+ This patch starts them in sysv-init style -- unmanaged, in background.<br>
+ It is sub-par solution, but allows one-by-one transition.<br>
+Author: Dmitry Bogatov<br>
+Forwarded: not-needed<br>
+Last-Update: 2016-06-09<br>
+---<br>
+This patch header follows DEP-3: <a href="http://dep.debian.net/deps/dep3/" \
rel="noreferrer" target="_blank">http://dep.debian.net/deps/dep3/</a><br> +--- \
a/runit-2.1.2/etc/debian/1<br> ++++ b/runit-2.1.2/etc/debian/1<br>
+@@ -8,3 +8,5 @@ PATH=/command:/sbin:/bin:/usr/sbin:/usr/<br>
+ <br>
+ touch /run/runit.stopit<br>
+ chmod 0 /run/runit.stopit<br>
++<br>
++[ -e /etc/runit/no-emulate-sysv ] || /etc/init.d/rc 5<br>
diff --git a/meta/recipes-core/runit/runit/0009-fix-error-in-manpage.patch \
b/meta/recipes-core/runit/runit/0009-fix-error-in-manpage.patch<br> new file mode \
100644<br> index 0000000000..5803b0a387<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/0009-fix-error-in-manpage.patch<br>
@@ -0,0 +1,23 @@<br>
+Description: Fix factual error in manpage.<br>
+ Log ./finish script is not actually invoked. It is not clear, whether this<br>
+ limitation is worth lifting.<br>
+Author: Dmitry Bogatov &lt;<a href="mailto:KAction@gnu.org" \
target="_blank">KAction@gnu.org</a>&gt;<br> +Forwarded: no<br>
+Last-Update: 2016-08-31<br>
+---<br>
+This patch header follows DEP-3: <a href="http://dep.debian.net/deps/dep3/" \
rel="noreferrer" target="_blank">http://dep.debian.net/deps/dep3/</a><br> +--- \
a/runit-2.1.2/man/runsv.8<br> ++++ b/runit-2.1.2/man/runsv.8<br>
+@@ -54,10 +54,8 @@ and<br>
+ .IR service /finish&#39;s<br>
+ standard output to the pipe, switches to the directory<br>
+ .IR service /log<br>
+-and starts ./run (and ./finish) exactly as described above for the<br>
+-.I service<br>
+-directory.<br>
+-The standard input of the log service is redirected to read from the pipe.<br>
++and starts ./run script. The standard input of the log service<br>
++is redirected to read from the pipe.<br>
+ .P<br>
+ .B runsv<br>
+ maintains status information in a binary format (compatible to the<br>
diff --git a/meta/recipes-core/runit/runit/clearmem.patch \
b/meta/recipes-core/runit/runit/clearmem.patch<br> new file mode 100644<br>
index 0000000000..3fa28a7006<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/clearmem.patch<br>
@@ -0,0 +1,22 @@<br>
+fix segfault in svlogd discovered on armv7hf-musl.<br>
+<br>
+Code in svlogd.c allocates some memory at startup which is<br>
+not zeroed, and other code was using those garbage values.<br>
+I have no idea why this has never caused a problem before, but<br>
+for me, svlogd consistently segfaults on armv7hf-musl when<br>
+it is called by socklog.<br>
+<br>
+Upstream-Status: Pending<br>
+Author: Christopher Brannon &lt;<a href="mailto:chris@the-brannons.com" \
target="_blank">chris@the-brannons.com</a>&gt;<br> +<br>
+diff -Naur runit-2.1.2/src/svlogd.c runit-2.1.2/src/svlogd.c<br>
+--- runit-2.1.2/src/svlogd.c     2014-08-10 11:22:34.000000000 -0700<br>
++++ runit-2.1.2/src/svlogd.c     2018-03-03 03:28:08.243085845 -0800<br>
+@@ -705,6 +705,7 @@<br>
+     coe(fdwdir);<br>
+     dir =(struct logdir*)alloc(dirn *sizeof(struct logdir));<br>
+     if (! dir) die_nomem();<br>
++   memset(dir, 0, dirn * sizeof(struct logdir));<br>
+     for (i =0; i &lt; dirn; ++i) {<br>
+        dir[i].fddir =-1; dir[i].fdcur =-1;<br>
+        dir[i].btmp =(char*)alloc(buflen *sizeof(char));<br>
diff --git a/meta/recipes-core/runit/runit/cross.patch \
b/meta/recipes-core/runit/runit/cross.patch<br> new file mode 100644<br>
index 0000000000..3a9dcd8afe<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/cross.patch<br>
@@ -0,0 +1,50 @@<br>
+chskshsgr must be built for the host.<br>
+<br>
+Index: runit-2.1.2/src/Makefile<br>
+===================================================================<br>
+--- runit-2.1.2.orig/src/Makefile<br>
++++ runit-2.1.2/src/Makefile<br>
+@@ -170,11 +170,11 @@ byte_diff.o: byte.h byte_diff.c compile<br>
+ byte_rchr.o: byte.h byte_rchr.c compile<br>
+           ./compile byte_rchr.c<br>
+ <br>
+-chkshsgr: chkshsgr.o load<br>
+-         ./load chkshsgr <br>
++chkshsgr: chkshsgr.o loadhost<br>
++         ./loadhost chkshsgr<br>
+ <br>
+-chkshsgr.o: chkshsgr.c compile<br>
+-         ./compile chkshsgr.c<br>
++chkshsgr.o: chkshsgr.c compilehost<br>
++         ./compilehost chkshsgr.c<br>
+ <br>
+ choose: choose.sh warn-auto.sh<br>
+           rm -f choose<br>
+@@ -185,6 +185,11 @@ choose: choose.sh warn-auto.sh<br>
+ coe.o: coe.c coe.h compile<br>
+           ./compile coe.c<br>
+ <br>
++compilehost:<br>
++         cat warn-auto.sh &gt; compilehost<br>
++         @echo &#39;exec ${BUILD_CC} ${BUILD_CFLAGS} -c $${1+&quot;$$@&quot;}&#39; \
&gt;&gt; compilehost<br> ++         chmod 555 compilehost<br>
++<br>
+ compile: conf-cc print-cc.sh systype warn-auto.sh<br>
+           rm -f compile<br>
+           sh print-cc.sh &gt; compile<br>
+@@ -246,6 +251,15 @@ iopause.h: choose compile iopause.h1 iop<br>
+ iopause.o: compile iopause.c iopause.h select.h tai.h taia.h uint64.h<br>
+           ./compile iopause.c<br>
+ <br>
++loadhost:<br>
++         rm -f loadhost<br>
++         @echo &gt; loadhost<br>
++         @echo &#39;systype=&quot;`cat systype`&quot;&#39; &gt;&gt; loadhost<br>
++         @echo &#39;cat warn-auto.sh&#39; &gt;&gt; loadhost<br>
++         @echo &#39;main=&quot;$$1&quot;; shift&#39; &gt;&gt; loadhost<br>
++         @echo &#39;exec ${BUILD_CC} ${BUILD_LDFLAGS}   -o &quot;$$main&quot; \
&quot;$$main&quot;.o $${1+&quot;$$@&quot;}&#39; &gt;&gt; loadhost<br> ++         \
chmod 555 loadhost<br> ++<br>
+ load: conf-ld print-ld.sh systype warn-auto.sh<br>
+           rm -f load<br>
+           sh print-ld.sh &gt; load<br>
diff --git a/meta/recipes-core/runit/runit/patch-disable-chkshgrp-test-that-fails-i.patch \
b/meta/recipes-core/runit/runit/patch-disable-chkshgrp-test-that-fails-i.patch<br> \
new file mode 100644<br> index 0000000000..6753dff4ef<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/patch-disable-chkshgrp-test-that-fails-i.patch<br>
 @@ -0,0 +1,19 @@<br>
+From: Dmitry Bogatov &lt;<a href="mailto:KAction@gnu.org" \
target="_blank">KAction@gnu.org</a>&gt;<br> +Date: Sun, 13 May 2018 10:38:20 \
+0300<br> +X-Dgit-Generated: 2.1.2-14 2c8a08023e964bf54344e7030573ef7ad6881880<br>
+Subject: [PATCH] Disable chkshgrp test, that fails in whalebuilder<br>
+<br>
+Upstream-Status: Pending<br>
+<br>
+---<br>
+<br>
+--- runit-2.1.2.orig/runit-2.1.2/src/Makefile<br>
++++ runit-2.1.2/runit-2.1.2/src/Makefile<br>
+@@ -234,7 +234,6 @@ hassgprm.h: choose compile hassgprm.h1 h<br>
+ <br>
+ hasshsgr.h: chkshsgr choose compile hasshsgr.h1 hasshsgr.h2 load \<br>
+ tryshsgr.c warn-shsgr<br>
+-         ./chkshsgr || ( cat warn-shsgr; exit 1 )<br>
+           ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 &gt; hasshsgr.h<br>
+ <br>
+ haswaitp.h: choose compile haswaitp.h1 haswaitp.h2 load trywaitp.c<br>
diff --git a/meta/recipes-core/runit/runit/patch-fix-spin-lock-on-systems-with-poor.patch \
b/meta/recipes-core/runit/runit/patch-fix-spin-lock-on-systems-with-poor.patch<br> \
new file mode 100644<br> index 0000000000..6f15e92779<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/patch-fix-spin-lock-on-systems-with-poor.patch<br>
 @@ -0,0 +1,20 @@<br>
+From: Dmitry Bogatov &lt;<a href="mailto:KAction@gnu.org" \
target="_blank">KAction@gnu.org</a>&gt;<br> +Date: Mon, 28 May 2018 21:46:39 \
+0300<br> +X-Dgit-Generated: 2.1.2-15 7791b76917a00ca44e3a5c297675214a40f7f215<br>
+Subject: [PATCH] Fix spin lock on systems with poor clock<br>
+<br>
+Upstream-Status: Pending<br>
+<br>
+---<br>
+<br>
+--- runit-2.1.2.orig/runit-2.1.2/src/svlogd.c<br>
++++ runit-2.1.2/runit-2.1.2/src/svlogd.c<br>
+@@ -234,7 +234,7 @@ void rmoldest(struct logdir *ld) {<br>
+              if (unlink(f-&gt;d_name) == -1)<br>
+                 warn2(&quot;unable to unlink processor leftover&quot;, \
f-&gt;d_name);<br> +           }<br>
+-         else {<br>
++         else if (f-&gt;d_name[26] != &#39;u&#39;) {<br>
+              ++n;<br>
+              if (str_diff(f-&gt;d_name, oldest) &lt; 0) byte_copy(oldest, 27, \
f-&gt;d_name);<br> +           }<br>
diff --git a/meta/recipes-core/runit/runit/patch-make-build-system-print-compilatio.patch \
b/meta/recipes-core/runit/runit/patch-make-build-system-print-compilatio.patch<br> \
new file mode 100644<br> index 0000000000..f62dfa36d3<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/patch-make-build-system-print-compilatio.patch<br>
 @@ -0,0 +1,15 @@<br>
+From: Dmitry Bogatov &lt;<a href="mailto:KAction@gnu.org" \
target="_blank">KAction@gnu.org</a>&gt;<br> +Date: Tue, 10 Apr 2018 20:08:14 \
+0300<br> +X-Dgit-Generated: 2.1.2-10 9187ce34534181446afc87277ec0d460e5575f9c<br>
+Subject: [PATCH] Make build system print compilation commands<br>
+<br>
+Upstream-Status: Pending<br>
+<br>
+---<br>
+<br>
+--- runit-2.1.2.orig/runit-2.1.2/src/warn-auto.sh<br>
++++ runit-2.1.2/runit-2.1.2/src/warn-auto.sh<br>
+@@ -1,2 +1,2 @@<br>
+-#!/bin/sh<br>
++#!/bin/sh -x<br>
+ # WARNING: This file was auto-generated. Do not edit!<br>
diff --git a/meta/recipes-core/runit/runit/svlogd.patch \
b/meta/recipes-core/runit/runit/svlogd.patch<br> new file mode 100644<br>
index 0000000000..468fdb2ae4<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/runit/svlogd.patch<br>
@@ -0,0 +1,19 @@<br>
+Initialize all fields of sockaddr_in.<br>
+<a href="http://skarnet.org/cgi-bin/archive.cgi?2:mss:1163:201602:gpiglpbjdemlioaeabbn" \
rel="noreferrer" target="_blank">http://skarnet.org/cgi-bin/archive.cgi?2:mss:1163:201602:gpiglpbjdemlioaeabbn</a><br>
 +<br>
+set all fields of sockaddr_in in svlogd.<br>
+<br>
+Upstream-Status: Submitted<br>
+<br>
+Author: Leah Neukirchen &lt;<a href="mailto:leah@vuxu.org" \
target="_blank">leah@vuxu.org</a>&gt;<br> +<br>
+--- runit-2.1.2/src/svlogd.c 2014-08-10 15:22:34.000000000 -0300<br>
++++ runit-2.1.2/src/svlogd.c 2016-02-04 22:53:52.910965361 -0300<br>
+@@ -430,6 +430,7 @@<br>
+     ld-&gt;name =(char*)fn;<br>
+     ld-&gt;ppid =0;<br>
+     ld-&gt;match =&#39;+&#39;;<br>
++   ld-&gt;udpaddr.sin_family =AF_INET;<br>
+     ld-&gt;udpaddr.sin_port =0;<br>
+     ld-&gt;udponly =0;<br>
+     while (! stralloc_copys(&amp;ld-&gt;prefix, &quot;&quot;)) pause_nomem();<br>
diff --git a/meta/recipes-core/runit/<a href="http://runit_2.1.2.bb" rel="noreferrer" \
target="_blank">runit_2.1.2.bb</a> b/meta/recipes-core/runit/<a \
href="http://runit_2.1.2.bb" rel="noreferrer" target="_blank">runit_2.1.2.bb</a><br> \
new file mode 100644<br> index 0000000000..affb309be1<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/<a href="http://runit_2.1.2.bb" rel="noreferrer" \
target="_blank">runit_2.1.2.bb</a><br> @@ -0,0 +1,68 @@<br>
+# Copyright (C) 2017 Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" \
target="_blank">raj.khem@gmail.com</a>&gt;<br> +# Released under the MIT license (see \
COPYING.MIT for the terms)<br> +<br>
+DESCRIPTION = &quot;A UNIX init scheme with service supervision&quot;<br>
+HOMEPAGE = &quot;<a href="http://smarden.org/runit/" rel="noreferrer" \
target="_blank">http://smarden.org/runit/</a>&quot;<br> +LICENSE = \
&quot;BSD-3-Clause&quot;<br> +SECTION = &quot;base&quot;<br>
+<br>
+LIC_FILES_CHKSUM = &quot;file://package/COPYING;md5=c9e8a560732fc8b860b6a91341cc603b&quot;<br>
 +<br>
+inherit update-alternatives<br>
+<br>
+SRC_URI = &quot;<a href="http://smarden.org/$%7BBPN%7D/$%7BBP%7D.tar.gz" \
rel="noreferrer" target="_blank">http://smarden.org/${BPN}/${BP}.tar.gz</a> \<br> +   \
file://0001-default-directory-for-services-on-Debian-is-etc-servi.diff;striplevel=2 \
\<br> +                 \
file://0002-support-etc-runit-nosync-file-to-make-sync-on-shutdow.diff;striplevel=2 \
\<br> +                 \
file://0003-utmpset.c-mixes-int32_t-and-time_t.diff;striplevel=2 \<br> +              \
file://0004-src-Makefile-don-t-use-static-to-link-runit-runit-ini.diff;striplevel=2 \
\<br> +                 file://0005-patch-etc-runit-2-for-FHS.patch;striplevel=2 \
\<br> +                 \
file://0006-make-buildsystem-respect-CFLAGS.patch;striplevel=2 \<br> +                \
file://0007-move-communication-files.patch;striplevel=2 \<br> +                 \
file://0008-emulate-sysv-runlevel-5.patch;striplevel=2 \<br> +                 \
file://0009-fix-error-in-manpage.patch;striplevel=2 \<br> +                 \
file://patch-make-build-system-print-compilatio.patch;striplevel=2 \<br> +            \
file://patch-disable-chkshgrp-test-that-fails-i.patch;striplevel=2 \<br> +            \
file://patch-fix-spin-lock-on-systems-with-poor.patch;striplevel=2 \<br> +            \
file://cross.patch \<br> +                 file://clearmem.patch \<br>
+                 file://svlogd.patch \<br>
+&quot;<br>
+<br>
+SRC_URI[md5sum] = &quot;6c985fbfe3a34608eb3c53dc719172c4&quot;<br>
+SRC_URI[sha256sum] = \
&quot;6fd0160cb0cf1207de4e66754b6d39750cff14bb0aa66ab49490992c0c47ba18&quot;<br> \
+<br> +S = &quot;${WORKDIR}/admin/${BPN}-${PV}&quot;<br>
+<br>
+do_compile() {<br>
+           cd ${S}/src<br>
+           sed -e &#39;s,sbin/runit,usr/bin/runit,g&#39; -i ${S}/src/runit.h<br>
+           echo &quot;$CC -D_GNU_SOURCE $CFLAGS&quot; &gt;conf-cc<br>
+           echo &quot;$CC $LDFLAGS -Wl,-z -Wl,noexecstack&quot; &gt;conf-ld<br>
+           # change type short to gid_t for getgroups(2) and setgroups(2)<br>
+           sed -i -e &#39;s:short x\[4\];$:gid_t x[4];:&#39; ${S}/src/chkshsgr.c<br>
+           oe_runmake<br>
+<br>
+}<br>
+<br>
+do_install() {<br>
+           cd ${S}/src<br>
+           install -d ${D}${bindir}<br>
+           for f in chpst runit runit-init runsv runsvchdir runsvdir \<br>
+                       sv svlogd utmpset; do<br>
+                       install -m 0755 $f ${D}${bindir}<br>
+           done<br>
+           install -d ${D}${sysconfdir}/runit<br>
+           for f in 1 2 3 ctrlaltdel; do<br>
+                       install -m 0755 ${S}/etc/debian/$f \
${D}${sysconfdir}/runit/$f<br> +           done<br>
+           sed -e &#39;s,rmnologin,rmnologin.sh,g&#39; -i \
${D}${sysconfdir}/runit/1<br> +           ln -s ${localstatedir}/run/runit.stopit \
${D}${sysconfdir}/runit/stopit<br> +            rm -rf \
${D}${sysconfdir}/runit/{1,2,3,stopit,ctrlaltdel}<br> +}<br>
+<br>
+RDEPENDS_${PN} += &quot;runit-serialgetty socklog socklog-services&quot;<br>
+<br>
+ALTERNATIVE_${PN} = &quot;init&quot;<br>
+ALTERNATIVE_TARGET[init] = &quot;${bindir}/runit-init&quot;<br>
+ALTERNATIVE_LINK_NAME[init] = &quot;${base_sbindir}/init&quot;<br>
+ALTERNATIVE_PRIORITY[init] ?= &quot;300&quot;<br>
diff --git a/meta/recipes-core/runit/<a href="http://socklog-services.bb" \
rel="noreferrer" target="_blank">socklog-services.bb</a> b/meta/recipes-core/runit/<a \
href="http://socklog-services.bb" rel="noreferrer" \
target="_blank">socklog-services.bb</a><br> new file mode 100644<br>
index 0000000000..795bf8f390<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/<a href="http://socklog-services.bb" rel="noreferrer" \
target="_blank">socklog-services.bb</a><br> @@ -0,0 +1,23 @@<br>
+# Copyright (C) 2017 Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" \
target="_blank">raj.khem@gmail.com</a>&gt;<br> +# Released under the MIT license (see \
COPYING.MIT for the terms)<br> +<br>
+DESCRIPTION = &quot;Additional socklog configurations from Void Distro&quot;<br>
+HOMEPAGE = &quot;<a href="https://github.com/void-linux/void-socklog" \
rel="noreferrer" target="_blank">https://github.com/void-linux/void-socklog</a>&quot;<br>
 +LICENSE = &quot;PD&quot;<br>
+LIC_FILES_CHKSUM = &quot;file://nanoklogd.c;beginline=3;endline=6;md5=8c10698c7abd64f01ac4245e2b11ab64&quot;<br>
 +SECTION = &quot;base&quot;<br>
+<br>
+PV = &quot;20150726+git${SRCPV}&quot;<br>
+<br>
+SRCREV = &quot;e6b8b91dcd38ebcfbb0d41753d814edf78b06989&quot;<br>
+SRC_URI = &quot;git://<a href="http://github.com/void-linux/socklog-void" \
rel="noreferrer" target="_blank">github.com/void-linux/socklog-void</a> \<br> +       \
file://0001-Use-options-to-cp-to-ensure-proper-mods.patch \<br> +&quot;<br>
+<br>
+S = &quot;${WORKDIR}/git&quot;<br>
+<br>
+EXTRA_OEMAKE = &quot;PREFIX=${exec_prefix}&quot;<br>
+<br>
+do_install() {<br>
+           oe_runmake DESTDIR=${D} install<br>
+}<br>
diff --git a/meta/recipes-core/runit/socklog-services/0001-Use-options-to-cp-to-ensure-proper-mods.patch \
b/meta/recipes-core/runit/socklog-services/0001-Use-options-to-cp-to-ensure-proper-mods.patch<br>
 new file mode 100644<br>
index 0000000000..edd5bae2ef<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/socklog-services/0001-Use-options-to-cp-to-ensure-proper-mods.patch<br>
 @@ -0,0 +1,33 @@<br>
+From b1f46a4d7273ba9b446527dc3f50aa4c318acdd3 Mon Sep 17 00:00:00 2001<br>
+From: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" \
target="_blank">raj.khem@gmail.com</a>&gt;<br> +Date: Fri, 4 Jan 2019 18:15:18 \
-0800<br> +Subject: [PATCH] Use options to cp to ensure proper mods<br>
+<br>
+This ensures that permissions are in line when using staged installed in<br>
+OE e.g.<br>
+<br>
+Upstream-Status: Pending<br>
+<br>
+Signed-off-by: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" \
target="_blank">raj.khem@gmail.com</a>&gt;<br> +---<br>
+ Makefile | 4 ++--<br>
+ 1 file changed, 2 insertions(+), 2 deletions(-)<br>
+<br>
+diff --git a/Makefile b/Makefile<br>
+index 4f96b6e..4889229 100644<br>
+--- a/Makefile<br>
++++ b/Makefile<br>
+@@ -5,8 +5,8 @@ install: all<br>
+           install -Dm755 svlogtail ${DESTDIR}/usr/bin/svlogtail<br>
+           install -Dm755 syslog-stripdate ${DESTDIR}/usr/bin/syslog-stripdate<br>
+           mkdir -p ${DESTDIR}/etc ${DESTDIR}/var/log<br>
+-         cp -a sv ${DESTDIR}/etc<br>
+-         cp -a socklog ${DESTDIR}/var/log<br>
++         cp -R --no-dereference --preserve=mode,links sv ${DESTDIR}/etc<br>
++         cp -R --no-dereference --preserve=mode,links socklog \
${DESTDIR}/var/log<br> + <br>
+ clean:<br>
+           rm -f nanoklogd<br>
+-- <br>
+2.20.1<br>
+<br>
diff --git a/meta/recipes-core/runit/socklog/cross.patch \
b/meta/recipes-core/runit/socklog/cross.patch<br> new file mode 100644<br>
index 0000000000..bc0385f54e<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/socklog/cross.patch<br>
@@ -0,0 +1,58 @@<br>
+chskshsgr must be built for the host. <br>
+<br>
+Original at: <a href="https://github.com/void-linux/void-packages/blob/master/srcpkgs/socklog/patches/cross.patch" \
rel="noreferrer" target="_blank">https://github.com/void-linux/void-packages/blob/master/srcpkgs/socklog/patches/cross.patch</a><br>
 +<br>
+Upstream-Status: Inappropriate [Cross-compile Specific]<br>
+Signed-off-by: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" \
target="_blank">raj.khem@gmail.com</a>&gt;<br> +<br>
+--- a/src/Makefile<br>
++++ b/src/Makefile<br>
+@@ -117,11 +117,11 @@ byte_rchr.o: byte.h byte_rchr.c compile<br>
+ byte_zero.o: byte.h byte_zero.c compile<br>
+           ./compile byte_zero.c<br>
+ <br>
+-chkshsgr: chkshsgr.o load<br>
+-         ./load chkshsgr <br>
++chkshsgr: chkshsgr.o loadhost<br>
++         ./loadhost chkshsgr<br>
+ <br>
+-chkshsgr.o: chkshsgr.c compile<br>
+-         ./compile chkshsgr.c<br>
++chkshsgr.o: chkshsgr.c compilehost<br>
++         ./compilehost chkshsgr.c<br>
+ <br>
+ choose: choose.sh warn-auto.sh<br>
+           rm -f choose<br>
+@@ -137,6 +137,11 @@ compile: conf-cc print-cc.sh systype war<br>
+           sh print-cc.sh &gt; compile<br>
+           chmod 555 compile<br>
+ <br>
++compilehost:<br>
++         cat warn-auto.sh &gt; compilehost<br>
++         @echo &#39;gcc -c $${1+&quot;$$@&quot;}&#39; &gt;&gt; compilehost<br>
++         chmod 555 compilehost<br>
++<br>
+ direntry.h: choose compile direntry.h1 direntry.h2 trydrent.c<br>
+           ./choose c trydrent direntry.h1 direntry.h2 &gt; direntry.h<br>
+ <br>
+@@ -198,6 +203,15 @@ load: conf-ld print-ld.sh systype warn-a<br>
+           sh print-ld.sh &gt; load<br>
+           chmod 555 load<br>
+ <br>
++loadhost:<br>
++         rm -f loadhost<br>
++         @echo &gt; loadhost<br>
++         @echo &#39;systype=&quot;`cat systype`&quot;&#39; &gt;&gt; loadhost<br>
++         @echo &#39;cat warn-auto.sh&#39; &gt;&gt; loadhost<br>
++         @echo &#39;main=&quot;$$1&quot;; shift&#39; &gt;&gt; loadhost<br>
++         @echo &#39;gcc -o &quot;$$main&quot; &quot;$$main&quot;.o \
$${1+&quot;$$@&quot;}&#39; &gt;&gt; loadhost<br> ++         chmod 555 loadhost<br>
++<br>
+ lock_ex.o: compile hasflock.h lock.h lock_ex.c<br>
+           ./compile lock_ex.c<br>
+ <br>
+@@ -410,4 +424,3 @@ wait_nohang.o: compile haswaitp.h wait_n<br>
+ <br>
+ wait_pid.o: compile error.h haswaitp.h wait_pid.c<br>
+           ./compile wait_pid.c<br>
+-<br>
diff --git a/meta/recipes-core/runit/<a href="http://socklog_2.1.0.bb" \
rel="noreferrer" target="_blank">socklog_2.1.0.bb</a> b/meta/recipes-core/runit/<a \
href="http://socklog_2.1.0.bb" rel="noreferrer" \
target="_blank">socklog_2.1.0.bb</a><br> new file mode 100644<br>
index 0000000000..fc3fbd9826<br>
--- /dev/null<br>
+++ b/meta/recipes-core/runit/<a href="http://socklog_2.1.0.bb" rel="noreferrer" \
target="_blank">socklog_2.1.0.bb</a><br> @@ -0,0 +1,32 @@<br>
+# Copyright (C) 2018 Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" \
target="_blank">raj.khem@gmail.com</a>&gt;<br> +# Released under the MIT license (see \
COPYING.MIT for the terms)<br> +<br>
+SUMMARY = &quot;Small and secure syslogd replacement for use with runit&quot;<br>
+HOMEPAGE = &quot;<a href="http://smarden.org/socklog/" rel="noreferrer" \
target="_blank">http://smarden.org/socklog/</a>&quot;<br> +LICENSE = \
&quot;BSD-3-Clause&quot;<br> +SECTION = &quot;base&quot;<br>
+<br>
+LIC_FILES_CHKSUM = &quot;file://package/COPYING;md5=c7a77593c4b489904800014396f3f742&quot;<br>
 +SRC_URI = &quot;<a href="http://smarden.org/$%7BBPN%7D/$%7BBP%7D.tar.gz" \
rel="noreferrer" target="_blank">http://smarden.org/${BPN}/${BP}.tar.gz</a> \<br> +   \
file://cross.patch \<br> +&quot;<br>
+SRC_URI[md5sum] = &quot;5d0e8e28c9329ad3af982c5241df9ff1&quot;<br>
+SRC_URI[sha256sum] = \
&quot;aa869a787ee004da4e5509b5a0031bcc17a4ab4ac650c2ce8d4e488123acb455&quot;<br> \
+<br> +S = &quot;${WORKDIR}/admin/${BPN}-${PV}&quot;<br>
+<br>
+do_compile() {<br>
+           cd ${S}/src<br>
+           echo &quot;$CC -D_GNU_SOURCE $CFLAGS&quot; &gt;conf-cc<br>
+           echo &quot;$CC $LDFLAGS -Wl,-z -Wl,noexecstack&quot; &gt;conf-ld<br>
+           echo &quot;int main() { return 0; }&quot; &gt;${S}/src/chkshsgr.c<br>
+           oe_runmake<br>
+}<br>
+<br>
+do_install() {<br>
+           cd ${S}/src<br>
+           install -d ${D}${bindir}<br>
+           for f in socklog socklog-conf socklog-check uncat tryto; do<br>
+                       install -m 0755 $f ${D}${bindir}<br>
+           done<br>
+}<br>
-- <br>
2.25.0<br>
<br>
-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" \
target="_blank">Openembedded-core@lists.openembedded.org</a><br> <a \
href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" \
rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
 </blockquote></div>



-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic