<div dir="ltr"><div>1. Does this really need to be in core? Who is the target audience and use cases that aren'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 <<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>> 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't reliably do my shsgr test. Please either ``make'' as root<br>
or ``make'' while you'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 <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>><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 = "Yi Zhao <<a href="mailto:yi.zhao@windriver.com" target="_blank">yi.zhao@windriver.com</a>>"<br>
RECIPE_MAINTAINER_pn-rt-tests = "Alexander Kanavin <<a href="mailto:alex.kanavin@gmail.com" target="_blank">alex.kanavin@gmail.com</a>>"<br>
RECIPE_MAINTAINER_pn-ruby = "Ross Burton <<a href="mailto:ross.burton@intel.com" target="_blank">ross.burton@intel.com</a>>"<br>
RECIPE_MAINTAINER_pn-run-postinsts = "Ross Burton <<a href="mailto:ross.burton@intel.com" target="_blank">ross.burton@intel.com</a>>"<br>
+RECIPE_MAINTAINER_pn-runit = "Khem Raj <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>>"<br>
+RECIPE_MAINTAINER_pn-runit-serialgetty = "Khem Raj <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>>"<br>
RECIPE_MAINTAINER_pn-rxvt-unicode = "Armin Kuster <<a href="mailto:akuster808@gmail.com" target="_blank">akuster808@gmail.com</a>>"<br>
RECIPE_MAINTAINER_pn-sato-screenshot = "Ross Burton <<a href="mailto:ross.burton@intel.com" target="_blank">ross.burton@intel.com</a>>"<br>
RECIPE_MAINTAINER_pn-sbc = "Tanu Kaskinen <<a href="mailto:tanuk@iki.fi" target="_blank">tanuk@iki.fi</a>>"<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 += " \<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 <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>><br>
+# Released under the MIT license (see COPYING.MIT for the terms)<br>
+<br>
+DESCRIPTION = "Serial terminal support for runit"<br>
+<br>
+SECTION = "base utils"<br>
+LICENSE = "MIT"<br>
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"<br>
+<br>
+INHIBIT_DEFAULT_DEPS = "1"<br>
+<br>
+SRC_URI = "\<br>
+ file://run \<br>
+ file://finish \<br>
+"<br>
+<br>
+S = "${WORKDIR}"<br>
+<br>
+SERIAL_CONSOLES ??= "115200;ttyS0"<br>
+<br>
+do_install() {<br>
+ install -d ${D}${sysconfdir}/service ${D}${sysconfdir}/runit/runsvdir/default<br>
+ tmp="${SERIAL_CONSOLES}"<br>
+ for i in $tmp<br>
+ do<br>
+ baudrate=`echo $i | sed 's/\;.*//'`<br>
+ ttydev=`echo $i | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`<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 = "${MACHINE_ARCH}"<br>
+<br>
+FILES_${PN} = "${sysconfdir}"<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 <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>><br>
+# Released under the MIT license (see COPYING.MIT for the terms)<br>
+<br>
+DESCRIPTION = "Additional runit scripts for OE based systems"<br>
+HOMEPAGE = "<a href="https://github.com/YoeDistro/oe-runit" rel="noreferrer" target="_blank">https://github.com/YoeDistro/oe-runit</a>"<br>
+LICENSE = "PD"<br>
+LIC_FILES_CHKSUM = "file://README.md;beginline=41;endline=48;md5=f2f8535b84b11359cc7757b009cfd646"<br>
+SECTION = "base"<br>
+<br>
+PV = "20180623+git${SRCPV}"<br>
+<br>
+SRCREV = "8d5db5c26670e49524f33800aaf0337466495c84"<br>
+SRC_URI = "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>
+"<br>
+<br>
+S = "${WORKDIR}/git"<br>
+<br>
+EXTRA_OEMAKE = "PREFIX=${exec_prefix}"<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} = "runit findutils util-linux-fsck coreutils"<br>
+<br>
+PACKAGES =+ "${PN}-dracut"<br>
+<br>
+FILES_${PN}-dracut = "${nonarch_libdir}/dracut"<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 <<a href="mailto:pape@smarden.org" target="_blank">pape@smarden.org</a>><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 >/service/socklog-unix/supervise/control<br>
++ # printf t >/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't start with a dot or slash and doesn'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 ="/service/";<br>
++char *varservice ="/etc/service/";<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 <<a href="mailto:korn-debbugs@elan.rulez.org" target="_blank">korn-debbugs@elan.rulez.org</a>><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 <i>/e<br>
+ and possibly halt or reboot the system are done here. If stage 3 returns,<br>
+ <b>runit</b> checks if the file <i>/etc/runit/reboot</i> exists and has the execute by<br>
+ owner permission set. If so, the system is rebooted, it&rsquo;s halted otherwise.<br>
++If <i>/etc/runit/nosync</i> exists, <b>runit</b> doesn&rsquo;t invoke<br>
++sync(). This is useful in vservers.<br>
+ <br>
+ <h2><a name='sect6'>Ctrl-alt-del</a></h2><br>
+ If <b>runit</b> 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's halted otherwise.<br>
++If<br>
++.I /etc/runit/nosync<br>
++exists,<br>
++.B runit<br>
++doesn'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], "", 1); }<br>
+ <br>
++void sync_if_needed() {<br>
++ struct stat s;<br>
++ if (stat(NOSYNC, &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, &s) != -1) && (s.st_mode & S_IXUSR)) {<br>
+ strerr_warn2(INFO, "system reboot.", 0);<br>
+- sync();<br>
++ sync_if_needed();<br>
+ reboot_system(RB_AUTOBOOT);<br>
+ }<br>
+ else {<br>
+ #ifdef RB_POWER_OFF<br>
+ strerr_warn2(INFO, "power off...", 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, "system halt.", 0);<br>
+- sync();<br>
++ sync_if_needed();<br>
+ reboot_system(RB_HALT_SYSTEM);<br>
+ #else<br>
+ #ifdef RB_HALT<br>
+ strerr_warn2(INFO, "system halt.", 0);<br>
+- sync();<br>
++ sync_if_needed();<br>
+ reboot_system(RB_HALT);<br>
+ #else<br>
+ strerr_warn2(INFO, "system reboot.", 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 "/sbin/runit"<br>
+ #define STOPIT "/etc/runit/stopit"<br>
+ #define REBOOT "/etc/runit/reboot"<br>
++#define NOSYNC "/run/runit.nosync"<br>
+ #define CTRLALTDEL "/etc/runit/ctrlaltdel"<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 <<a href="mailto:pape@smarden.org" target="_blank">pape@smarden.org</a>><br>
+Date: Thu, 31 Jul 2014 12:25:49 +0000<br>
+Subject: [PATCH] utmpset.c: mixes "int32_t *" and "time_t *"<br>
+<br>
+Don'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, "usage: ", progname, USAGE, "\n"); }<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)) < 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(&ut.ut_time) == -1) break;<br>
++ if (time(&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, "unable to open ", UW_TMP_WFILE, ": ");<br>
+@@ -65,10 +68,11 @@ int wtmp_logout(const char *line) {<br>
+ memset(&ut, 0, sizeof(uw_tmp));<br>
+ if ((len =str_len(line)) > sizeof ut.ut_line) len =sizeof ut.ut_line -2;<br>
+ byte_copy(ut.ut_line, len, line);<br>
+- if (time(&ut.ut_time) == -1) {<br>
++ if (time(&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 <<a href="mailto:pape@smarden.org" target="_blank">pape@smarden.org</a>><br>
+Date: Thu, 31 Jul 2014 12:54:32 +0000<br>
+Subject: [PATCH] src/Makefile: don'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 <<a href="mailto:KAction@gnu.org" target="_blank">KAction@gnu.org</a>><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 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'<br>
++runsvdir -P /etc/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'<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 <<a href="mailto:KAction@gnu.org" target="_blank">KAction@gnu.org</a>><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="`head -n1 conf-cc`"<br>
+ systype="`cat systype`"<br>
+ <br>
+ cat warn-auto.sh<br>
+-echo exec "$cc" '-c ${1+"$@"}'<br>
++echo exec "$cc" "$CPPFLAGS" "$CFLAGS" '-c ${1+"$@"}'<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="`cat systype`"<br>
+ <br>
+ cat warn-auto.sh<br>
+ echo 'main="$1"; shift'<br>
+-echo exec "$ld" '-o "$main" "$main".o ${1+"$@"}'<br>
++echo exec "$ld" "$LDFLAGS" '-o "$main" "$main".o ${1+"$@"}'<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 <<a href="mailto:KAction@gnu.org" target="_blank">KAction@gnu.org</a>><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>&1<br>
+ PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin<br>
+ <br>
+ LAST=0<br>
+-test -x /etc/runit/reboot && LAST=6<br>
++test -x /run/runit.reboot && LAST=6<br>
+ <br>
+ echo 'Waiting for services to stop...'<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="System is going down in 14 seconds..."<br>
+ <br>
+ # echo 'disabled.' ; exit<br>
+-touch /etc/runit/stopit<br>
+-chmod 100 /etc/runit/stopit && echo "$MSG" | wall<br>
++touch /etc/runit.stopit<br>
++chmod 100 /etc/runit.stopit && echo "$MSG" | 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's halted otherwise.<br>
+ If<br>
+-.I /etc/runit/nosync<br>
++.I /run/runit.nosync<br>
+ exists,<br>
+ .B runit<br>
+ doesn'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 "/sbin/runit"<br>
+-#define STOPIT "/etc/runit/stopit"<br>
+-#define REBOOT "/etc/runit/reboot"<br>
++#define STOPIT "/run/runit.stopit"<br>
++#define REBOOT "/run/runit.reboot"<br>
+ #define NOSYNC "/run/runit.nosync"<br>
+ #define CTRLALTDEL "/etc/runit/ctrlaltdel"<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 <<a href="mailto:KAction@gnu.org" target="_blank">KAction@gnu.org</a>><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'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 <<a href="mailto:chris@the-brannons.com" target="_blank">chris@the-brannons.com</a>><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 < 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 > compilehost<br>
++ @echo 'exec ${BUILD_CC} ${BUILD_CFLAGS} -c $${1+"$$@"}' >> 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 > 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 > loadhost<br>
++ @echo 'systype="`cat systype`"' >> loadhost<br>
++ @echo 'cat warn-auto.sh' >> loadhost<br>
++ @echo 'main="$$1"; shift' >> loadhost<br>
++ @echo 'exec ${BUILD_CC} ${BUILD_LDFLAGS} -o "$$main" "$$main".o $${1+"$$@"}' >> 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 > 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 <<a href="mailto:KAction@gnu.org" target="_blank">KAction@gnu.org</a>><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 > 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 <<a href="mailto:KAction@gnu.org" target="_blank">KAction@gnu.org</a>><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->d_name) == -1)<br>
+ warn2("unable to unlink processor leftover", f->d_name);<br>
+ }<br>
+- else {<br>
++ else if (f->d_name[26] != 'u') {<br>
+ ++n;<br>
+ if (str_diff(f->d_name, oldest) < 0) byte_copy(oldest, 27, f->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 <<a href="mailto:KAction@gnu.org" target="_blank">KAction@gnu.org</a>><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 <<a href="mailto:leah@vuxu.org" target="_blank">leah@vuxu.org</a>><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->name =(char*)fn;<br>
+ ld->ppid =0;<br>
+ ld->match ='+';<br>
++ ld->udpaddr.sin_family =AF_INET;<br>
+ ld->udpaddr.sin_port =0;<br>
+ ld->udponly =0;<br>
+ while (! stralloc_copys(&ld->prefix, "")) 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 <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>><br>
+# Released under the MIT license (see COPYING.MIT for the terms)<br>
+<br>
+DESCRIPTION = "A UNIX init scheme with service supervision"<br>
+HOMEPAGE = "<a href="http://smarden.org/runit/" rel="noreferrer" target="_blank">http://smarden.org/runit/</a>"<br>
+LICENSE = "BSD-3-Clause"<br>
+SECTION = "base"<br>
+<br>
+LIC_FILES_CHKSUM = "file://package/COPYING;md5=c9e8a560732fc8b860b6a91341cc603b"<br>
+<br>
+inherit update-alternatives<br>
+<br>
+SRC_URI = "<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>
+"<br>
+<br>
+SRC_URI[md5sum] = "6c985fbfe3a34608eb3c53dc719172c4"<br>
+SRC_URI[sha256sum] = "6fd0160cb0cf1207de4e66754b6d39750cff14bb0aa66ab49490992c0c47ba18"<br>
+<br>
+S = "${WORKDIR}/admin/${BPN}-${PV}"<br>
+<br>
+do_compile() {<br>
+ cd ${S}/src<br>
+ sed -e 's,sbin/runit,usr/bin/runit,g' -i ${S}/src/runit.h<br>
+ echo "$CC -D_GNU_SOURCE $CFLAGS" >conf-cc<br>
+ echo "$CC $LDFLAGS -Wl,-z -Wl,noexecstack" >conf-ld<br>
+ # change type short to gid_t for getgroups(2) and setgroups(2)<br>
+ sed -i -e 's:short x\[4\];$:gid_t x[4];:' ${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 's,rmnologin,rmnologin.sh,g' -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} += "runit-serialgetty socklog socklog-services"<br>
+<br>
+ALTERNATIVE_${PN} = "init"<br>
+ALTERNATIVE_TARGET[init] = "${bindir}/runit-init"<br>
+ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"<br>
+ALTERNATIVE_PRIORITY[init] ?= "300"<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 <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>><br>
+# Released under the MIT license (see COPYING.MIT for the terms)<br>
+<br>
+DESCRIPTION = "Additional socklog configurations from Void Distro"<br>
+HOMEPAGE = "<a href="https://github.com/void-linux/void-socklog" rel="noreferrer" target="_blank">https://github.com/void-linux/void-socklog</a>"<br>
+LICENSE = "PD"<br>
+LIC_FILES_CHKSUM = "file://nanoklogd.c;beginline=3;endline=6;md5=8c10698c7abd64f01ac4245e2b11ab64"<br>
+SECTION = "base"<br>
+<br>
+PV = "20150726+git${SRCPV}"<br>
+<br>
+SRCREV = "e6b8b91dcd38ebcfbb0d41753d814edf78b06989"<br>
+SRC_URI = "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>
+"<br>
+<br>
+S = "${WORKDIR}/git"<br>
+<br>
+EXTRA_OEMAKE = "PREFIX=${exec_prefix}"<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 <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>><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 <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>><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 <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>><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 > compile<br>
+ chmod 555 compile<br>
+ <br>
++compilehost:<br>
++ cat warn-auto.sh > compilehost<br>
++ @echo 'gcc -c $${1+"$$@"}' >> 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 > direntry.h<br>
+ <br>
+@@ -198,6 +203,15 @@ load: conf-ld print-ld.sh systype warn-a<br>
+ sh print-ld.sh > load<br>
+ chmod 555 load<br>
+ <br>
++loadhost:<br>
++ rm -f loadhost<br>
++ @echo > loadhost<br>
++ @echo 'systype="`cat systype`"' >> loadhost<br>
++ @echo 'cat warn-auto.sh' >> loadhost<br>
++ @echo 'main="$$1"; shift' >> loadhost<br>
++ @echo 'gcc -o "$$main" "$$main".o $${1+"$$@"}' >> 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 <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>><br>
+# Released under the MIT license (see COPYING.MIT for the terms)<br>
+<br>
+SUMMARY = "Small and secure syslogd replacement for use with runit"<br>
+HOMEPAGE = "<a href="http://smarden.org/socklog/" rel="noreferrer" target="_blank">http://smarden.org/socklog/</a>"<br>
+LICENSE = "BSD-3-Clause"<br>
+SECTION = "base"<br>
+<br>
+LIC_FILES_CHKSUM = "file://package/COPYING;md5=c7a77593c4b489904800014396f3f742"<br>
+SRC_URI = "<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>
+"<br>
+SRC_URI[md5sum] = "5d0e8e28c9329ad3af982c5241df9ff1"<br>
+SRC_URI[sha256sum] = "aa869a787ee004da4e5509b5a0031bcc17a4ab4ac650c2ce8d4e488123acb455"<br>
+<br>
+S = "${WORKDIR}/admin/${BPN}-${PV}"<br>
+<br>
+do_compile() {<br>
+ cd ${S}/src<br>
+ echo "$CC -D_GNU_SOURCE $CFLAGS" >conf-cc<br>
+ echo "$CC $LDFLAGS -Wl,-z -Wl,noexecstack" >conf-ld<br>
+ echo "int main() { return 0; }" >${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>