added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
SUMMARY = "The sd-bus library, extracted from systemd."
HOMEPAGE = "https://sr.ht/~emersion/basu"
SECTION = "base"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
SRC_URI = "git://git.sr.ht/~emersion/basu;protocol=https;branch=master"
DEPENDS += "gperf-native"
S = "${WORKDIR}/git"
PV = "0.2.1"
SRCREV = "684a41d68cfbb05e38aacb60a8548e21ddfbecdb"
inherit meson pkgconfig
PACKAGECONFIG ?= ""
PACKAGECONFIG[libcap] = "-Dlibcap=enabled,-Dlibcap=disabled,libcap"
PACKAGECONFIG[audit] = "-Daudit=enabled,-Daudit=disabled,audit"
EXTRA_OEMESON += "--buildtype release"

View File

@@ -0,0 +1,26 @@
SUMMARY = "D-Bus wrapper in C++ for dbus"
HOMEPAGE = "https://dbus-cxx.github.io/"
BUGTRACKER = "https://github.com/libsigcplusplus/libsigcplusplus/issues"
SECTION = "base"
LICENSE = "LGPL-3.0-or-later | BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=24594f493407a4cd401ce9794e0b9308"
SRC_URI = "git://github.com/dbus-cxx/dbus-cxx.git;branch=master;protocol=https \
file://0001-Include-missing-cstdint.patch"
SRCREV = "898f6ea8f7ffe454e81a9337002df555728d4199"
DEPENDS = "\
dbus \
libsigc++-3 \
"
RDEPENDS:${PN} = "\
dbus \
libsigc++-3 \
"
S = "${WORKDIR}/git"
inherit pkgconfig cmake
OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"

View File

@@ -0,0 +1,30 @@
From 56e2cce87445d514c9992ecc19d03bb2115c82d6 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 25 Jan 2023 22:17:31 -0800
Subject: [PATCH] Include missing <cstdint>
gcc 13 moved some includes around and as a result <cstdint> is no longer transitively included [1]. Explicitly include it for uint{32,64}_t.
[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
Upstream-Status: Submitted [https://github.com/dbus-cxx/dbus-cxx/pull/111]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
dbus-cxx/enums.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/dbus-cxx/enums.h b/dbus-cxx/enums.h
index 8253a4b..c793fad 100644
--- a/dbus-cxx/enums.h
+++ b/dbus-cxx/enums.h
@@ -5,6 +5,7 @@
* *
* This file is part of the dbus-cxx library. *
***************************************************************************/
+#include <cstdint>
#include <ostream>
#ifndef DBUSCXX_ENUMS_H
--
2.39.1

View File

@@ -0,0 +1,32 @@
SUMMARY = "dbus broker"
DESCRIPTION = "Drop-in replacement for dbus-daemon."
SECTION = "base"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7b486c2338d225a1405d979ed2c15ce8"
SRC_URI = "https://github.com/bus1/dbus-broker/releases/download/v${PV}/dbus-broker-${PV}.tar.xz"
SRC_URI[sha256sum] = "bea7f653e7251063c5f427e9e3f93562d38a0d8667ae6d49fb56f113605985de"
UPSTREAM_CHECK_URI = "https://github.com/bus1/${BPN}/releases"
inherit meson pkgconfig systemd features_check
DEPENDS = "expat systemd"
DEPENDS += " ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'libselinux (>= 3.2)', '', d)}"
DEPENDS += " ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'audit (>= 3.0)', '', d)}"
RDEPENDS:${PN} += "dbus-common"
REQUIRED_DISTRO_FEATURES = "systemd"
SYSTEMD_SERVICE:${PN} = "${BPN}.service"
FILES:${PN} += "${systemd_system_unitdir}"
FILES:${PN} += "${systemd_user_unitdir}"
FILES:${PN} += "${nonarch_libdir}/systemd/catalog"
EXTRA_OEMESON += " -Dselinux=${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'true', 'false', d)}"
EXTRA_OEMESON += " -Daudit=${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'true', 'false', d)}"

View File

@@ -0,0 +1,30 @@
From 8e6d1f590b1cb437dc67c51298ef1722a7266d35 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 25 Jul 2017 18:37:58 -0700
Subject: [PATCH] dbus-daemon-proxy: Return DBUS_HANDLER_RESULT_NOT_YET_HANDLED
from master_filter_cb() if DBusConnection is null
So it can be passed on to other handlers since this could
not be handled here
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
dbus-daemon-proxy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dbus-daemon-proxy.c b/dbus-daemon-proxy.c
index 009e4fd..f3f0d80 100644
--- a/dbus-daemon-proxy.c
+++ b/dbus-daemon-proxy.c
@@ -115,7 +115,7 @@ master_filter_cb (DBusConnection *conn,
guint32 serial;
if (!dbus_conn)
- return;
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
if (verbose)
g_print ("New message from server: type='%d' path='%s' iface='%s'"
--
2.13.3

View File

@@ -0,0 +1,23 @@
SUMMARY = "dbus forwarding daemon"
LICENSE = "LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://dbus-daemon-proxy.c;endline=19;md5=41df6d21fe1c97d6a1cc22a5bf374cba"
DEPENDS = "dbus dbus-glib"
SRCREV = "1226a0a1374628ff191f6d8a56000be5e53e7608"
PV = "0.0.0+gitr${SRCPV}"
PR = "r1.59"
SRC_URI = "git://github.com/alban/dbus-daemon-proxy;branch=master;protocol=https \
file://0001-dbus-daemon-proxy-Return-DBUS_HANDLER_RESULT_NOT_YET.patch \
"
S = "${WORKDIR}/git"
inherit pkgconfig
do_compile() {
${CC} ${CFLAGS} -o dbus-daemon-proxy dbus-daemon-proxy.c `pkg-config --cflags --libs dbus-glib-1` ${LDFLAGS}
}
do_install() {
install -d ${D}${bindir}
install -m 0755 dbus-daemon-proxy ${D}${bindir}
}

View File

@@ -0,0 +1,27 @@
From 6bcb58bd69c38b9200e8ec6c382247167571189d Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 1 Jul 2017 16:44:15 -0700
Subject: [PATCH] pipe.c: Use a string instead of char
Fixes
error: invalid conversion from 'char' to 'const void*' [-fpermissive]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/pipe.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pipe.cpp b/src/pipe.cpp
index 45c2ba6..1303c2d 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -83,5 +83,5 @@ ssize_t Pipe::read(void *buffer, unsigned int &nbytes)
void Pipe::signal()
{
// TODO: ignoring return of read/write generates warning; maybe relevant for eventloop work...
- ::write(_fd_write, '\0', 1);
+ ::write(_fd_write, "", 1);
}
--
2.13.2

View File

@@ -0,0 +1,36 @@
From 93fd4868d71aa7a26cdfd382d1e4c85112f069f9 Mon Sep 17 00:00:00 2001
From: Peter Williams <peter@newton.cx>
Date: Sat, 19 Dec 2015 21:07:37 -0500
Subject: [PATCH] src/eventloop.cpp: use portable method for initializing
recursive mutex
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Upstream-Status: Backport [https://github.com/andreas-volz/dbus-cplusplus/commit/cdaeaa825db191bd65aad3aaaeb3178738727f05]
Signed-off-by: André Draszik <adraszik@tycoint.com>
src/eventloop.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/eventloop.cpp b/src/eventloop.cpp
index 7fb06a3..f622812 100644
--- a/src/eventloop.cpp
+++ b/src/eventloop.cpp
@@ -85,8 +85,11 @@ DefaultMutex::DefaultMutex(bool recursive)
{
if (recursive)
{
- pthread_mutex_t recmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
- _mutex = recmutex;
+ pthread_mutexattr_t attr;
+
+ pthread_mutexattr_init(&attr);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ pthread_mutex_init(&_mutex, &attr);
}
else
{
--
2.10.2

View File

@@ -0,0 +1,58 @@
From c673a76857cbe0ca82fa11aea9b70f94c3e5b041 Mon Sep 17 00:00:00 2001
From: Peter Williams <peter@newton.cx>
Date: Sat, 19 Dec 2015 21:08:46 -0500
Subject: [PATCH] tools/generate_proxy.cpp: avoid possibly undefined 'uint'
type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Upstream-Status: Backport [https://github.com/andreas-volz/dbus-cplusplus/commit/43f119a2b3fe951c0f1d88cc61170d4c81a88880]
Signed-off-by: André Draszik <adraszik@tycoint.com>
tools/generate_proxy.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/generate_proxy.cpp b/tools/generate_proxy.cpp
index bf1094a..ebb75fa 100644
--- a/tools/generate_proxy.cpp
+++ b/tools/generate_proxy.cpp
@@ -352,7 +352,7 @@ void generate_proxy(Xml::Document &doc, const char *filename)
if (!arg_name.length())
{
arg_name = "argin";
- arg_name += toString <uint> (i);
+ arg_name += toString <unsigned int> (i);
}
// generate extra code to wrap object
@@ -445,7 +445,7 @@ void generate_proxy(Xml::Document &doc, const char *filename)
if (!arg_name.length())
{
- arg_name = "argout" + toString <uint> (i);
+ arg_name = "argout" + toString <unsigned int> (i);
}
if (arg_object.length())
@@ -569,7 +569,7 @@ void generate_proxy(Xml::Document &doc, const char *filename)
// use a default if no arg name given
if (!arg_name.length())
{
- arg_name = "arg" + toString <uint> (i);
+ arg_name = "arg" + toString <unsigned int> (i);
}
body << arg_name << ";" << endl;
@@ -605,7 +605,7 @@ void generate_proxy(Xml::Document &doc, const char *filename)
if (!arg_name.length())
{
- arg_name = "arg" + toString <uint> (j);
+ arg_name = "arg" + toString <unsigned int> (j);
}
if (arg_object.length())
--
2.10.2

View File

@@ -0,0 +1,30 @@
From 465d98dbcdcb72375c198010a50b80b953e7d5a6 Mon Sep 17 00:00:00 2001
From: Yuri <yuri@tsoft.com>
Date: Sat, 28 May 2016 13:20:10 -0700
Subject: [PATCH] Fixed undefined ssize_t for clang-3.8.0 on FreeBSD.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Upstream-Status: Backport [https://github.com/andreas-volz/dbus-cplusplus/commit/463f5a4400d494b831c3b3348c0a21f0faf14f39]
Signed-off-by: André Draszik <adraszik@tycoint.com>
include/dbus-c++/pipe.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/dbus-c++/pipe.h b/include/dbus-c++/pipe.h
index 999f042..682646c 100644
--- a/include/dbus-c++/pipe.h
+++ b/include/dbus-c++/pipe.h
@@ -30,6 +30,8 @@
/* STD */
#include <cstdlib>
+#include <sys/types.h>
+
namespace DBus
{
--
2.10.2

View File

@@ -0,0 +1,74 @@
From 12de53b0f24c478ea4ff6b4e2c55366dbd2f02b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
Date: Fri, 25 Nov 2016 09:33:20 +0000
Subject: [PATCH] use POSIX poll.h instead of sys/poll.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
POSIX specifies that <poll.h> is the correct header to
include for poll()
http://pubs.opengroup.org/onlinepubs/009695399/functions/poll.html
whereas <sys/poll.h> is only needed for ancient glibc (<2.3),
so let's follow POSIX instead.
As a side-effect, this silences compilation warnings when
compiling against the musl C-library such as:
| In file included from ../../libdbus-c++-0.9.0/src/eventloop.cpp:31:0:
| <sysroot>/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
| #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
| ^~~~~~~
| In file included from ../../libdbus-c++-0.9.0/src/eventloop-integration.cpp:39:0:
| <sysroot>/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
| #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
| ^~~~~~~
Signed-off-by: André Draszik <git@andred.net>
---
Upstream-Status: Submitted [https://github.com/andreas-volz/dbus-cplusplus/pull/3]
Signed-off-by: André Draszik <adraszik@tycoint.com>
src/eventloop-integration.cpp | 2 +-
src/eventloop.cpp | 2 +-
src/pipe.cpp | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
Index: libdbus-c++-0.9.0/src/eventloop-integration.cpp
===================================================================
--- libdbus-c++-0.9.0.orig/src/eventloop-integration.cpp
+++ libdbus-c++-0.9.0/src/eventloop-integration.cpp
@@ -36,7 +36,7 @@
/* STD */
#include <string.h>
#include <cassert>
-#include <sys/poll.h>
+#include <poll.h>
#include <fcntl.h>
using namespace DBus;
Index: libdbus-c++-0.9.0/src/eventloop.cpp
===================================================================
--- libdbus-c++-0.9.0.orig/src/eventloop.cpp
+++ libdbus-c++-0.9.0/src/eventloop.cpp
@@ -28,7 +28,7 @@
#include <dbus-c++/eventloop.h>
#include <dbus-c++/debug.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/time.h>
#include <dbus/dbus.h>
Index: libdbus-c++-0.9.0/src/pipe.cpp
===================================================================
--- libdbus-c++-0.9.0.orig/src/pipe.cpp
+++ libdbus-c++-0.9.0/src/pipe.cpp
@@ -32,7 +32,7 @@
/* STD */
#include <unistd.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <fcntl.h>
#include <errno.h>
#include <cassert>

View File

@@ -0,0 +1,38 @@
sniped from ChromiumOS
https://bugs.gentoo.org/424707
From 154f7861d19a2bd5c79c488f9989610971db451b Mon Sep 17 00:00:00 2001
From: Han Shen <shenhan@google.com>
Date: Thu, 31 May 2012 16:49:35 -0700
Subject: [PATCH] Fixed dbus-c++ gcc 4.7 building problem.
Just add "unistd.h" inclusion to eventloop-integration.h.
BUG=None
TEST=Manually built using gcc 4.7.
Change-Id: I87bd1f90db6a4c974a5ed8134044e8be2034aff2
Reviewed-on: https://gerrit.chromium.org/gerrit/24260
Tested-by: Han Shen <shenhan@google.com>
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
Commit-Ready: Han Shen <shenhan@chromium.org>
Upstream-Status: Inappropriate [ not author, no upstream ]
Signed-off-by: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
---
include/dbus-c++/eventloop-integration.h | 1 +
1 file changed, 1 insertion(+)
Index: libdbus-c++-0.9.0/include/dbus-c++/eventloop-integration.h
===================================================================
--- libdbus-c++-0.9.0.orig/include/dbus-c++/eventloop-integration.h
+++ libdbus-c++-0.9.0/include/dbus-c++/eventloop-integration.h
@@ -26,6 +26,7 @@
#define __DBUSXX_EVENTLOOP_INTEGRATION_H
#include <errno.h>
+#include <unistd.h>
#include "api.h"
#include "dispatcher.h"
#include "util.h"

View File

@@ -0,0 +1,33 @@
From: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
Date: Fri, 18 Nov 2016 10:23:07 +0100
Subject: Build libdbus-c++ tools for target platform rather than enforced for
host platform.
Upstream-Status: Inappropriate [no upstream]
Signed-off-by: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
---
diff -Naur libdbus-c++-0.9.0.ori/configure.ac libdbus-c++-0.9.0/configure.ac
--- libdbus-c++-0.9.0.ori/configure.ac 2016-11-15 14:25:36.085882774 +0100
+++ libdbus-c++-0.9.0/configure.ac 2016-11-15 14:27:08.814568717 +0100
@@ -64,9 +64,6 @@
AC_PROG_CC
AC_PROG_CXX
-CXX_FOR_BUILD=${CXX_FOR_BUILD-${CXX}}
-AC_SUBST(CXX_FOR_BUILD)
-
AM_PROG_LIBTOOL
PKG_PROG_PKG_CONFIG
diff -Naur libdbus-c++-0.9.0.ori/tools/Makefile.am libdbus-c++-0.9.0/tools/Makefile.am
--- libdbus-c++-0.9.0.ori/tools/Makefile.am 2016-11-15 14:25:36.089882803 +0100
+++ libdbus-c++-0.9.0/tools/Makefile.am 2016-11-15 14:26:19.454203583 +0100
@@ -1,7 +1,5 @@
# hacky, but ...
-CXX = $(CXX_FOR_BUILD)
-
AM_CPPFLAGS = \
$(dbus_CFLAGS) \
$(xml_CFLAGS) \

View File

@@ -0,0 +1,30 @@
SUMMARY = "DBus-C++ Library"
DESCRIPTION = "DBus-c++ attempts to provide a C++ API for D-BUS. The library has a glib and an Ecore mainloop integration. It also offers an optional own main loop."
HOMEPAGE = "http://dbus-cplusplus.sourceforge.net"
SECTION = "base"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
DEPENDS = "dbus expat glib-2.0 libpcre"
SRC_URI = "${SOURCEFORGE_MIRROR}/project/dbus-cplusplus/dbus-c++/${PV}/${BP}.tar.gz \
file://fix-missing-unistd.h-include.patch \
file://remove-CXX_FOR_BUILD-stuff.patch \
file://0001-src-eventloop.cpp-use-portable-method-for-initializi.patch \
file://0002-tools-generate_proxy.cpp-avoid-possibly-undefined-ui.patch \
file://0003-Fixed-undefined-ssize_t-for-clang-3.8.0-on-FreeBSD.patch \
file://0004-use-POSIX-poll.h-instead-of-sys-poll.h.patch \
file://0001-pipe.c-Use-a-string-instead-of-char.patch \
"
SRC_URI[md5sum] = "e752116f523fa88ef041e63d3dee4de2"
SRC_URI[sha256sum] = "bc11ac297b3cb010be904c72789695543ee3fdf3d75cdc8225fd371385af4e61"
inherit autotools pkgconfig
EXTRA_OECONF = "--disable-ecore --disable-examples --disable-tests"
LDFLAGS += "-pthread"
PACKAGE_BEFORE_PN = "${PN}-tools"
FILES:${PN}-tools = "${bindir}"
BBCLASSEXTEND = "native"

View File

@@ -0,0 +1,13 @@
DESCRIPTION = "emlog is a Linux kernel module that makes it easy to access the \
most recent (and only the most recent) output from a process"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
SRC_URI = "git://github.com/nicupavel/emlog.git;protocol=https;branch=master"
SRCREV = "aee53e8dee862f35291242ba41b0ca88010f6c71"
S = "${WORKDIR}/git"
EXTRA_OEMAKE += " \
CFLAGS='${TARGET_CFLAGS}' \
"

View File

@@ -0,0 +1,33 @@
From fd0a4ee201b5c7b24da79dcd346ac121978951a0 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 29 Mar 2020 19:58:36 -0700
Subject: [PATCH] Remove modules_clean from clean target
This is needed when building applications (w/o module)
Since OE will run 'make clean' before reconfiguring, this
will try to run module_clean and will wrongly try to look for removing
modules from /lib/modules
Upstream-Status: Inappropriate [ OE-Specific ]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index c60863f..fc897d5 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ all: modules nbcat mkemlog
install: modules_install nbcat_install mkemlog_install
-clean: modules_clean nbcat_clean mkemlog_clean
+clean: nbcat_clean mkemlog_clean
modules:
$(MAKE) -C $(KDIR) M=$(CURDIR) modules
--
2.26.0

View File

@@ -0,0 +1,113 @@
From 41de28a92297f4cb0c5a8d7356cde9190176947b Mon Sep 17 00:00:00 2001
From: Fabio Berton <fabio.berton@ossystems.com.br>
Date: Thu, 14 Mar 2019 19:54:27 -0300
Subject: [PATCH] Drop use of error.h
Organization: O.S. Systems Software LTDA.
The error.h does not work with musl and this project being embedded
friendly it makes sense to avoid glibc-specific code.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
---
mkemlog.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/mkemlog.c b/mkemlog.c
index e3354ed..7bcdfce 100644
--- a/mkemlog.c
+++ b/mkemlog.c
@@ -21,7 +21,6 @@
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
-#include <error.h>
#include <errno.h>
#define EMLOG_DEVICE "/dev/emlog"
@@ -40,16 +39,16 @@ int main(int argc, char** argv) {
FILE *max_size_file = NULL;
uid_t uid = -1;
if (argc < 2 || argc > 5) {
- error(1 ,0, USAGE);
+ fprintf(stderr, USAGE);
}
file = argv[1];
max_size_file = fopen("/sys/module/emlog/parameters/emlog_max_size", "r");
if (max_size_file == NULL)
- error(1, errno, "Emlog module not loaded\n");
+ fprintf(stderr, "Emlog module not loaded\n");
rc = fscanf(max_size_file, "%d", &emlog_max_size);
if (rc != 1)
- error(1, errno, "Unable to get emlog max size\n");
+ fprintf(stderr, "Unable to get emlog max size\n");
fclose(max_size_file);
max_size_file = NULL;
if (argc > 2 ) {
@@ -57,13 +56,13 @@ int main(int argc, char** argv) {
number = argv[2];
size_of_buffer = strtol(number, &end_of_number, 10);
if (errno) {
- error(1, errno, "Invalid size provided\n" USAGE);
+ fprintf(stderr, "Invalid size provided\n" USAGE);
}
if (end_of_number == number) {
- error(1, 0, "Invalid size provided\n" USAGE);
+ fprintf(stderr, "Invalid size provided\n" USAGE);
}
if (size_of_buffer < 1 || size_of_buffer > emlog_max_size) {
- error(1, 0, "Invalid size provided must be a value between 1 and %d\n" USAGE, emlog_max_size);
+ fprintf(stderr, "Invalid size provided must be a value between 1 and %d\n" USAGE, emlog_max_size);
}
}
if (argc > 3 ) {
@@ -71,10 +70,10 @@ int main(int argc, char** argv) {
number = argv[3];
mode = strtol(number, &end_of_number, 8);
if (errno) {
- error(1, errno, "Invalid mode provided\n" USAGE);
+ fprintf(stderr, "Invalid mode provided\n" USAGE);
}
if (end_of_number == number || S_IFMT & mode) {
- error(1, 0, "Invalid mode provided\n" USAGE);
+ fprintf(stderr, "Invalid mode provided\n" USAGE);
}
}
if (argc > 4 ) {
@@ -82,27 +81,27 @@ int main(int argc, char** argv) {
number = argv[4];
uid = strtol(number, &end_of_number, 10);
if (errno) {
- error(1, errno, "Invalid uid provided\n" USAGE);
+ fprintf(stderr, "Invalid uid provided\n" USAGE);
}
if (end_of_number == number) {
- error(1, 0, "Invalid uid provided\n" USAGE);
+ fprintf(stderr, "Invalid uid provided\n" USAGE);
}
}
rc = stat(EMLOG_DEVICE, &emlog_stat);
if (rc == -1) {
- error(1, errno, "stat: " EMLOG_DEVICE);
+ fprintf(stderr, "stat: " EMLOG_DEVICE);
}
if (!S_ISCHR(emlog_stat.st_mode)) {
- error(1, 0, EMLOG_DEVICE " is not a valid emlog device\n");
+ fprintf(stderr, EMLOG_DEVICE " is not a valid emlog device\n");
}
rc = mknod(file, mode | S_IFCHR, makedev(major(emlog_stat.st_rdev),size_of_buffer));
if (rc == -1) {
- error(1, errno, "mknod: %s", file);
+ fprintf(stderr, "mknod: %s", file);
}
if (uid != -1) {
rc = chown(file, uid, -1);
if (rc == -1) {
- error(1, errno, "chown: %s", file);
+ fprintf(stderr, "chown: %s", file);
}
}
printf("Log device %s created with buffer size of %d KiB\n", file, size_of_buffer);
--
2.20.1

View File

@@ -0,0 +1,25 @@
#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin
[ -r /etc/default/emlog ] && . /etc/default/emlog
do_start() {
:
}
do_stop() {
nbcat /dev/emlog > /data/emlog
}
case "$1" in
start)
do_start || exit $?
;;
stop)
do_stop || exit $?
;;
*)
echo "Usage: $0 {stop}" >&2
exit 3
;;
esac

View File

@@ -0,0 +1,37 @@
require ${BPN}.inc
SRC_URI += "file://${BPN}.initd \
file://0001-Remove-modules_clean-from-clean-target.patch \
"
SRC_URI:append:libc-musl = " file://Drop-use-of-error-h.patch"
inherit update-rc.d
INITSCRIPT_NAME = "${BPN}"
do_compile() {
oe_runmake nbcat
oe_runmake mkemlog
}
do_install() {
install -Dm 0755 ${WORKDIR}/${BPN}.initd ${D}${sysconfdir}/init.d/${BPN}
install -Dm 0755 ${S}/nbcat ${D}${bindir}/nbcat
install -Dm 0755 ${S}/mkemlog ${D}${bindir}/mkemlog
}
RRECOMMENDS:${PN} += "kernel-module-emlog"
# The NVD database doesn't have a CPE for this product,
# the name of this product is exactly the same as github.com/emlog/emlog
# but it's not related in any way. The following CVEs are from that project
# so they can be safely ignored
CVE_CHECK_IGNORE += "\
CVE-2019-16868 \
CVE-2019-17073 \
CVE-2021-44584 \
CVE-2022-1526 \
"

View File

@@ -0,0 +1,10 @@
require emlog.inc
inherit module
EXTRA_OEMAKE += " \
KDIR=${STAGING_KERNEL_DIR} \
KVER=${KERNEL_VERSION} \
"
MAKE_TARGETS = "modules"

View File

@@ -0,0 +1,26 @@
SUMMARY = "A multi-platform library for OpenGL, OpenGL ES, Vulkan, window and input"
HOMEPAGE = "https://www.glfw.org/"
DESCRIPTION = "GLFW is an Open Source, multi-platform library for OpenGL, \
OpenGL ES and Vulkan application development. It provides a simple, \
platform-independent API for creating windows, contexts and surfaces, reading \
input, handling events, etc."
LICENSE = "Zlib"
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=98d93d1ddc537f9b9ea6def64e046b5f"
SECTION = "lib"
inherit pkgconfig cmake features_check
PV .= "+git${SRCPV}"
SRCREV = "781fbbadb0bccc749058177b1385c82da9ace880"
SRC_URI = "git://github.com/glfw/glfw.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON -DGLFW_BUILD_DOCS=OFF"
CFLAGS += "-fPIC"
DEPENDS = "libpng libglu zlib libxrandr libxinerama libxi libxcursor"
REQUIRED_DISTRO_FEATURES = "x11 opengl"
COMPATIBLE_HOST:libc-musl = "null"

View File

@@ -0,0 +1,29 @@
SUMMARY = "C++ bindings for the glib library"
HOMEPAGE = "http://www.gtkmm.org/"
SECTION = "libs"
LICENSE = "LGPL-2.1-only & GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=42dfffebc56fec7527aac53b7a89d1d8 \
file://COPYING.tools;md5=751419260aa954499f7abaabaa882bbe"
DEPENDS = "mm-common glib-2.0 libsigc++-3 glib-2.0-native"
GNOMEBASEBUILDCLASS = "meson"
GNOMEBN = "glibmm"
inherit gnomebase
SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
SRC_URI[archive.sha256sum] = "2b472696cbac79db8e405724118ec945219c5b9b18af63dc8cfb7f1d89b0f1fa"
S = "${WORKDIR}/${GNOMEBN}-${PV}"
do_install:append() {
for i in generate_wrap_init.pl gmmproc; do
sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/glibmm-2.68/proc/$i
done
}
FILES:${PN} = "${libdir}/lib*.so.*"
FILES:${PN}-dev += "${datadir}/glibmm-* ${libdir}/${BPN}/include/ ${libdir}/${BPN}/proc/ ${libdir}/giomm-2.68/include/"
RDEPENDS:${PN}-dev = "perl"

View File

@@ -0,0 +1,40 @@
From 52360260c0d73a00082d867bc416225fbc2b657e Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Tue, 12 Jul 2011 11:46:37 +0200
Subject: [PATCH] glibmm: add 2.28.2
---
Makefile.am | 7 +------
configure.ac | 1 -
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 1b366b4..0ff58b5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,12 +23,7 @@ src_subdirs = glib/src gio/src
else
src_subdirs =
endif
-if ENABLE_DOCUMENTATION
-doc_subdirs = docs
-else
-doc_subdirs =
-endif
-SUBDIRS = tools $(src_subdirs) glib/glibmm gio/giomm tests examples $(doc_subdirs)
+SUBDIRS = tools $(src_subdirs) glib/glibmm gio/giomm tests
glibmm_includedir = $(includedir)/$(GLIBMM_MODULE_NAME)
glibmm_include_HEADERS = glib/glibmm.h
diff --git a/configure.ac b/configure.ac
index e706687..198e0d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -166,7 +166,6 @@ AC_CONFIG_FILES([Makefile
gio/src/Makefile
gio/giomm/Makefile
tests/Makefile
- examples/Makefile
docs/Makefile
docs/reference/Doxyfile
MSVC_NMake/glibmm/glibmm.rc

View File

@@ -0,0 +1,27 @@
SUMMARY = "C++ bindings for the glib library"
HOMEPAGE = "http://www.gtkmm.org/"
SECTION = "libs"
LICENSE = "LGPL-2.1-only & GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=42dfffebc56fec7527aac53b7a89d1d8 \
file://COPYING.tools;md5=751419260aa954499f7abaabaa882bbe"
DEPENDS = "mm-common glib-2.0 libsigc++-2.0 glib-2.0-native"
GNOMEBASEBUILDCLASS = "meson"
inherit gnomebase
SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
SRC_URI[archive.sha256sum] = "b2a4cd7b9ae987794cbb5a1becc10cecb65182b9bb841868625d6bbb123edb1d"
do_install:append() {
for i in generate_wrap_init.pl gmmproc; do
sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/glibmm-2.4/proc/$i
done
}
FILES:${PN} = "${libdir}/lib*.so.*"
FILES:${PN}-dev += "${datadir}/glibmm-* ${libdir}/glibmm-2.4/include/ ${libdir}/glibmm-2.4/proc/ ${libdir}/giomm-2.4/include/"
RDEPENDS:${PN}-dev = "perl"

View File

@@ -0,0 +1,7 @@
SUMMARY = "meta-oe build test image"
IMAGE_INSTALL = "packagegroup-core-boot"
LICENSE = "MIT"
inherit core-image

View File

@@ -0,0 +1,5 @@
require meta-oe-image-base.bb
SUMMARY = "meta-oe build test image"
IMAGE_INSTALL += "packagegroup-meta-oe"

View File

@@ -0,0 +1,25 @@
DESCRIPTION = "Recipe to trigger execution of all meta-oe ptest images."
HOMEPAGE = "https://www.openembedded.org/"
LICENSE = "MIT"
inherit features_check nopackages
REQUIRED_DISTRO_FEATURES = "ptest"
require conf/include/ptest-packagelists-meta-oe.inc
# Include the full set of ptests
PTESTS_META_OE = "${PTESTS_FAST_META_OE} ${PTESTS_SLOW_META_OE}"
do_testimage[noexec] = "1"
do_testimage[depends] = "${@' '.join(['meta-oe-ptest-image-'+x+':do_testimage' for x in d.getVar('PTESTS_META_OE').split()])}"
do_build[depends] = "${@' '.join(['meta-oe-ptest-image-'+x+':do_build' for x in d.getVar('PTESTS_META_OE').split()])}"
# normally image.bbclass would do this
EXCLUDE_FROM_WORLD = "1"
python () {
if bb.utils.contains('IMAGE_CLASSES', 'testimage', True, False, d):
bb.build.addtask("do_testimage", "", "", d)
}

View File

@@ -0,0 +1,6 @@
require meta-oe-ptest-all-image.bb
DESCRIPTION = "Recipe to trigger execution of all fast meta-oe ptest images."
PTESTS_META_OE = "${PTESTS_FAST_META_OE}"

View File

@@ -0,0 +1,41 @@
inherit features_check
REQUIRED_DISTRO_FEATURES = "ptest"
require conf/include/ptest-packagelists-meta-oe.inc
require meta-oe-image-base.bb
SUMMARY = "meta-oe ptest test image"
DESCRIPTION += "Also including the ${MCNAME} ptest package."
HOMEPAGE = "https://www.openembedded.org/"
PTESTS_META_OE = "${PTESTS_SLOW_META_OE} ${PTESTS_FAST_META_OE}"
IMAGE_INSTALL:append = " ${MCNAME}-ptest openssh"
BBCLASSEXTEND = "${@' '.join(['mcextend:'+x for x in d.getVar('PTESTS_META_OE').split()])}"
# The image can be sufficiently large (~1.8GB) that we need to be careful that it fits in a live
# image (which has a 4GB limit), so nullify the overhead factor (1.3x out of the
# box) and explicitly add up to 1500MB.
IMAGE_OVERHEAD_FACTOR = "1.0"
IMAGE_ROOTFS_EXTRA_SPACE = "324288"
# If a particular ptest needs more space, it can be customized:
#IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-<pn> = "1024288"
# ptests need more memory than standard to avoid the OOM killer
QB_MEM = "-m 1024"
# If a particular ptest needs more memroy, it can be customized:
#QB_MEM:virtclass-mcextend-<pn> = "-m 4096"
TEST_SUITES = "ping ssh parselogs ptest"
# Sadly at the moment the full set of ptests is not robust enough and sporadically fails in random places
PTEST_EXPECT_FAILURE = "1"
python () {
if not d.getVar("MCNAME"):
raise bb.parse.SkipRecipe("No class extension set")
}

View File

@@ -0,0 +1,17 @@
SUMMARY = "Platform independent Near Field Communication (NFC) library"
DESCRIPTION = "libnfc is a library which allows userspace application access \
to NFC devices."
LICENSE = "LGPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b52f2d57d10c4f7ee67a7eb9615d5d24"
SECTION = "libs"
inherit autotools pkgconfig
PV = "1.8.0+git${SRCPV}"
S = "${WORKDIR}/git"
SRCREV = "f02ff51449240102c27a97173dc495e8e7789046"
SRC_URI = "git://github.com/nfc-tools/libnfc.git;branch=master;protocol=https"
CFLAGS:append:libc-musl = " -D_GNU_SOURCE"
DEPENDS = "libusb"

View File

@@ -0,0 +1,19 @@
SUMMARY = "A library for loose coupling of C++ method calls"
SECTION = "libs"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499"
DEPENDS = "mm-common"
SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.10/libsigc++-${PV}.tar.xz"
SRC_URI[sha256sum] = "d082a2ce72c750f66b1a415abe3e852df2eae1e8af53010f4ac2ea261a478832"
S = "${WORKDIR}/libsigc++-${PV}"
inherit meson
FILES:${PN}-dev += "${libdir}/sigc++-*/"
FILES:${PN}-doc += "${datadir}/devhelp"
BBCLASSEXTEND = "native"
SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"

View File

@@ -0,0 +1,19 @@
SUMMARY = "A library for loose coupling of C++ method calls"
SECTION = "libs"
LICENSE = "LGPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=959bffe2993816eb32ec4bc1ec1d5875"
DEPENDS = "mm-common"
SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/libsigc++/3.2/libsigc++-${PV}.tar.xz"
SRC_URI[sha256sum] = "8cdcb986e3f0a7c5b4474aa3c833d676e62469509f4899110ddf118f04082651"
S = "${WORKDIR}/libsigc++-${PV}"
inherit setuptools3 meson
FILES:${PN}-dev += "${libdir}/sigc++-*/"
FILES:${PN}-doc += "${datadir}/devhelp"
BBCLASSEXTEND = "native"
SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"

View File

@@ -0,0 +1,20 @@
SUMMARY = "C++ wrapper for libxml library"
DESCRIPTION = "C++ wrapper for libxml library"
HOMEPAGE = "http://libxmlplusplus.sourceforge.net"
BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml%2B%2B"
SECTION = "libs"
LICENSE = "LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 "
SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
SRC_URI = "${GNOME_MIRROR}/libxml++/${SHRT_VER}/libxml++-${PV}.tar.xz \
"
SRC_URI[sha256sum] = "15c38307a964fa6199f4da6683a599eb7e63cc89198545b36349b87cf9aa0098"
S = "${WORKDIR}/libxml++-${PV}"
DEPENDS = "libxml2 glibmm"
inherit meson pkgconfig ptest
FILES:${PN}-doc += "${datadir}/devhelp"
FILES:${PN}-dev += "${libdir}/libxml++-${SHRT_VER}/include/libxml++config.h"

View File

@@ -0,0 +1,78 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,5 +40,8 @@ EXTRA_DIST = \
tools/conf_tests/have_exception_ptr.cc \
untracked/README
+install-ptest:
+ make -C examples install-ptest
+
# Optional: auto-generate the ChangeLog file from the git log on make dist
include $(top_srcdir)/build/dist-changelog.am
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -19,6 +19,8 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_
AM_CXXFLAGS = $(LIBXMLXX_WXXFLAGS)
LDADD = $(top_builddir)/libxml++/libxml++-$(LIBXMLXX_API_VERSION).la $(LIBXMLXX_LIBS)
+LOG_DRIVER = $(SHELL) ../macros/test-driver
+
check_PROGRAMS = \
dom_build/dom_build \
dom_parse_entities/dom_parse_entities \
@@ -37,6 +39,23 @@ check_PROGRAMS = \
schemavalidation/schemavalidation \
textreader/textreader
+check_DOTLIBS = \
+ dom_build/.libs/dom_build \
+ dom_parse_entities/.libs/dom_parse_entities \
+ dom_parser/.libs/dom_parser \
+ dom_parser_raw/.libs/dom_parser_raw \
+ dom_read_write/.libs/dom_read_write \
+ dom_xinclude/.libs/dom_xinclude \
+ dom_xpath/.libs/dom_xpath \
+ dtdvalidation/.libs/dtdvalidation \
+ import_node/.libs/import_node \
+ sax_exception/.libs/sax_exception \
+ sax_parser/.libs/sax_parser \
+ sax_parser_build_dom/.libs/sax_parser_build_dom \
+ sax_parser_entities/.libs/sax_parser_entities \
+ schemavalidation/.libs/schemavalidation \
+ textreader/.libs/textreader
+
# Shell scripts that call the example programs.
check_SCRIPTS = \
dom_build/make_check.sh \
@@ -154,10 +173,10 @@ dist_noinst_DATA = \
# file are located in different directories.
dom_read_write/make_check.sh: Makefile
$(AM_V_GEN)echo '# Generated and used by "make check"' >$@
- $(AM_V_at)echo 'dom_read_write/dom_read_write "$(srcdir)/dom_read_write/example.xml" dom_read_write/example_output.xml >/dev/null' >>$@
+ $(AM_V_at)echo 'cd dom_read_write && .libs/dom_read_write "example.xml" example_output.xml >/dev/null' >>$@
$(AM_V_at)chmod +x $@
-script_template = cd "$(srcdir)/<!progname!>" && "$(abs_builddir)/<!progname!>/<!progname!>" >/dev/null
+script_template = cd "<!progname!>" && ".libs/<!progname!>" >/dev/null
standard_scripts = $(filter-out dom_read_write/make_check.sh,$(check_SCRIPTS))
# All other script files are generated like so:
@@ -169,3 +188,18 @@ $(standard_scripts): Makefile
CLEANFILES = \
dom_read_write/example_output.xml \
$(check_SCRIPTS)
+
+buildtest: all
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS)
+ $(MAKE) $(AM_MAKEFLAGS) buildtest-TESTS
+
+install-ptest:
+ $(MKDIR_P) $(DESTDIR)/examples
+ cp --parents $(check_DOTLIBS) $(DESTDIR)/examples
+ cp --parents $(check_SCRIPTS) $(DESTDIR)/examples
+ cd $(srcdir) && cp --parents $(dist_noinst_DATA) $(DESTDIR)/examples
+ cp Makefile $(DESTDIR)/examples
+ $(MKDIR_P) $(DESTDIR)/macros
+ cp $(top_srcdir)/build/test-driver $(DESTDIR)/macros
+ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/examples/Makefile
+

View File

@@ -0,0 +1,3 @@
#!/bin/sh
cd examples
make -k check-TESTS

View File

@@ -0,0 +1,35 @@
SUMMARY = "C++ wrapper for libxml library"
DESCRIPTION = "C++ wrapper for libxml library"
HOMEPAGE = "http://libxmlplusplus.sourceforge.net"
BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml%2B%2B"
SECTION = "libs"
LICENSE = "LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 "
SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
SRC_URI = "${GNOME_MIRROR}/${BPN}/${SHRT_VER}/${BP}.tar.xz \
file://libxml++_ptest.patch \
file://run-ptest \
"
SRC_URI[sha256sum] = "9b59059abe5545d28ceb388a55e341095f197bd219c73e6623aeb6d801e00be8"
DEPENDS = "libxml2 glibmm mm-common-native"
inherit autotools pkgconfig ptest
EXTRA_OECONF = "--disable-documentation"
do_configure:prepend() {
mm-common-prepare --copy --force ${S}
}
do_compile_ptest() {
oe_runmake -C examples buildtest
}
PTEST_PARALLEL_MAKE = ""
FILES:${PN}-doc += "${datadir}/devhelp"
FILES:${PN}-dev += "${libdir}/libxml++-2.6/include/libxml++config.h"
RDEPENDS:${PN}-ptest += "make"

View File

@@ -0,0 +1,27 @@
From 01a3a35631ba3996f7e912def66b4053a4f21df9 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 3 Nov 2020 10:52:17 -0800
Subject: [PATCH] Fix arguments in GLib.DBusSignalCallback for Vala 0.50
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/main.vala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main.vala b/src/main.vala
index 6d7132b0..b3183217 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -403,7 +403,7 @@ class Commands : Object
return false;
}
- public void signalHandler( GLib.DBusConnection conn, string sender, string path, string iface, string name, Variant params )
+ public void signalHandler( GLib.DBusConnection conn, string? sender, string path, string iface, string name, Variant params )
{
var line = "[SIGNAL] %s.%s %s %s\n%s".printf(
iface,
--
2.29.2

View File

@@ -0,0 +1,18 @@
SUMMARY = "Mickey's DBus Introspection and Interaction Utility V2"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=ebb5c50ab7cab4baeffba14977030c07"
DEPENDS = "readline"
PV = "2.3.3+git${SRCPV}"
SRC_URI = "git://github.com/freesmartphone/mdbus.git;protocol=https;branch=master \
file://0001-Fix-arguments-in-GLib.DBusSignalCallback-for-Vala-0..patch \
"
SRCREV = "28202692d0b441000f4ddb8f347f72d1355021aa"
S = "${WORKDIR}/git"
inherit autotools pkgconfig vala
EXTRA_OECONF += "--enable-vala"

View File

@@ -0,0 +1,33 @@
SUMMARY = "Configuration files for online package repositories aka feeds"
PR = "r6"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
DISTRO_FEED_PREFIX ?= "remote"
DISTRO_FEED_URI ?= "http://my-distribution.example/remote-feed/"
DISTRO_FEED_ARCHS ?= "all ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}"
do_compile() {
mkdir -p ${S}/${sysconfdir}/opkg
for feed in ${DISTRO_FEED_ARCHS}; do
echo "src/gz ${DISTRO_FEED_PREFIX}-${feed} ${DISTRO_FEED_URI}/${feed}" > ${S}/${sysconfdir}/opkg/${feed}-feed.conf
done
}
do_install () {
install -d ${D}${sysconfdir}/opkg
install -m 0644 ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/
}
PACKAGE_ARCH = "${MACHINE_ARCH}"
#def distro_feed_configs(d):
# import bb
# parchs = d.getVar("PACKAGE_EXTRA_ARCHS").split()
# march = d.getVar("MACHINE_ARCH").split()
# archs = [ "all" ] + parchs + march
# confs = [ ( "${sysconfdir}/opkg/%s-feed.conf" % feed ) for feed in archs ]
# return " ".join( confs )
#
#CONFFILES:${PN} += '${@distro_feed_configs(d)}'
CONFFILES:${PN} += '${@ " ".join( [ ( "${sysconfdir}/opkg/%s-feed.conf" % feed ) for feed in "all ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}".split() ] ) }'

View File

@@ -0,0 +1,45 @@
From af4069263487399be82ee53d48b1edda7f8e594e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Mon, 4 Nov 2019 19:19:47 +0100
Subject: [PATCH] meson.build: do not ask for python installation / version
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Even by adding python3-setuptools-native the following error is not fixed so
just ask for python3 executable.
| meson.build:9:0: ERROR: <ExternalProgram 'python3' -> ['<...>/recipe-sysroot-native/usr/bin/python3-native/python3']> is not a valid python or it is missing setuptools
Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
rebase for 1.0.4
Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
---
meson.build | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/meson.build b/meson.build
index 8a18c36..34fd546 100644
--- a/meson.build
+++ b/meson.build
@@ -7,12 +7,7 @@ project('mm-common',
# and meson.add_install_script(python3, ...)
)
-python3 = import('python').find_installation()
-python_version = python3.language_version()
-python_version_req = '>= 3.5'
-if not python_version.version_compare(python_version_req)
- error('Requires Python @0@, found @1@.'.format(python_version_req, python_version))
-endif
+python3 = import('python3').find_python()
# Use these instead of meson.source_root() and meson.build_root().
# source_root() and build_root() are not useful, if this is a subproject.
--
2.25.1

View File

@@ -0,0 +1,28 @@
SUMMARY = "Common GNOME build files for C++ bindings"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
GNOMEBASEBUILDCLASS = "meson"
inherit gnomebase
# All the recipe does is stage python and shell script, some autotools files; nothing is compiled.
inherit allarch
SRC_URI[archive.sha256sum] = "e954c09b4309a7ef93e13b69260acdc5738c907477eb381b78bb1e414ee6dbd8"
SRC_URI += "file://0001-meson.build-do-not-ask-for-python-installation-versi.patch"
BBCLASSEXTEND = "native"
# These files aren't very usefull on target image, package them all in nnPN-dev
FILES:${PN} = ""
FILES:${PN}-dev += " \
${datadir}/${BPN}/build \
${datadir}/${BPN}/doctags \
${datadir}/${BPN}/doctool \
${bindir}/mm-common-get \
${bindir}/mm-common-prepare \
"
# ${PN} package is empty, remove the default dependency on it
RDEPENDS:${PN}-dev = ""

View File

@@ -0,0 +1,12 @@
SUMMARY = "Implementation of rpmatch(3) for musl libc."
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=81a81bf31abecc50c20862fc8a716329"
SRC_URI = "gitsm://github.com/pullmoll/musl-rpmatch.git;protocol=https;branch=master"
PV = "1.0+git${SRCPV}"
SRCREV = "46267b154987d3e1f25d3a75423faa62bb5ee342"
inherit autotools
S = "${WORKDIR}/git"

View File

@@ -0,0 +1,60 @@
From b06d16ec2d4aefc4cf1675e9dd6314956bc32d69 Mon Sep 17 00:00:00 2001
From: Naveen Saini <naveen.kumar.saini@intel.com>
Date: Thu, 7 Apr 2022 14:36:58 +0800
Subject: [PATCH] build: set HAVE_STATEMENT_EXPR var
The v73 version tries to build and run a test program at compile
time to check whether compiler supports sizeof and expression statements
and sets HAVE_STATEMENT_EXPR accordingly. This requires EXEWRAPPER_ENABLED
in meson.bbclass to be True and qemu-usermode to be working.
In cases when EXEWRAPPER_ENABLED is False, build fails with error:
| ../git/meson.build:213:0: ERROR: Can not run test applications in
this cross environment.
We don't really need to do this as these have been supported since gcc3 and can set the configs to 1.
The autotools implementation also used to set it to 1 so this doesn't change anything:
https://github.com/pmem/ndctl/blob/v72.1/configure.ac#L70
Upstream-Status: Inappropriate
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
---
meson.build | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/meson.build b/meson.build
index 42e11aa..e8d218b 100644
--- a/meson.build
+++ b/meson.build
@@ -210,22 +210,8 @@ conf.set('ENABLE_DESTRUCTIVE', get_option('destructive').enabled())
conf.set('ENABLE_LOGGING', get_option('logging').enabled())
conf.set('ENABLE_DEBUG', get_option('dbg').enabled())
-typeof = cc.run('''
- int main() {
- struct {
- char a[16];
- } x;
- typeof(x) y;
-
- return sizeof(x) == sizeof(y);
- }
- '''
-)
-
-if typeof.compiled() and typeof.returncode() == 1
- conf.set('HAVE_TYPEOF', 1)
- conf.set('HAVE_STATEMENT_EXPR', 1)
-endif
+conf.set('HAVE_TYPEOF', 1)
+conf.set('HAVE_STATEMENT_EXPR', 1)
if target_machine.endian() == 'big'
conf.set('HAVE_BIG_ENDIAN', 1)
--
2.17.1

View File

@@ -0,0 +1,41 @@
From 44516eee75696c84849c0f7aa632e2456b101813 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 26 Mar 2022 00:57:03 -0700
Subject: [PATCH] meson: Use pkg-config to detect iniparser
Add iniparser dependency to util subdir
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meson.build | 2 +-
util/meson.build | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 42e11aa..4209320 100644
--- a/meson.build
+++ b/meson.build
@@ -160,7 +160,7 @@ cc = meson.get_compiler('c')
# keyutils and iniparser lack pkgconfig
keyutils = cc.find_library('keyutils', required : get_option('keyutils'))
-iniparser = cc.find_library('iniparser', required : true)
+iniparser = dependency('iniparser', required : true)
conf = configuration_data()
check_headers = [
diff --git a/util/meson.build b/util/meson.build
index 784b279..8e9ae9a 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -12,5 +12,6 @@ util = static_library('util', [
'iomem.c',
],
include_directories : root_inc,
+ dependencies : iniparser,
)
util_dep = declare_dependency(link_with : util)
--
2.35.1

View File

@@ -0,0 +1,28 @@
From c212d228c25cb583f52a6d31e9f0ec7bc1f9c506 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 26 Mar 2022 01:10:02 -0700
Subject: [PATCH] util: Correct path to iniparser.h
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
util/parse-configs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/parse-configs.c b/util/parse-configs.c
index c834a07..1b7ffa6 100644
--- a/util/parse-configs.c
+++ b/util/parse-configs.c
@@ -4,7 +4,7 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
-#include <iniparser.h>
+#include <iniparser/iniparser.h>
#include <sys/stat.h>
#include <util/parse-configs.h>
#include <util/strbuf.h>
--
2.35.1

View File

@@ -0,0 +1,36 @@
SUMMARY = "libnvdimm utility library"
DESCRIPTION = "Utility library for managing the libnvdimm \
(non-volatile memory device) sub-system in the Linux kernel. \
The LIBNVDIMM subsystem provides support for three types of \
NVDIMMs, namely,PMEM, BLK, and NVDIMM devices that can \
simultaneously support both PMEM and BLK mode access."
HOMEPAGE = "https://git.kernel.org/cgit/linux/kernel/git/nvdimm/nvdimm.git/tree/Documentation/nvdimm/nvdimm.txt?h=libnvdimm-for-next"
LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & MIT & CC0-1.0"
LIC_FILES_CHKSUM = "file://COPYING;md5=74a614eac8b2657a4b8e6607421a0883"
inherit meson pkgconfig bash-completion systemd
SRCREV = "dd58d43458943d20ff063850670bf54a5242c9c5"
SRC_URI = "git://github.com/pmem/ndctl.git;branch=main;protocol=https \
file://0001-util-Correct-path-to-iniparser.h.patch \
file://0001-meson-Use-pkg-config-to-detect-iniparser.patch \
file://0001-build-set-HAVE_STATEMENT_EXPR-var.patch"
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>v\d+(\.\d+)*)"
DEPENDS = "kmod udev json-c keyutils iniparser"
S = "${WORKDIR}/git"
EXTRA_OECONF += "-Ddestructive=enabled"
PACKAGECONFIG ??= "tests ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}"
PACKAGECONFIG[systemd] = "-Dsystemd=enabled,-Dsystemd=disabled,systemd"
PACKAGECONFIG[tests] = "-Dtest=enabled, -Dtest=disabled,"
PACKAGECONFIG[docs] = "-Ddocs=enabled -Dasciidoctor=enabled,-Ddocs=disabled -Dasciidoctor=disabled, asciidoc-native"
SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
SYSTEMD_SERVICE:${PN} = "ndctl-monitor.service daxdev-reconfigure@.service"
SYSTEMD_AUTO_ENABLE:${PN} = "disable"
FILES:${PN} += "${datadir}/daxctl/daxctl.conf "

View File

@@ -0,0 +1,20 @@
SUMMARY = "OpenCL ICD library"
DESCRIPTION = "Open Source alternative to vendor specific OpenCL ICD loaders."
# The LICENSE is BSD 2-Clause "Simplified" License
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=1238d5bccbb6bda30654e48dcc0a554b"
SRC_URI = "git://github.com/OCL-dev/ocl-icd.git;protocol=https;branch=master"
SRCREV = "1165deedb2ae741cd76e60986f7c2cb5023059d9"
S = "${WORKDIR}/git"
inherit autotools
DEPENDS = "ruby-native"
PROVIDES = "virtual/opencl-icd"
RPROVIDES:${PN} = "virtual/opencl-icd"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,23 @@
SUMMARY = "OpenCL API C++ bindings"
DESCRIPTION = "OpenCL API C++ bindings from Khronos"
SRC_URI = "git://github.com/KhronosGroup/OpenCL-CLHPP.git;protocol=https;branch=main"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
PV = "2.0.16+git${SRCPV}"
SRCREV = "1df82b9749739f2681081092ae163bb0f0d40f66"
S = "${WORKDIR}/git"
inherit cmake
EXTRA_OECMAKE = " \
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTS=OFF \
"
# Headers only so PN is empty
RDEPENDS:${PN}-dev = ""

View File

@@ -0,0 +1,20 @@
SUMMARY = "OpenCL API Headers"
DESCRIPTION = "OpenCL compute API headers from Khronos Group"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
SECTION = "base"
S = "${WORKDIR}/git"
PV = "2023.02.06"
SRCREV = "4c82e9cfaaad18c340f48af3cf5d09ff33e8c1b7"
SRC_URI = "git://github.com/KhronosGroup/OpenCL-Headers.git;branch=main;protocol=https"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
ALLOW_EMPTY:${PN} = "1"
do_install () {
install -d ${D}${includedir}/CL/
install -m 0644 ${S}/CL/*.h ${D}${includedir}/CL
}
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,54 @@
SUMMARY = "OpenCL ICD Loader"
DESCRIPTION = "OpenCL compute ICD Loader from Khronos Group"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
SECTION = "base"
inherit pkgconfig cmake
DEPENDS += "opencl-headers"
PROVIDES = "virtual/opencl-icd"
RPROVIDES:${PN} = "virtual/opencl-icd"
S = "${WORKDIR}/git"
PV = "v2022.01.04+git${SRCPV}"
SRCREV = "169f05d026e65948b30cfe2200595fda92198cf7"
SRC_URI = "git://github.com/KhronosGroup/OpenCL-ICD-Loader.git;branch=main;protocol=https"
EXTRA_OECMAKE:append = " \
-DOPENCL_ICD_LOADER_HEADERS_DIR=${STAGING_INCDIR} \
"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${B}/test/loader_test/icd_loader_test ${D}${bindir}/
chrpath -d ${D}${bindir}/icd_loader_test
install -d ${D}${libdir}
install -m 0644 ${B}/test/log/libIcdLog.so ${D}${libdir}/
install -m 0644 ${B}/test/driver_stub/libOpenCLDriverStub.so ${D}${libdir}/
chrpath -d ${D}${libdir}/libOpenCLDriverStub.so
install -m 0644 ${B}/libOpenCL.so.1.2 ${D}${libdir}/
cd ${D}${libdir}
ln -s libOpenCL.so.1.2 libOpenCL.so.1
ln -s libOpenCL.so.1 libOpenCL.so
}
PACKAGES = "opencl-icd-loader opencl-icd-loader-dev"
PACKAGES += "libicdlog libicdlog-dbg"
PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
FILES:${PN} = " \
${bindir}/icd_loader_test \
${libdir}/libOpenCLDriverStub.so \
${libdir}/libOpenCL.so.1.2 \
${libdir}/libOpenCL.so.1 \
"
FILES:${PN}-dev = " \
${libdir}/libOpenCL.so \
"
FILES:libicdlog = "${libdir}/libIcdLog.so"
FILES:libicdlog-dbg = "${libdir}/.debug/libIcdLog.so"
RDEPENDS:${PN} = "libicdlog"

View File

@@ -0,0 +1,53 @@
# This recipe is intended as a 'simpler' replacement for packagegroup-base.
# Please communicate your use cases and suggestions to the mailinglist(s)
SUMMARY = "Basic task to get a device online"
PR = "r13"
PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit packagegroup
# Poke extra recomendations into the list using your machine.conf
#
MACHINE_EXTRA_RRECOMMENDS ?= ""
#
# Select between dropbear and openssh
# Set TASK_BASIC_SSHDAEMON = "openssh-sshd openssh-sftp openssh-sftp-server" in your DISTRO config to get openssh(d)
#
TASK_BASIC_SSHDAEMON ?= "dropbear openssh-sftp openssh-sftp-server"
#
# The section below is designed to match with packagegroup-boot, but doesn't depend on it to allow for more freedom
# when writing image recipes.
# It also avoids the choice between connman/networkmanager/ifupdown since that is an image feature, not a
# distro feature.
#
# Util-linux (u)mount is included because the busybox one can't handle /etc/mtab being symlinked to /proc/mounts
#
RDEPENDS:${PN} = "\
${TASK_BASIC_SSHDAEMON} \
avahi-daemon avahi-utils \
"
#
# The following section is split in 3:
# 1) Machine features: kernel modules and userspace helpers for those
# 2) Distro features: packages associated with those
# 3) Nice to have: packages that are nice to have, but aren't strictly needed
#
RRECOMMENDS:${PN} = "\
${MACHINE_EXTRA_RRECOMMENDS} \
${@bb.utils.contains("MACHINE_FEATURES", "usbhost", "usbutils", "", d)} \
${@bb.utils.contains("MACHINE_FEATURES", "alsa", "alsa-utils-alsamixer", "", d)} \
${@bb.utils.contains("MACHINE_FEATURES", "usbgadget", "kernel-module-g-ether kernel-module-g-serial kernel-module-g-mass-storage", "", d)} \
\
${@bb.utils.contains("DISTRO_FEATURES", "bluetooth", "bluez5", "", d)} \
${@bb.utils.contains("DISTRO_FEATURES", "wifi", "iw wpa-supplicant", "", d)} \
\
tzdata \
\
cpufrequtils \
htop \
"

View File

@@ -0,0 +1,32 @@
SUMMARY = "Basic task to get a device booting"
PR = "r58"
PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit packagegroup
#
# those ones can be set in machine config to supply packages needed to get machine booting
#
MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
# Make sure we build the kernel
DEPENDS = "virtual/kernel"
#
# minimal set of packages - needed to boot
#
RDEPENDS:${PN} = "\
base-files \
base-passwd \
busybox \
netbase \
${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "keymaps", "", d)} \
${MACHINE_ESSENTIAL_EXTRA_RDEPENDS} \
"
RRECOMMENDS:${PN} = "\
kernel \
${MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS} \
"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
HOMEPAGE = "https://booting.oniroproject.org/distro/components/pim435"
SUMMARY = "A userspace driver application for PIM435 written in C"
DESCRIPTION = "A userspace driver application for PIM435 (Pimoroni LED matrix) \
written in C"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSES/MIT.txt;md5=7dda4e90ded66ab88b86f76169f28663"
SRC_URI = "git://gitlab.eclipse.org/eclipse/oniro-blueprints/core/pim435;protocol=https;branch=main"
SRCREV = "445ed623ec8d3ecbb1d566900b4ef3fb3031d689"
S = "${WORKDIR}/git"
DEPENDS = "i2c-tools"
EXTRA_OEMAKE += "DESTDIR=${D}"
do_install() {
oe_runmake install
}

View File

@@ -0,0 +1,30 @@
From 4c90a66fb7fd9dbb861c5a888fc828f3795fe540 Mon Sep 17 00:00:00 2001
From: Ben Brown <ben@demerara.io>
Date: Tue, 19 Jul 2022 16:12:12 +0100
Subject: [PATCH] Fix daemon install ignoring configured runstatedir
Upstream-Status: Backport
Signed-off-by: Ben Brown <ben@demerara.io>
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
---
src/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index ad3655d..abd7a4c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -37,7 +37,7 @@ escrow_PROGRAMS = plymouthd-fd-escrow
plymouthd_fd_escrow_SOURCES = plymouthd-fd-escrow.c
-plymouthdrundir = $(localstatedir)/run/plymouth
+plymouthdrundir = $(plymouthruntimedir)
plymouthdspooldir = $(localstatedir)/spool/plymouth
plymouthdtimedir = $(localstatedir)/lib/plymouth
--
2.25.1

View File

@@ -0,0 +1,34 @@
From 746c690f57b52e6fe21cc2a11b5bb71d25af3128 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Wed, 13 Dec 2017 16:15:57 +0100
Subject: [PATCH] Make full path to systemd-tty-ask-password-agent configurable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
configure.ac | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index aad673e..6b37179 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,7 +48,10 @@ PLYMOUTH_LIBS="-lm -lrt -ldl"
AC_SUBST(PLYMOUTH_CFLAGS)
AC_SUBST(PLYMOUTH_LIBS)
-AC_PATH_PROG([SYSTEMD_ASK_PASSWORD_AGENT], [systemd-tty-ask-password-agent])
+AC_ARG_WITH(systemd-tty-ask-password-agent, AS_HELP_STRING([--with-systemd-tty-ask-password-agent],[path of systemd-tty-ask-password-agent]),SYSTEMD_ASK_PASSWORD_AGENT=${withval},SYSTEMD_ASK_PASSWORD_AGENT=/bin/systemd-tty-ask-password-agent)
+AC_SUBST(SYSTEMD_ASK_PASSWORD_AGENT)
+
+# checked: UDEVADM is not used
AC_PATH_PROG([UDEVADM], [udevadm])
AC_ARG_ENABLE(pango, AS_HELP_STRING([--enable-pango],[enable building with pango, disabled there is no encryption prompts]),enable_pango=$enableval,enable_pango=yes)
--
2.9.5

View File

@@ -0,0 +1,50 @@
From 97012d2c38b84fffb32867fb5eeac64a93455626 Mon Sep 17 00:00:00 2001
From: Ben Brown <ben@demerara.io>
Date: Tue, 19 Jul 2022 16:10:24 +0100
Subject: [PATCH] Use standard runstatedir vs custom flag
Upstream-Status: Backport
---
configure.ac | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
Signed-off-by: Ben Brown <ben@demerara.io>
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
diff --git a/configure.ac b/configure.ac
index 608ad02..34a2f2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -140,9 +140,7 @@ if test x$enable_systemd_integration = xyes; then
AC_SUBST(SYSTEMD_UNIT_DIR)
fi
-AC_ARG_WITH([runtimedir],
- AC_HELP_STRING([--with-runtimedir=DIR], [runtime data dir [LOCALSTATEDIR/run]]),
- [plymouthruntimedir=${withval}/plymouth], [plymouthruntimedir=""])
+AC_ARG_WITH([runtimedir], [], [AC_MSG_ERROR([--with-runtimedir is obsolete, use --runstatedir instead])], [])
AC_ARG_WITH(system-root-install, AS_HELP_STRING([--with-system-root-install],[Install client in /bin and daemon in /sbin]),with_system_root_install=${withval},with_system_root_install=no)
AM_CONDITIONAL(WITH_SYSTEM_ROOT_INSTALL, [test "$with_system_root_install" = yes])
@@ -150,16 +148,11 @@ AM_CONDITIONAL(WITH_SYSTEM_ROOT_INSTALL, [test "$with_system_root_install" = ye
if test x$with_system_root_install = xyes; then
plymouthclientdir=/bin
plymouthdaemondir=/sbin
- if (test -z "${plymouthruntimedir}"); then
- plymouthruntimedir=/run/plymouth
- fi
else
plymouthclientdir=$bindir
plymouthdaemondir=$sbindir
- if (test -z "${plymouthruntimedir}"); then
- plymouthruntimedir=$localstatedir/run/plymouth
- fi
fi
+plymouthruntimedir=$runstatedir/plymouth
AC_SUBST(plymouthclientdir)
AC_SUBST(plymouthdaemondir)
AC_SUBST(plymouthruntimedir)
--
2.25.1

View File

@@ -0,0 +1,35 @@
From f270f80d4c36a22a0f7b8de8fb6b1abef6f7b183 Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Tue, 15 Feb 2022 16:23:10 +0800
Subject: [PATCH] plymouth : Add the retain-splash option
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Adding the "retain-splash” option to tell plymouth to keep the boot
splashs contents on screen even after plymouth exits to make the
splash screen show more friendly on the system which boots so fast.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
systemd-units/plymouth-quit.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/systemd-units/plymouth-quit.service.in b/systemd-units/plymouth-quit.service.in
index ed9f9b9..147e9ee 100644
--- a/systemd-units/plymouth-quit.service.in
+++ b/systemd-units/plymouth-quit.service.in
@@ -3,7 +3,7 @@ Description=Terminate Plymouth Boot Screen
After=rc-local.service plymouth-start.service systemd-user-sessions.service
[Service]
-ExecStart=-@PLYMOUTH_CLIENT_DIR@/plymouth quit
+ExecStart=-@PLYMOUTH_CLIENT_DIR@/plymouth quit --retain-splash
Type=oneshot
RemainAfterExit=yes
TimeoutSec=20
--
2.17.1

View File

@@ -0,0 +1,31 @@
From 658eac007d14d836cb002a5675487bac63d50324 Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Mon, 7 Feb 2022 03:22:12 +0000
Subject: [PATCH] plymouth-start.service.in: add related kernel parameter
Add extra kernel parameter to make the plymouth splash screen
display during boot.
Upstream-Status: Submitted [https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/156]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
systemd-units/plymouth-start.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/systemd-units/plymouth-start.service.in b/systemd-units/plymouth-start.service.in
index 830a62d..c20aabe 100644
--- a/systemd-units/plymouth-start.service.in
+++ b/systemd-units/plymouth-start.service.in
@@ -9,7 +9,7 @@ ConditionVirtualization=!container
IgnoreOnIsolate=true
[Service]
-ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=boot --pid-file=@plymouthruntimedir@/pid --attach-to-session
+ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=boot --kernel-command-line="splash plymouth.ignore-serial-consoles" --pid-file=@plymouthruntimedir@/pid --attach-to-session
ExecStartPost=-@PLYMOUTH_CLIENT_DIR@/plymouth show-splash
Type=forking
RemainAfterExit=yes
--
2.31.1

View File

@@ -0,0 +1,43 @@
From 9d0f8b2e7bc2d1d2b0900fcdf119bb9a2cc4f474 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 25 Aug 2020 10:49:11 -0400
Subject: [PATCH] systemd: switch to KillMode=mixed
KillMode=none is deprecated, so we need to stop using it.
For now, use `KillMode=mixed` and `IgnoreOnIsolate=true` instead.
In the future, we should change plymouth to be able to exit and
start again without restarting the active animation, but that's
going to require some effort.
https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/123
Upstream-Status: Backport [https://gitlab.freedesktop.org/plymouth/plymouth/-/commit/9d0f8b2e7bc2d1d2b0900fcdf119bb9a2cc4f474]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
systemd-units/plymouth-start.service.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/systemd-units/plymouth-start.service.in b/systemd-units/plymouth-start.service.in
index 3d00cc6..830a62d 100644
--- a/systemd-units/plymouth-start.service.in
+++ b/systemd-units/plymouth-start.service.in
@@ -6,11 +6,12 @@ After=systemd-vconsole-setup.service systemd-udev-trigger.service systemd-udevd.
Before=systemd-ask-password-plymouth.service
ConditionKernelCommandLine=!plymouth.enable=0
ConditionVirtualization=!container
+IgnoreOnIsolate=true
[Service]
ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=boot --pid-file=@plymouthruntimedir@/pid --attach-to-session
ExecStartPost=-@PLYMOUTH_CLIENT_DIR@/plymouth show-splash
Type=forking
RemainAfterExit=yes
-KillMode=none
+KillMode=mixed
SendSIGKILL=no
--
2.17.1

View File

@@ -0,0 +1,73 @@
SUMMARY = "Plymouth is a project from Fedora providing a flicker-free graphical boot process."
DESCRIPTION = "Plymouth is an application that runs very early in the boot process \
(even before the root filesystem is mounted!) that provides a \
graphical boot animation while the boot process happens in the background."
HOMEPAGE = "http://www.freedesktop.org/wiki/Software/Plymouth"
SECTION = "base"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
SRC_URI = " \
http://www.freedesktop.org/software/plymouth/releases/${BPN}-${PV}.tar.xz \
file://0001-Make-full-path-to-systemd-tty-ask-password-agent-con.patch \
file://0001-plymouth-start-service-in-add-related-kernel-paramet.patch \
file://0001-plymouth-Add-the-retain-splash-option.patch \
file://0001-Use-standard-runstatedir-vs-custom-flag.patch \
file://0001-Fix-daemon-install-ignoring-configured-runstatedir.patch \
"
SRC_URI[sha256sum] = "100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb"
LOGO ??= "${datadir}/plymouth/bizcom.png"
RUNSTATEDIR ??= "${localstatedir}/run"
EXTRA_OECONF = "--runstatedir=${RUNSTATEDIR}"
PACKAGECONFIG ??= "initrd logo pango udev ${@bb.utils.filter('DISTRO_FEATURES', 'systemd usrmerge', d)}"
PACKAGECONFIG:append:x86 = " drm"
PACKAGECONFIG:append:x86-64 = " drm"
PACKAGECONFIG[drm] = "--enable-drm,--disable-drm,libdrm"
PACKAGECONFIG[documentation] = "--enable-documentation,--disable-documentation"
PACKAGECONFIG[initrd] = ",,"
PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+3"
PACKAGECONFIG[logo] = "--with-logo=${LOGO},--without-logo"
PACKAGECONFIG[pango] = "--enable-pango,--disable-pango,pango"
PACKAGECONFIG[systemd] = "--enable-systemd-integration --with-systemd-tty-ask-password-agent=${base_bindir}/systemd-tty-ask-password-agent,--disable-systemd-integration,systemd"
PACKAGECONFIG[udev] = "--with-udev,--without-udev,udev"
PACKAGECONFIG[upstart-monitoring] = "--enable-upstart-monitoring,--disable-upstart-monitoring,ncurses dbus"
PACKAGECONFIG[usrmerge] = "--without-system-root-install,--with-system-root-install"
inherit autotools pkgconfig systemd gettext
do_install:append() {
# Remove /var/run from package as plymouth will populate it on startup
rm -fr ${D}${RUNSTATEDIR}
if ! ${@bb.utils.contains('PACKAGECONFIG', 'initrd', 'true', 'false', d)}; then
rm -rf "${D}${libexecdir}"
fi
}
PROVIDES = "virtual/psplash"
RPROVIDES:${PN} = "virtual-psplash virtual-psplash-support"
PACKAGES =. "${@bb.utils.contains('PACKAGECONFIG', 'initrd', '${PN}-initrd ', '', d)}"
PACKAGES =+ "${PN}-set-default-theme"
FILES:${PN}-initrd = "${libexecdir}/plymouth/*"
FILES:${PN}-set-default-theme = "${sbindir}/plymouth-set-default-theme"
FILES:${PN} += "${systemd_unitdir}/system/*"
FILES:${PN}-dbg += "${libdir}/plymouth/renderers/.debug"
DEPENDS = "libcap libpng"
DEPENDS:append:libc-musl = " musl-rpmatch"
LDFLAGS:append:libc-musl = " -lrpmatch"
RDEPENDS:${PN}-initrd = "bash dracut"
RDEPENDS:${PN}-set-default-theme = "bash"
SYSTEMD_SERVICE:${PN} = "plymouth-start.service"

View File

@@ -0,0 +1,34 @@
SUMMARY = "Proxy libintl"
HOMEPAGE = "http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/"
SECTION = "libs"
LICENSE = "LGPL-2.0-only"
LIC_FILES_CHKSUM = "file://src/proxy-libintl/COPYING.LIB.txt;md5=bc400bc21422f9a92e76ec2c5167ca2e"
PR = "r1"
PROVIDES = "virtual/libintl"
SRC_URI = " \
http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/${BPN}-dev_${PV}_win32.zip \
"
SRC_URI[md5sum] = "aef407c2b97ee829383aadd867c61d1e"
SRC_URI[sha256sum] = "291ac350cc5eb4a01b0d651ca99fae64cee8a1c06b2005277fab5a4356f9ae91"
S = "${WORKDIR}"
PACKAGES = "${PN} ${PN}-dev"
FILES:${PN}-dev = "${includedir}/libintl.h ${libdir}/libintl.a"
INSANE_SKIP:${PN}-dev = "staticdev"
ALLOW_EMPTY:${PN} = "1"
CFLAGS:append = " -fPIC -Wall -I ../../include ${@['-DSTUB_ONLY', ''][d.getVar('USE_NLS') != 'no']}"
TARGET_CC_ARCH += "${LDFLAGS}"
do_compile() {
cd ${WORKDIR}/src/proxy-libintl
oe_runmake ../../lib/libintl.a
}
do_install() {
install -d ${D}/${includedir}
install -d ${D}/${libdir}
install -m 0644 ${WORKDIR}/include/libintl.h ${D}/${includedir}
install -m 0644 ${WORKDIR}/lib/libintl.a ${D}/${libdir}
}

View File

@@ -0,0 +1,42 @@
From b1d7cc6495c541cdd99399b4d1a835997376dcbf Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 22 Aug 2022 23:42:33 -0700
Subject: [PATCH] strpbrk_s: Remove unused variable len
Fixes
error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
Upstream-Status: Submitted [https://github.com/rurban/safeclib/pull/123]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/extstr/strpbrk_s.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/extstr/strpbrk_s.c b/src/extstr/strpbrk_s.c
index 5bb7a0f8..2cf8a8be 100644
--- a/src/extstr/strpbrk_s.c
+++ b/src/extstr/strpbrk_s.c
@@ -79,7 +79,6 @@ EXPORT errno_t _strpbrk_s_chk(char *dest, rsize_t dmax, char *src, rsize_t slen,
#endif
{
char *ps;
- rsize_t len;
CHK_SRC_NULL("strpbrk_s", firstp)
*firstp = NULL;
@@ -121,7 +120,6 @@ EXPORT errno_t _strpbrk_s_chk(char *dest, rsize_t dmax, char *src, rsize_t slen,
while (*dest && dmax) {
ps = src;
- len = slen;
while (*ps) {
/* check for a match with the substring */
@@ -130,7 +128,6 @@ EXPORT errno_t _strpbrk_s_chk(char *dest, rsize_t dmax, char *src, rsize_t slen,
return RCNEGATE(EOK);
}
ps++;
- len--;
}
dest++;
dmax--;

View File

@@ -0,0 +1,21 @@
SUMMARY = "Safe C Library"
LICENSE = "safec"
LIC_FILES_CHKSUM = "file://COPYING;md5=6d0eb7dfc57806a006fcbc4e389cf164"
SECTION = "lib"
inherit autotools pkgconfig
S = "${WORKDIR}/git"
SRCREV = "f9add9245b97c7bda6e28cceb0ee37fb7e254fd8"
SRC_URI = "git://github.com/rurban/safeclib.git;branch=master;protocol=https \
file://0001-strpbrk_s-Remove-unused-variable-len.patch \
"
COMPATIBLE_HOST = '(x86_64|i.86|powerpc|powerpc64|arm|aarch64|mips).*-linux'
PACKAGES =+ "${PN}-check"
FILES:${PN}-check += "${bindir}/check_for_unsafe_apis"
RDEPENDS:${PN}-check += "perl"

View File

@@ -0,0 +1,15 @@
#!/bin/sh
set -e
set -o pipefail
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
${SCRIPTPATH}/../tests/sdbus-c++-unit-tests 2>&1 | \
sed -r 's/^\[\s+OK\s+\] (.*) \([0-9]+\sms\)$/OK: \1 /' | \
sed -r 's/^\[\s+FAILED\s+\] (.*) \([0-9]+\sms\)$/FAILED: \1 /' | \
awk '{if ($1 == "OK:" || $1 == "FAILED:") {print $0}}'
${SCRIPTPATH}/../tests/sdbus-c++-integration-tests 2>&1 | \
sed -r 's/^\[\s+OK\s+\] (.*) \([0-9]+\sms\)$/OK: \1 /' | \
sed -r 's/^\[\s+FAILED\s+\] (.*) \([0-9]+\sms\)$/FAILED: \1 /' | \
awk '{if ($1 == "OK:" || $1 == "FAILED:") {print $0}}'

View File

@@ -0,0 +1,453 @@
From 4c2e932664ec67662f4a0306cca4a7cd82853bda Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 21 Jan 2022 22:19:37 -0800
Subject: [PATCH] Adjust for musl headers
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/libsystemd-network/sd-dhcp6-client.c | 2 +-
src/network/netdev/bareudp.c | 2 +-
src/network/netdev/batadv.c | 2 +-
src/network/netdev/bond.c | 2 +-
src/network/netdev/bridge.c | 2 +-
src/network/netdev/dummy.c | 2 +-
src/network/netdev/geneve.c | 2 +-
src/network/netdev/ifb.c | 2 +-
src/network/netdev/ipoib.c | 2 +-
src/network/netdev/ipvlan.c | 2 +-
src/network/netdev/macsec.c | 2 +-
src/network/netdev/macvlan.c | 2 +-
src/network/netdev/netdev.c | 2 +-
src/network/netdev/netdevsim.c | 2 +-
src/network/netdev/nlmon.c | 2 +-
src/network/netdev/tunnel.c | 2 +-
src/network/netdev/vcan.c | 2 +-
src/network/netdev/veth.c | 2 +-
src/network/netdev/vlan.c | 2 +-
src/network/netdev/vrf.c | 2 +-
src/network/netdev/vxcan.c | 2 +-
src/network/netdev/vxlan.c | 2 +-
src/network/netdev/xfrm.c | 2 +-
src/network/networkd-bridge-mdb.c | 4 ++--
src/network/networkd-dhcp-common.c | 3 ++-
src/network/networkd-dhcp-prefix-delegation.c | 4 ++--
src/network/networkd-dhcp-server.c | 2 +-
src/network/networkd-dhcp4.c | 2 +-
src/network/networkd-link.c | 2 +-
src/network/networkd-route.c | 8 ++++----
src/network/networkd-setlink.c | 2 +-
src/shared/linux/ethtool.h | 3 ++-
src/shared/netif-util.c | 2 +-
src/udev/udev-builtin-net_id.c | 2 +-
34 files changed, 41 insertions(+), 39 deletions(-)
--- a/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/libsystemd-network/sd-dhcp6-client.c
@@ -5,7 +5,7 @@
#include <errno.h>
#include <sys/ioctl.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <linux/if_infiniband.h>
#include "sd-dhcp6-client.h"
--- a/src/network/netdev/bareudp.c
+++ b/src/network/netdev/bareudp.c
@@ -2,7 +2,7 @@
* Copyright © 2020 VMware, Inc. */
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "bareudp.h"
#include "netlink-util.h"
--- a/src/network/netdev/batadv.c
+++ b/src/network/netdev/batadv.c
@@ -3,7 +3,7 @@
#include <inttypes.h>
#include <netinet/in.h>
#include <linux/genetlink.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "batadv.h"
#include "fileio.h"
--- a/src/network/netdev/bond.c
+++ b/src/network/netdev/bond.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "alloc-util.h"
#include "bond.h"
--- a/src/network/netdev/bridge.c
+++ b/src/network/netdev/bridge.c
@@ -2,7 +2,7 @@
#include <net/if.h>
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <linux/if_bridge.h>
#include "bridge.h"
--- a/src/network/netdev/dummy.c
+++ b/src/network/netdev/dummy.c
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "dummy.h"
--- a/src/network/netdev/geneve.c
+++ b/src/network/netdev/geneve.c
@@ -2,7 +2,7 @@
#include <net/if.h>
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "alloc-util.h"
#include "conf-parser.h"
--- a/src/network/netdev/ifb.c
+++ b/src/network/netdev/ifb.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later
* Copyright © 2019 VMware, Inc. */
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "ifb.h"
--- a/src/network/netdev/ipoib.c
+++ b/src/network/netdev/ipoib.c
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <linux/if_link.h>
#include "ipoib.h"
--- a/src/network/netdev/ipvlan.c
+++ b/src/network/netdev/ipvlan.c
@@ -2,7 +2,7 @@
#include <net/if.h>
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "conf-parser.h"
#include "ipvlan.h"
--- a/src/network/netdev/macsec.c
+++ b/src/network/netdev/macsec.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <linux/if_ether.h>
#include <linux/if_macsec.h>
#include <linux/genetlink.h>
--- a/src/network/netdev/macvlan.c
+++ b/src/network/netdev/macvlan.c
@@ -2,7 +2,7 @@
#include <net/if.h>
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "conf-parser.h"
#include "macvlan.h"
--- a/src/network/netdev/netdev.c
+++ b/src/network/netdev/netdev.c
@@ -2,7 +2,7 @@
#include <net/if.h>
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <unistd.h>
#include "alloc-util.h"
--- a/src/network/netdev/netdevsim.c
+++ b/src/network/netdev/netdevsim.c
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "netdevsim.h"
--- a/src/network/netdev/nlmon.c
+++ b/src/network/netdev/nlmon.c
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "nlmon.h"
--- a/src/network/netdev/tunnel.c
+++ b/src/network/netdev/tunnel.c
@@ -2,7 +2,7 @@
#include <netinet/in.h>
#include <linux/fou.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <linux/if_tunnel.h>
#include <linux/ip.h>
#include <linux/ip6_tunnel.h>
--- a/src/network/netdev/vcan.c
+++ b/src/network/netdev/vcan.c
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "vcan.h"
--- a/src/network/netdev/veth.c
+++ b/src/network/netdev/veth.c
@@ -3,7 +3,7 @@
#include <errno.h>
#include <net/if.h>
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <linux/veth.h>
#include "netlink-util.h"
--- a/src/network/netdev/vlan.c
+++ b/src/network/netdev/vlan.c
@@ -2,7 +2,7 @@
#include <errno.h>
#include <net/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <linux/if_vlan.h>
#include "parse-util.h"
--- a/src/network/netdev/vrf.c
+++ b/src/network/netdev/vrf.c
@@ -2,7 +2,7 @@
#include <net/if.h>
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "vrf.h"
--- a/src/network/netdev/vxcan.c
+++ b/src/network/netdev/vxcan.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/can/vxcan.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "vxcan.h"
--- a/src/network/netdev/vxlan.c
+++ b/src/network/netdev/vxlan.c
@@ -2,7 +2,7 @@
#include <net/if.h>
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "conf-parser.h"
#include "alloc-util.h"
--- a/src/network/netdev/xfrm.c
+++ b/src/network/netdev/xfrm.c
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "missing_network.h"
#include "xfrm.h"
--- a/src/network/networkd-bridge-mdb.c
+++ b/src/network/networkd-bridge-mdb.c
@@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <net/if.h>
-#include <linux/if_bridge.h>
#include "netlink-util.h"
#include "networkd-bridge-mdb.h"
@@ -11,6 +9,8 @@
#include "networkd-queue.h"
#include "string-util.h"
#include "vlan-util.h"
+#include <net/if.h>
+#include <linux/if_bridge.h>
#define STATIC_BRIDGE_MDB_ENTRIES_PER_NETWORK_MAX 1024U
--- a/src/network/networkd-dhcp-common.c
+++ b/src/network/networkd-dhcp-common.c
@@ -1,7 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
+#include <net/if.h>
#include "bus-error.h"
#include "dhcp-identifier.h"
--- a/src/network/networkd-dhcp-prefix-delegation.c
+++ b/src/network/networkd-dhcp-prefix-delegation.c
@@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/ipv6_route.h>
-
#include "sd-dhcp6-client.h"
#include "hashmap.h"
@@ -21,6 +19,8 @@
#include "strv.h"
#include "tunnel.h"
+#include <linux/ipv6_route.h>
+
bool link_dhcp_pd_is_enabled(Link *link) {
assert(link);
--- a/src/network/networkd-dhcp-server.c
+++ b/src/network/networkd-dhcp-server.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <linux/if.h>
#include "sd-dhcp-server.h"
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -3,7 +3,7 @@
#include <netinet/in.h>
#include <netinet/ip.h>
#include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "alloc-util.h"
#include "dhcp-client-internal.h"
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -3,7 +3,7 @@
#include <net/if.h>
#include <netinet/in.h>
#include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <linux/if_link.h>
#include <linux/netdevice.h>
#include <sys/socket.h>
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -1,9 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/icmpv6.h>
-#include <linux/ipv6_route.h>
-#include <linux/nexthop.h>
-
#include "alloc-util.h"
#include "event-util.h"
#include "netlink-util.h"
@@ -21,6 +17,10 @@
#include "vrf.h"
#include "wireguard.h"
+#include <linux/icmpv6.h>
+#include <linux/ipv6_route.h>
+#include <linux/nexthop.h>
+
int route_new(Route **ret) {
_cleanup_(route_freep) Route *route = NULL;
--- a/src/network/networkd-setlink.c
+++ b/src/network/networkd-setlink.c
@@ -2,7 +2,7 @@
#include <netinet/in.h>
#include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <linux/if_bridge.h>
#include "missing_network.h"
--- a/src/shared/linux/ethtool.h
+++ b/src/shared/linux/ethtool.h
@@ -16,7 +16,8 @@
#include <linux/kernel.h>
#include <linux/types.h>
-#include <linux/if_ether.h>
+#include <netinet/if_ether.h>
+//#include <linux/if_ether.h>
#ifndef __KERNEL__
#include <limits.h> /* for INT_MAX */
--- a/src/shared/netif-util.c
+++ b/src/shared/netif-util.c
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include "arphrd-util.h"
#include "device-util.h"
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -18,7 +18,7 @@
#include <stdarg.h>
#include <unistd.h>
#include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <linux/netdevice.h>
#include <linux/pci_regs.h>
--- a/src/network/netdev/wireguard.c
+++ b/src/network/netdev/wireguard.c
@@ -6,7 +6,7 @@
#include <sys/ioctl.h>
#include <net/if.h>
#include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
#include <linux/ipv6_route.h>
#include "sd-resolve.h"

View File

@@ -0,0 +1,38 @@
From 19cc68d4a89b59889be442d2997ff030cdc3de73 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 20 Dec 2022 20:11:17 -0800
Subject: [PATCH] dirent-util: Remove asserts on dirent64 == dirent
We already have assert_cc(_FILE_OFFSET_BITS == 64) which ensures that 64bit LFS functions are same as their original counterparts
Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/25809]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/basic/dirent-util.h | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/src/basic/dirent-util.h b/src/basic/dirent-util.h
index 04bc53003f..4cb317184d 100644
--- a/src/basic/dirent-util.h
+++ b/src/basic/dirent-util.h
@@ -35,17 +35,6 @@ struct dirent *readdir_no_dot(DIR *dirp);
/* Only if 64bit off_t is enabled struct dirent + struct dirent64 are actually the same. We require this, and
* we want them to be interchangeable to make getdents64() work, hence verify that. */
assert_cc(_FILE_OFFSET_BITS == 64);
-assert_cc(sizeof(struct dirent) == sizeof(struct dirent64));
-assert_cc(offsetof(struct dirent, d_ino) == offsetof(struct dirent64, d_ino));
-assert_cc(sizeof_field(struct dirent, d_ino) == sizeof_field(struct dirent64, d_ino));
-assert_cc(offsetof(struct dirent, d_off) == offsetof(struct dirent64, d_off));
-assert_cc(sizeof_field(struct dirent, d_off) == sizeof_field(struct dirent64, d_off));
-assert_cc(offsetof(struct dirent, d_reclen) == offsetof(struct dirent64, d_reclen));
-assert_cc(sizeof_field(struct dirent, d_reclen) == sizeof_field(struct dirent64, d_reclen));
-assert_cc(offsetof(struct dirent, d_type) == offsetof(struct dirent64, d_type));
-assert_cc(sizeof_field(struct dirent, d_type) == sizeof_field(struct dirent64, d_type));
-assert_cc(offsetof(struct dirent, d_name) == offsetof(struct dirent64, d_name));
-assert_cc(sizeof_field(struct dirent, d_name) == sizeof_field(struct dirent64, d_name));
#define FOREACH_DIRENT_IN_BUFFER(de, buf, sz) \
for (void *_end = (uint8_t*) ({ (de) = (buf); }) + (sz); \
--
2.39.0

View File

@@ -0,0 +1,29 @@
From d16f7b37c917b91e951b9313e2c8264c72ed93e5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 21 Jan 2022 15:17:37 -0800
Subject: [PATCH 2/2] Add sys/stat.h for S_IFDIR
../git/src/shared/mkdir-label.c:13:61: error: use of undeclared identifier 'S_IFDIR'
r = mac_selinux_create_file_prepare_at(dirfd, path, S_IFDIR);
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/shared/mkdir-label.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/shared/mkdir-label.c b/src/shared/mkdir-label.c
index d36a6466d7..63b764cd83 100644
--- a/src/shared/mkdir-label.c
+++ b/src/shared/mkdir-label.c
@@ -4,6 +4,7 @@
#include "selinux-util.h"
#include "smack-util.h"
#include "user-util.h"
+#include <sys/stat.h>
int mkdirat_label(int dirfd, const char *path, mode_t mode) {
int r;
--
2.34.1

View File

@@ -0,0 +1,157 @@
From 5d730902f47498a2866b46875352f6810a01d67c Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 13:41:41 +0800
Subject: [PATCH] don't use glibc-specific qsort_r
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
[Rebased for v241]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
[Rebased for v242]
Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
[Rebased for v247]
Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
---
src/basic/sort-util.h | 14 --------------
src/shared/format-table.c | 36 ++++++++++++++++++++++++------------
src/shared/hwdb-util.c | 19 ++++++++++++++-----
3 files changed, 38 insertions(+), 31 deletions(-)
--- a/src/basic/sort-util.h
+++ b/src/basic/sort-util.h
@@ -61,18 +61,4 @@ static inline void _qsort_safe(void *bas
_qsort_safe((p), (n), sizeof((p)[0]), (comparison_fn_t) _func_); \
})
-static inline void qsort_r_safe(void *base, size_t nmemb, size_t size, comparison_userdata_fn_t compar, void *userdata) {
- if (nmemb <= 1)
- return;
-
- assert(base);
- qsort_r(base, nmemb, size, compar, userdata);
-}
-
-#define typesafe_qsort_r(p, n, func, userdata) \
- ({ \
- int (*_func_)(const typeof(p[0])*, const typeof(p[0])*, typeof(userdata)) = func; \
- qsort_r_safe((p), (n), sizeof((p)[0]), (comparison_userdata_fn_t) _func_, userdata); \
- })
-
int cmp_int(const int *a, const int *b);
--- a/src/shared/format-table.c
+++ b/src/shared/format-table.c
@@ -1324,30 +1324,32 @@ static int cell_data_compare(TableData *
return CMP(index_a, index_b);
}
-static int table_data_compare(const size_t *a, const size_t *b, Table *t) {
+static Table *user_table;
+static int table_data_compare(const void *x, const void *y) {
+ const size_t *a = x, *b=y;
int r;
- assert(t);
- assert(t->sort_map);
+ assert(user_table);
+ assert(user_table->sort_map);
/* Make sure the header stays at the beginning */
- if (*a < t->n_columns && *b < t->n_columns)
+ if (*a < user_table->n_columns && *b < user_table->n_columns)
return 0;
- if (*a < t->n_columns)
+ if (*a < user_table->n_columns)
return -1;
- if (*b < t->n_columns)
+ if (*b < user_table->n_columns)
return 1;
/* Order other lines by the sorting map */
- for (size_t i = 0; i < t->n_sort_map; i++) {
+ for (size_t i = 0; i < user_table->n_sort_map; i++) {
TableData *d, *dd;
- d = t->data[*a + t->sort_map[i]];
- dd = t->data[*b + t->sort_map[i]];
+ d = user_table->data[*a + user_table->sort_map[i]];
+ dd = user_table->data[*b + user_table->sort_map[i]];
r = cell_data_compare(d, *a, dd, *b);
if (r != 0)
- return t->reverse_map && t->reverse_map[t->sort_map[i]] ? -r : r;
+ return user_table->reverse_map && user_table->reverse_map[user_table->sort_map[i]] ? -r : r;
}
/* Order identical lines by the order there were originally added in */
@@ -2009,7 +2011,12 @@ int table_print(Table *t, FILE *f) {
for (size_t i = 0; i < n_rows; i++)
sorted[i] = i * t->n_columns;
- typesafe_qsort_r(sorted, n_rows, table_data_compare, t);
+ if (n_rows <= 1)
+ return 0;
+ assert(sorted);
+ user_table = t;
+ qsort(sorted, n_rows, sizeof(size_t), table_data_compare);
+ user_table = NULL;
}
if (t->display_map)
@@ -2647,7 +2654,12 @@ int table_to_json(Table *t, JsonVariant
for (size_t i = 0; i < n_rows; i++)
sorted[i] = i * t->n_columns;
- typesafe_qsort_r(sorted, n_rows, table_data_compare, t);
+ if (n_rows <= 1)
+ return 0;
+ assert(sorted);
+ user_table = t;
+ qsort(sorted, n_rows, sizeof(size_t), table_data_compare);
+ user_table = NULL;
}
if (t->display_map)
--- a/src/shared/hwdb-util.c
+++ b/src/shared/hwdb-util.c
@@ -127,9 +127,13 @@ static struct trie* trie_free(struct tri
DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free);
-static int trie_values_cmp(const struct trie_value_entry *a, const struct trie_value_entry *b, struct trie *trie) {
- return strcmp(trie->strings->buf + a->key_off,
- trie->strings->buf + b->key_off);
+static struct trie *trie_node_add_value_trie;
+static int trie_values_cmp(const void *v1, const void *v2) {
+ const struct trie_value_entry *a = v1;
+ const struct trie_value_entry *b = v2;
+
+ return strcmp(trie_node_add_value_trie->strings->buf + a->key_off,
+ trie_node_add_value_trie->strings->buf + b->key_off);
}
static int trie_node_add_value(struct trie *trie, struct trie_node *node,
@@ -157,7 +161,10 @@ static int trie_node_add_value(struct tr
.value_off = v,
};
- val = typesafe_bsearch_r(&search, node->values, node->values_count, trie_values_cmp, trie);
+ trie_node_add_value_trie = trie;
+ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
+ trie_node_add_value_trie = NULL;
+
if (val) {
/* At this point we have 2 identical properties on the same match-string.
* Since we process files in order, we just replace the previous value. */
@@ -183,7 +190,9 @@ static int trie_node_add_value(struct tr
.line_number = line_number,
};
node->values_count++;
- typesafe_qsort_r(node->values, node->values_count, trie_values_cmp, trie);
+ trie_node_add_value_trie = trie;
+ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
+ trie_node_add_value_trie = NULL;
return 0;
}

View File

@@ -0,0 +1,68 @@
From 3b42a888685aee1776a12cff84a5fe0063378483 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 13:55:12 +0800
Subject: [PATCH] missing_type.h: add __compare_fn_t and comparison_fn_t
Make it work with musl where comparison_fn_t and __compare_fn_t
is not provided.
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
[Rebased for v244]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
[Rebased for v242]
Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
---
src/basic/missing_type.h | 9 +++++++++
src/basic/sort-util.h | 1 +
src/core/kmod-setup.c | 1 +
src/libsystemd/sd-journal/catalog.c | 1 +
4 files changed, 12 insertions(+)
--- a/src/basic/missing_type.h
+++ b/src/basic/missing_type.h
@@ -10,3 +10,12 @@
#if !HAVE_CHAR16_T
#define char16_t uint16_t
#endif
+
+#ifndef __GLIBC__
+typedef int (*comparison_fn_t)(const void *, const void *);
+#endif
+
+#ifndef __COMPAR_FN_T
+#define __COMPAR_FN_T
+typedef int (*__compar_fn_t)(const void *, const void *);
+#endif
--- a/src/basic/sort-util.h
+++ b/src/basic/sort-util.h
@@ -4,6 +4,7 @@
#include <stdlib.h>
#include "macro.h"
+#include "missing_type.h"
/* This is the same as glibc's internal __compar_d_fn_t type. glibc exports a public comparison_fn_t, for the
* external type __compar_fn_t, but doesn't do anything similar for __compar_d_fn_t. Let's hence do that
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -10,6 +10,7 @@
#include "macro.h"
#include "recurse-dir.h"
#include "string-util.h"
+#include "missing_type.h"
#if HAVE_KMOD
#include "module-util.h"
--- a/src/libsystemd/sd-journal/catalog.c
+++ b/src/libsystemd/sd-journal/catalog.c
@@ -28,6 +28,7 @@
#include "string-util.h"
#include "strv.h"
#include "tmpfile-util.h"
+#include "missing_type.h"
const char * const catalog_file_dirs[] = {
"/usr/local/lib/systemd/catalog/",

View File

@@ -0,0 +1,419 @@
From 3e0df2c22bfd37bc62bf09a01ec498e40d3599de Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Sat, 22 May 2021 20:26:24 +0200
Subject: [PATCH] add fallback parse_printf_format implementation
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Emil Renner Berthing <systemd@esmil.dk>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
[rebased for systemd 243]
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
meson.build | 1 +
src/basic/meson.build | 5 +
src/basic/parse-printf-format.c | 273 +++++++++++++++++++++++
src/basic/parse-printf-format.h | 57 +++++
src/basic/stdio-util.h | 2 +-
src/libsystemd/sd-journal/journal-send.c | 2 +-
6 files changed, 338 insertions(+), 2 deletions(-)
create mode 100644 src/basic/parse-printf-format.c
create mode 100644 src/basic/parse-printf-format.h
--- a/meson.build
+++ b/meson.build
@@ -686,6 +686,7 @@ endif
foreach header : ['crypt.h',
'linux/memfd.h',
'linux/vm_sockets.h',
+ 'printf.h',
'sys/auxv.h',
'valgrind/memcheck.h',
'valgrind/valgrind.h',
--- a/src/basic/meson.build
+++ b/src/basic/meson.build
@@ -335,6 +335,11 @@ endforeach
basic_sources += generated_gperf_headers
+if conf.get('HAVE_PRINTF_H') != 1
+ basic_sources += [files('parse-printf-format.c')]
+endif
+
+
############################################################
arch_list = [
--- /dev/null
+++ b/src/basic/parse-printf-format.c
@@ -0,0 +1,273 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+ This file is part of systemd.
+
+ Copyright 2014 Emil Renner Berthing <systemd@esmil.dk>
+
+ With parts from the musl C library
+ Copyright 2005-2014 Rich Felker, et al.
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <stddef.h>
+#include <string.h>
+
+#include "parse-printf-format.h"
+
+static const char *consume_nonarg(const char *fmt)
+{
+ do {
+ if (*fmt == '\0')
+ return fmt;
+ } while (*fmt++ != '%');
+ return fmt;
+}
+
+static const char *consume_num(const char *fmt)
+{
+ for (;*fmt >= '0' && *fmt <= '9'; fmt++)
+ /* do nothing */;
+ return fmt;
+}
+
+static const char *consume_argn(const char *fmt, size_t *arg)
+{
+ const char *p = fmt;
+ size_t val = 0;
+
+ if (*p < '1' || *p > '9')
+ return fmt;
+ do {
+ val = 10*val + (*p++ - '0');
+ } while (*p >= '0' && *p <= '9');
+
+ if (*p != '$')
+ return fmt;
+ *arg = val;
+ return p+1;
+}
+
+static const char *consume_flags(const char *fmt)
+{
+ while (1) {
+ switch (*fmt) {
+ case '#':
+ case '0':
+ case '-':
+ case ' ':
+ case '+':
+ case '\'':
+ case 'I':
+ fmt++;
+ continue;
+ }
+ return fmt;
+ }
+}
+
+enum state {
+ BARE,
+ LPRE,
+ LLPRE,
+ HPRE,
+ HHPRE,
+ BIGLPRE,
+ ZTPRE,
+ JPRE,
+ STOP
+};
+
+enum type {
+ NONE,
+ PTR,
+ INT,
+ UINT,
+ ULLONG,
+ LONG,
+ ULONG,
+ SHORT,
+ USHORT,
+ CHAR,
+ UCHAR,
+ LLONG,
+ SIZET,
+ IMAX,
+ UMAX,
+ PDIFF,
+ UIPTR,
+ DBL,
+ LDBL,
+ MAXTYPE
+};
+
+static const short pa_types[MAXTYPE] = {
+ [NONE] = PA_INT,
+ [PTR] = PA_POINTER,
+ [INT] = PA_INT,
+ [UINT] = PA_INT,
+ [ULLONG] = PA_INT | PA_FLAG_LONG_LONG,
+ [LONG] = PA_INT | PA_FLAG_LONG,
+ [ULONG] = PA_INT | PA_FLAG_LONG,
+ [SHORT] = PA_INT | PA_FLAG_SHORT,
+ [USHORT] = PA_INT | PA_FLAG_SHORT,
+ [CHAR] = PA_CHAR,
+ [UCHAR] = PA_CHAR,
+ [LLONG] = PA_INT | PA_FLAG_LONG_LONG,
+ [SIZET] = PA_INT | PA_FLAG_LONG,
+ [IMAX] = PA_INT | PA_FLAG_LONG_LONG,
+ [UMAX] = PA_INT | PA_FLAG_LONG_LONG,
+ [PDIFF] = PA_INT | PA_FLAG_LONG_LONG,
+ [UIPTR] = PA_INT | PA_FLAG_LONG,
+ [DBL] = PA_DOUBLE,
+ [LDBL] = PA_DOUBLE | PA_FLAG_LONG_DOUBLE
+};
+
+#define S(x) [(x)-'A']
+#define E(x) (STOP + (x))
+
+static const unsigned char states[]['z'-'A'+1] = {
+ { /* 0: bare types */
+ S('d') = E(INT), S('i') = E(INT),
+ S('o') = E(UINT),S('u') = E(UINT),S('x') = E(UINT), S('X') = E(UINT),
+ S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
+ S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
+ S('c') = E(CHAR),S('C') = E(INT),
+ S('s') = E(PTR), S('S') = E(PTR), S('p') = E(UIPTR),S('n') = E(PTR),
+ S('m') = E(NONE),
+ S('l') = LPRE, S('h') = HPRE, S('L') = BIGLPRE,
+ S('z') = ZTPRE, S('j') = JPRE, S('t') = ZTPRE
+ }, { /* 1: l-prefixed */
+ S('d') = E(LONG), S('i') = E(LONG),
+ S('o') = E(ULONG),S('u') = E(ULONG),S('x') = E(ULONG),S('X') = E(ULONG),
+ S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
+ S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
+ S('c') = E(INT), S('s') = E(PTR), S('n') = E(PTR),
+ S('l') = LLPRE
+ }, { /* 2: ll-prefixed */
+ S('d') = E(LLONG), S('i') = E(LLONG),
+ S('o') = E(ULLONG),S('u') = E(ULLONG),
+ S('x') = E(ULLONG),S('X') = E(ULLONG),
+ S('n') = E(PTR)
+ }, { /* 3: h-prefixed */
+ S('d') = E(SHORT), S('i') = E(SHORT),
+ S('o') = E(USHORT),S('u') = E(USHORT),
+ S('x') = E(USHORT),S('X') = E(USHORT),
+ S('n') = E(PTR),
+ S('h') = HHPRE
+ }, { /* 4: hh-prefixed */
+ S('d') = E(CHAR), S('i') = E(CHAR),
+ S('o') = E(UCHAR),S('u') = E(UCHAR),
+ S('x') = E(UCHAR),S('X') = E(UCHAR),
+ S('n') = E(PTR)
+ }, { /* 5: L-prefixed */
+ S('e') = E(LDBL),S('f') = E(LDBL),S('g') = E(LDBL), S('a') = E(LDBL),
+ S('E') = E(LDBL),S('F') = E(LDBL),S('G') = E(LDBL), S('A') = E(LDBL),
+ S('n') = E(PTR)
+ }, { /* 6: z- or t-prefixed (assumed to be same size) */
+ S('d') = E(PDIFF),S('i') = E(PDIFF),
+ S('o') = E(SIZET),S('u') = E(SIZET),
+ S('x') = E(SIZET),S('X') = E(SIZET),
+ S('n') = E(PTR)
+ }, { /* 7: j-prefixed */
+ S('d') = E(IMAX), S('i') = E(IMAX),
+ S('o') = E(UMAX), S('u') = E(UMAX),
+ S('x') = E(UMAX), S('X') = E(UMAX),
+ S('n') = E(PTR)
+ }
+};
+
+size_t parse_printf_format(const char *fmt, size_t n, int *types)
+{
+ size_t i = 0;
+ size_t last = 0;
+
+ memset(types, 0, n);
+
+ while (1) {
+ size_t arg;
+ unsigned int state;
+
+ fmt = consume_nonarg(fmt);
+ if (*fmt == '\0')
+ break;
+ if (*fmt == '%') {
+ fmt++;
+ continue;
+ }
+ arg = 0;
+ fmt = consume_argn(fmt, &arg);
+ /* flags */
+ fmt = consume_flags(fmt);
+ /* width */
+ if (*fmt == '*') {
+ size_t warg = 0;
+ fmt = consume_argn(fmt+1, &warg);
+ if (warg == 0)
+ warg = ++i;
+ if (warg > last)
+ last = warg;
+ if (warg <= n && types[warg-1] == NONE)
+ types[warg-1] = INT;
+ } else
+ fmt = consume_num(fmt);
+ /* precision */
+ if (*fmt == '.') {
+ fmt++;
+ if (*fmt == '*') {
+ size_t parg = 0;
+ fmt = consume_argn(fmt+1, &parg);
+ if (parg == 0)
+ parg = ++i;
+ if (parg > last)
+ last = parg;
+ if (parg <= n && types[parg-1] == NONE)
+ types[parg-1] = INT;
+ } else {
+ if (*fmt == '-')
+ fmt++;
+ fmt = consume_num(fmt);
+ }
+ }
+ /* length modifier and conversion specifier */
+ state = BARE;
+ do {
+ unsigned char c = *fmt++;
+
+ if (c < 'A' || c > 'z')
+ continue;
+ state = states[state]S(c);
+ if (state == 0)
+ continue;
+ } while (state < STOP);
+
+ if (state == E(NONE))
+ continue;
+
+ if (arg == 0)
+ arg = ++i;
+ if (arg > last)
+ last = arg;
+ if (arg <= n)
+ types[arg-1] = state - STOP;
+ }
+
+ if (last > n)
+ last = n;
+ for (i = 0; i < last; i++)
+ types[i] = pa_types[types[i]];
+
+ return last;
+}
--- /dev/null
+++ b/src/basic/parse-printf-format.h
@@ -0,0 +1,57 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+ This file is part of systemd.
+
+ Copyright 2014 Emil Renner Berthing <systemd@esmil.dk>
+
+ With parts from the GNU C Library
+ Copyright 1991-2014 Free Software Foundation, Inc.
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#pragma once
+
+#include "config.h"
+
+#if HAVE_PRINTF_H
+#include <printf.h>
+#else
+
+#include <stddef.h>
+
+enum { /* C type: */
+ PA_INT, /* int */
+ PA_CHAR, /* int, cast to char */
+ PA_WCHAR, /* wide char */
+ PA_STRING, /* const char *, a '\0'-terminated string */
+ PA_WSTRING, /* const wchar_t *, wide character string */
+ PA_POINTER, /* void * */
+ PA_FLOAT, /* float */
+ PA_DOUBLE, /* double */
+ PA_LAST
+};
+
+/* Flag bits that can be set in a type returned by `parse_printf_format'. */
+#define PA_FLAG_MASK 0xff00
+#define PA_FLAG_LONG_LONG (1 << 8)
+#define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG
+#define PA_FLAG_LONG (1 << 9)
+#define PA_FLAG_SHORT (1 << 10)
+#define PA_FLAG_PTR (1 << 11)
+
+size_t parse_printf_format(const char *fmt, size_t n, int *types);
+
+#endif /* HAVE_PRINTF_H */
--- a/src/basic/stdio-util.h
+++ b/src/basic/stdio-util.h
@@ -1,13 +1,13 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <printf.h>
#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>
#include "macro.h"
#include "memory-util.h"
+#include "parse-printf-format.h"
#define snprintf_ok(buf, len, fmt, ...) \
({ \
--- a/src/libsystemd/sd-journal/journal-send.c
+++ b/src/libsystemd/sd-journal/journal-send.c
@@ -2,7 +2,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <printf.h>
#include <stddef.h>
#include <sys/un.h>
#include <unistd.h>
@@ -21,6 +20,7 @@
#include "stdio-util.h"
#include "string-util.h"
#include "tmpfile-util.h"
+#include "parse-printf-format.h"
#define SNDBUF_SIZE (8*1024*1024)

View File

@@ -0,0 +1,602 @@
From cef23a651ea200e30e1e6ed2a2564505e3a42d46 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 14:18:21 +0800
Subject: [PATCH] src/basic/missing.h: check for missing strndupa
include missing.h for definition of strndupa
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
[Rebased for v242]
Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
[rebased for systemd 243]
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
[rebased for systemd 244]
[Rebased for v247]
Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
---
meson.build | 1 +
src/backlight/backlight.c | 1 +
src/basic/cgroup-util.c | 1 +
src/basic/env-util.c | 1 +
src/basic/log.c | 1 +
src/basic/missing_stdlib.h | 12 ++++++++++++
src/basic/mkdir.c | 1 +
src/basic/mountpoint-util.c | 1 +
src/basic/parse-util.c | 1 +
src/basic/path-lookup.c | 1 +
src/basic/percent-util.c | 1 +
src/basic/proc-cmdline.c | 1 +
src/basic/procfs-util.c | 1 +
src/basic/time-util.c | 1 +
src/boot/bless-boot.c | 1 +
src/core/dbus-cgroup.c | 1 +
src/core/dbus-execute.c | 1 +
src/core/dbus-util.c | 1 +
src/core/execute.c | 1 +
src/core/kmod-setup.c | 1 +
src/core/service.c | 1 +
src/coredump/coredump-vacuum.c | 1 +
src/journal-remote/journal-remote-main.c | 1 +
src/journal/journalctl.c | 1 +
src/libsystemd/sd-bus/bus-message.c | 1 +
src/libsystemd/sd-bus/bus-objects.c | 1 +
src/libsystemd/sd-bus/bus-socket.c | 1 +
src/libsystemd/sd-bus/sd-bus.c | 1 +
src/libsystemd/sd-bus/test-bus-benchmark.c | 1 +
src/libsystemd/sd-journal/sd-journal.c | 1 +
src/locale/keymap-util.c | 1 +
src/login/pam_systemd.c | 1 +
src/network/generator/network-generator.c | 1 +
src/nspawn/nspawn-settings.c | 1 +
src/nss-mymachines/nss-mymachines.c | 1 +
src/portable/portable.c | 1 +
src/resolve/resolvectl.c | 1 +
src/shared/bus-get-properties.c | 1 +
src/shared/bus-unit-procs.c | 1 +
src/shared/bus-unit-util.c | 1 +
src/shared/bus-util.c | 1 +
src/shared/dns-domain.c | 1 +
src/shared/journal-importer.c | 1 +
src/shared/logs-show.c | 1 +
src/shared/pager.c | 1 +
src/shared/uid-range.c | 1 +
src/socket-proxy/socket-proxyd.c | 1 +
src/test/test-hexdecoct.c | 1 +
src/udev/udev-builtin-path_id.c | 1 +
src/udev/udev-event.c | 1 +
src/udev/udev-rules.c | 1 +
51 files changed, 62 insertions(+)
--- a/meson.build
+++ b/meson.build
@@ -507,6 +507,7 @@ foreach ident : ['secure_getenv', '__sec
endforeach
foreach ident : [
+ ['strndupa' , '''#include <string.h>'''],
['memfd_create', '''#include <sys/mman.h>'''],
['gettid', '''#include <sys/types.h>
#include <unistd.h>'''],
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -19,6 +19,7 @@
#include "string-util.h"
#include "strv.h"
#include "util.h"
+#include "missing_stdlib.h"
static int help(void) {
_cleanup_free_ char *link = NULL;
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -37,6 +37,7 @@
#include "unit-name.h"
#include "user-util.h"
#include "xattr-util.h"
+#include "missing_stdlib.h"
static int cg_enumerate_items(const char *controller, const char *path, FILE **_f, const char *item) {
_cleanup_free_ char *fs = NULL;
--- a/src/basic/env-util.c
+++ b/src/basic/env-util.c
@@ -19,6 +19,7 @@
#include "string-util.h"
#include "strv.h"
#include "utf8.h"
+#include "missing_stdlib.h"
/* We follow bash for the character set. Different shells have different rules. */
#define VALID_BASH_ENV_NAME_CHARS \
--- a/src/basic/log.c
+++ b/src/basic/log.c
@@ -36,6 +36,7 @@
#include "terminal-util.h"
#include "time-util.h"
#include "utf8.h"
+#include "missing_stdlib.h"
#define SNDBUF_SIZE (8*1024*1024)
--- a/src/basic/missing_stdlib.h
+++ b/src/basic/missing_stdlib.h
@@ -11,3 +11,15 @@
# error "neither secure_getenv nor __secure_getenv are available"
# endif
#endif
+
+/* string.h */
+#if ! HAVE_STRNDUPA
+#define strndupa(s, n) \
+ ({ \
+ const char *__old = (s); \
+ size_t __len = strnlen(__old, (n)); \
+ char *__new = (char *)alloca(__len + 1); \
+ __new[__len] = '\0'; \
+ (char *)memcpy(__new, __old, __len); \
+ })
+#endif
--- a/src/basic/mkdir.c
+++ b/src/basic/mkdir.c
@@ -15,6 +15,7 @@
#include "stat-util.h"
#include "stdio-util.h"
#include "user-util.h"
+#include "missing_stdlib.h"
int mkdir_safe_internal(
const char *path,
--- a/src/basic/mountpoint-util.c
+++ b/src/basic/mountpoint-util.c
@@ -13,6 +13,7 @@
#include "missing_stat.h"
#include "missing_syscall.h"
#include "mkdir.h"
+#include "missing_stdlib.h"
#include "mountpoint-util.h"
#include "nulstr-util.h"
#include "parse-util.h"
--- a/src/basic/parse-util.c
+++ b/src/basic/parse-util.c
@@ -18,6 +18,7 @@
#include "stat-util.h"
#include "string-util.h"
#include "strv.h"
+#include "missing_stdlib.h"
int parse_boolean(const char *v) {
if (!v)
--- a/src/basic/path-lookup.c
+++ b/src/basic/path-lookup.c
@@ -16,6 +16,7 @@
#include "strv.h"
#include "tmpfile-util.h"
#include "user-util.h"
+#include "missing_stdlib.h"
int xdg_user_runtime_dir(char **ret, const char *suffix) {
const char *e;
--- a/src/basic/percent-util.c
+++ b/src/basic/percent-util.c
@@ -3,6 +3,7 @@
#include "percent-util.h"
#include "string-util.h"
#include "parse-util.h"
+#include "missing_stdlib.h"
static int parse_parts_value_whole(const char *p, const char *symbol) {
const char *pc, *n;
--- a/src/basic/proc-cmdline.c
+++ b/src/basic/proc-cmdline.c
@@ -15,6 +15,7 @@
#include "string-util.h"
#include "util.h"
#include "virt.h"
+#include "missing_stdlib.h"
int proc_cmdline(char **ret) {
const char *e;
--- a/src/basic/procfs-util.c
+++ b/src/basic/procfs-util.c
@@ -12,6 +12,7 @@
#include "procfs-util.h"
#include "stdio-util.h"
#include "string-util.h"
+#include "missing_stdlib.h"
int procfs_get_pid_max(uint64_t *ret) {
_cleanup_free_ char *value = NULL;
--- a/src/basic/time-util.c
+++ b/src/basic/time-util.c
@@ -26,6 +26,7 @@
#include "string-util.h"
#include "strv.h"
#include "time-util.h"
+#include "missing_stdlib.h"
static clockid_t map_clock_id(clockid_t c) {
--- a/src/boot/bless-boot.c
+++ b/src/boot/bless-boot.c
@@ -19,6 +19,7 @@
#include "util.h"
#include "verbs.h"
#include "virt.h"
+#include "missing_stdlib.h"
static char **arg_path = NULL;
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -44,6 +44,7 @@
#include "unit-printf.h"
#include "user-util.h"
#include "utf8.h"
+#include "missing_stdlib.h"
BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_exec_output, exec_output, ExecOutput);
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_exec_input, exec_input, ExecInput);
--- a/src/core/dbus-util.c
+++ b/src/core/dbus-util.c
@@ -9,6 +9,7 @@
#include "unit-printf.h"
#include "user-util.h"
#include "unit.h"
+#include "missing_stdlib.h"
int bus_property_get_triggered_unit(
sd_bus *bus,
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -102,6 +102,7 @@
#include "unit-serialize.h"
#include "user-util.h"
#include "utmp-wtmp.h"
+#include "missing_stdlib.h"
#define IDLE_TIMEOUT_USEC (5*USEC_PER_SEC)
#define IDLE_TIMEOUT2_USEC (1*USEC_PER_SEC)
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -11,6 +11,7 @@
#include "recurse-dir.h"
#include "string-util.h"
#include "missing_type.h"
+#include "missing_stdlib.h"
#if HAVE_KMOD
#include "module-util.h"
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -42,6 +42,7 @@
#include "unit.h"
#include "utf8.h"
#include "util.h"
+#include "missing_stdlib.h"
static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = {
[SERVICE_DEAD] = UNIT_INACTIVE,
--- a/src/coredump/coredump-vacuum.c
+++ b/src/coredump/coredump-vacuum.c
@@ -16,6 +16,7 @@
#include "string-util.h"
#include "time-util.h"
#include "user-util.h"
+#include "missing_stdlib.h"
#define DEFAULT_MAX_USE_LOWER (uint64_t) (1ULL*1024ULL*1024ULL) /* 1 MiB */
#define DEFAULT_MAX_USE_UPPER (uint64_t) (4ULL*1024ULL*1024ULL*1024ULL) /* 4 GiB */
--- a/src/journal-remote/journal-remote-main.c
+++ b/src/journal-remote/journal-remote-main.c
@@ -24,6 +24,7 @@
#include "stat-util.h"
#include "string-table.h"
#include "strv.h"
+#include "missing_stdlib.h"
#define PRIV_KEY_FILE CERTIFICATE_ROOT "/private/journal-remote.pem"
#define CERT_FILE CERTIFICATE_ROOT "/certs/journal-remote.pem"
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -73,6 +73,7 @@
#include "unit-name.h"
#include "user-util.h"
#include "varlink.h"
+#include "missing_stdlib.h"
#define DEFAULT_FSS_INTERVAL_USEC (15*USEC_PER_MINUTE)
#define PROCESS_INOTIFY_INTERVAL 1024 /* Every 1,024 messages processed */
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -20,6 +20,7 @@
#include "strv.h"
#include "time-util.h"
#include "utf8.h"
+#include "missing_stdlib.h"
static int message_append_basic(sd_bus_message *m, char type, const void *p, const void **stored);
--- a/src/libsystemd/sd-bus/bus-objects.c
+++ b/src/libsystemd/sd-bus/bus-objects.c
@@ -11,6 +11,7 @@
#include "missing_capability.h"
#include "string-util.h"
#include "strv.h"
+#include "missing_stdlib.h"
static int node_vtable_get_userdata(
sd_bus *bus,
--- a/src/libsystemd/sd-bus/bus-socket.c
+++ b/src/libsystemd/sd-bus/bus-socket.c
@@ -28,6 +28,7 @@
#include "string-util.h"
#include "user-util.h"
#include "utf8.h"
+#include "missing_stdlib.h"
#define SNDBUF_SIZE (8*1024*1024)
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -43,6 +43,7 @@
#include "string-util.h"
#include "strv.h"
#include "user-util.h"
+#include "missing_stdlib.h"
#define log_debug_bus_message(m) \
do { \
--- a/src/libsystemd/sd-bus/test-bus-benchmark.c
+++ b/src/libsystemd/sd-bus/test-bus-benchmark.c
@@ -14,6 +14,7 @@
#include "string-util.h"
#include "time-util.h"
#include "util.h"
+#include "missing_stdlib.h"
#define MAX_SIZE (2*1024*1024)
--- a/src/libsystemd/sd-journal/sd-journal.c
+++ b/src/libsystemd/sd-journal/sd-journal.c
@@ -41,6 +41,7 @@
#include "string-util.h"
#include "strv.h"
#include "syslog-util.h"
+#include "missing_stdlib.h"
#define JOURNAL_FILES_MAX 7168
--- a/src/locale/keymap-util.c
+++ b/src/locale/keymap-util.c
@@ -24,6 +24,7 @@
#include "string-util.h"
#include "strv.h"
#include "tmpfile-util.h"
+#include "missing_stdlib.h"
static bool startswith_comma(const char *s, const char *prefix) {
s = startswith(s, prefix);
--- a/src/login/pam_systemd.c
+++ b/src/login/pam_systemd.c
@@ -31,6 +31,7 @@
#include "locale-util.h"
#include "login-util.h"
#include "macro.h"
+#include "missing_stdlib.h"
#include "pam-util.h"
#include "parse-util.h"
#include "path-util.h"
--- a/src/network/generator/network-generator.c
+++ b/src/network/generator/network-generator.c
@@ -13,6 +13,7 @@
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
+#include "missing_stdlib.h"
/*
# .network
--- a/src/nspawn/nspawn-settings.c
+++ b/src/nspawn/nspawn-settings.c
@@ -17,6 +17,7 @@
#include "strv.h"
#include "user-util.h"
#include "util.h"
+#include "missing_stdlib.h"
Settings *settings_new(void) {
Settings *s;
--- a/src/nss-mymachines/nss-mymachines.c
+++ b/src/nss-mymachines/nss-mymachines.c
@@ -21,6 +21,7 @@
#include "nss-util.h"
#include "signal-util.h"
#include "string-util.h"
+#include "missing_stdlib.h"
static void setup_logging_once(void) {
static pthread_once_t once = PTHREAD_ONCE_INIT;
--- a/src/portable/portable.c
+++ b/src/portable/portable.c
@@ -39,6 +39,7 @@
#include "strv.h"
#include "tmpfile-util.h"
#include "user-util.h"
+#include "missing_stdlib.h"
/* Markers used in the first line of our 20-portable.conf unit file drop-in to determine, that a) the unit file was
* dropped there by the portable service logic and b) for which image it was dropped there. */
--- a/src/resolve/resolvectl.c
+++ b/src/resolve/resolvectl.c
@@ -43,6 +43,7 @@
#include "utf8.h"
#include "verb-log-control.h"
#include "verbs.h"
+#include "missing_stdlib.h"
static int arg_family = AF_UNSPEC;
static int arg_ifindex = 0;
--- a/src/shared/bus-get-properties.c
+++ b/src/shared/bus-get-properties.c
@@ -4,6 +4,7 @@
#include "rlimit-util.h"
#include "stdio-util.h"
#include "string-util.h"
+#include "missing_stdlib.h"
int bus_property_get_bool(
sd_bus *bus,
--- a/src/shared/bus-unit-procs.c
+++ b/src/shared/bus-unit-procs.c
@@ -10,6 +10,7 @@
#include "sort-util.h"
#include "string-util.h"
#include "terminal-util.h"
+#include "missing_stdlib.h"
struct CGroupInfo {
char *cgroup_path;
--- a/src/shared/bus-unit-util.c
+++ b/src/shared/bus-unit-util.c
@@ -49,6 +49,7 @@
#include "unit-def.h"
#include "user-util.h"
#include "utf8.h"
+#include "missing_stdlib.h"
int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) {
assert(message);
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -21,6 +21,7 @@
#include "path-util.h"
#include "socket-util.h"
#include "stdio-util.h"
+#include "missing_stdlib.h"
static int name_owner_change_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
sd_event *e = userdata;
--- a/src/shared/dns-domain.c
+++ b/src/shared/dns-domain.c
@@ -17,6 +17,7 @@
#include "string-util.h"
#include "strv.h"
#include "utf8.h"
+#include "missing_stdlib.h"
int dns_label_unescape(const char **name, char *dest, size_t sz, DNSLabelFlags flags) {
const char *n;
--- a/src/shared/journal-importer.c
+++ b/src/shared/journal-importer.c
@@ -15,6 +15,7 @@
#include "parse-util.h"
#include "string-util.h"
#include "unaligned.h"
+#include "missing_stdlib.h"
enum {
IMPORTER_STATE_LINE = 0, /* waiting to read, or reading line */
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -42,6 +42,7 @@
#include "utf8.h"
#include "util.h"
#include "web-util.h"
+#include "missing_stdlib.h"
/* up to three lines (each up to 100 characters) or 300 characters, whichever is less */
#define PRINT_LINE_THRESHOLD 3
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -26,6 +26,7 @@
#include "strv.h"
#include "terminal-util.h"
#include "util.h"
+#include "missing_stdlib.h"
static pid_t pager_pid = 0;
--- a/src/shared/uid-range.c
+++ b/src/shared/uid-range.c
@@ -9,6 +9,7 @@
#include "sort-util.h"
#include "uid-range.h"
#include "user-util.h"
+#include "missing_stdlib.h"
static bool uid_range_intersect(UidRange *range, uid_t start, uid_t nr) {
assert(range);
--- a/src/socket-proxy/socket-proxyd.c
+++ b/src/socket-proxy/socket-proxyd.c
@@ -26,6 +26,7 @@
#include "socket-util.h"
#include "string-util.h"
#include "util.h"
+#include "missing_stdlib.h"
#define BUFFER_SIZE (256 * 1024)
--- a/src/test/test-hexdecoct.c
+++ b/src/test/test-hexdecoct.c
@@ -7,6 +7,7 @@
#include "macro.h"
#include "random-util.h"
#include "string-util.h"
+#include "missing_stdlib.h"
#include "tests.h"
TEST(hexchar) {
--- a/src/udev/udev-builtin-path_id.c
+++ b/src/udev/udev-builtin-path_id.c
@@ -22,6 +22,7 @@
#include "sysexits.h"
#include "udev-builtin.h"
#include "udev-util.h"
+#include "missing_stdlib.h"
_printf_(2,3)
static void path_prepend(char **path, const char *fmt, ...) {
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -35,6 +35,7 @@
#include "udev-util.h"
#include "udev-watch.h"
#include "user-util.h"
+#include "missing_stdlib.h"
typedef struct Spawn {
sd_device *device;
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -34,6 +34,7 @@
#include "udev-util.h"
#include "user-util.h"
#include "virt.h"
+#include "missing_stdlib.h"
#define RULES_DIRS (const char* const*) CONF_PATHS_STRV("udev/rules.d")
--- a/src/core/dbus-cgroup.c
+++ b/src/core/dbus-cgroup.c
@@ -21,6 +21,7 @@
#include "parse-util.h"
#include "path-util.h"
#include "percent-util.h"
+#include "missing_stdlib.h"
#include "socket-util.h"
BUS_DEFINE_PROPERTY_GET(bus_property_get_tasks_max, "t", TasksMax, tasks_max_resolve);
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -29,6 +29,7 @@
#include "util.h"
#include "virt.h"
#include "volatile-util.h"
+#include "missing_stdlib.h"
typedef enum MountPointFlags {
MOUNT_NOAUTO = 1 << 0,

View File

@@ -0,0 +1,147 @@
From fb068403b25002156435350165ea418a6338a313 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 14:56:21 +0800
Subject: [PATCH] don't fail if GLOB_BRACE and GLOB_ALTDIRFUNC is not defined
If the standard library doesn't provide brace
expansion users just won't get it.
Dont use GNU GLOB extentions on non-glibc systems
Conditionalize use of GLOB_ALTDIRFUNC
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
[rebased for systemd 243]
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
src/basic/glob-util.c | 12 ++++++++++++
src/test/test-glob-util.c | 16 ++++++++++++++++
src/tmpfiles/tmpfiles.c | 10 ++++++++++
3 files changed, 38 insertions(+)
--- a/src/basic/glob-util.c
+++ b/src/basic/glob-util.c
@@ -12,6 +12,12 @@
#include "path-util.h"
#include "strv.h"
+/* Don't fail if the standard library
+ * doesn't provide brace expansion */
+#ifndef GLOB_BRACE
+#define GLOB_BRACE 0
+#endif
+
static void closedir_wrapper(void* v) {
(void) closedir(v);
}
@@ -19,6 +25,7 @@ static void closedir_wrapper(void* v) {
int safe_glob(const char *path, int flags, glob_t *pglob) {
int k;
+#ifdef GLOB_ALTDIRFUNC
/* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */
assert(!(flags & GLOB_ALTDIRFUNC));
@@ -32,9 +39,14 @@ int safe_glob(const char *path, int flag
pglob->gl_lstat = lstat;
if (!pglob->gl_stat)
pglob->gl_stat = stat;
+#endif
errno = 0;
+#ifdef GLOB_ALTDIRFUNC
k = glob(path, flags | GLOB_ALTDIRFUNC, NULL, pglob);
+#else
+ k = glob(path, flags, NULL, pglob);
+#endif
if (k == GLOB_NOMATCH)
return -ENOENT;
if (k == GLOB_NOSPACE)
--- a/src/test/test-glob-util.c
+++ b/src/test/test-glob-util.c
@@ -13,6 +13,12 @@
#include "tests.h"
#include "tmpfile-util.h"
+/* Don't fail if the standard library
+ * doesn't provide brace expansion */
+#ifndef GLOB_BRACE
+#define GLOB_BRACE 0
+#endif
+
TEST(glob_exists) {
char name[] = "/tmp/test-glob_exists.XXXXXX";
int fd = -1;
@@ -40,11 +46,13 @@ TEST(glob_no_dot) {
const char *fn;
_cleanup_globfree_ glob_t g = {
+#ifdef GLOB_ALTDIRFUNC
.gl_closedir = closedir_wrapper,
.gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot,
.gl_opendir = (void *(*)(const char *)) opendir,
.gl_lstat = lstat,
.gl_stat = stat,
+#endif
};
int r;
@@ -52,11 +60,19 @@ TEST(glob_no_dot) {
assert_se(mkdtemp(template));
fn = strjoina(template, "/*");
+#ifdef GLOB_ALTDIRFUNC
r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
+#else
+ r = glob(fn, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
+#endif
assert_se(r == GLOB_NOMATCH);
fn = strjoina(template, "/.*");
+#ifdef GLOB_ALTDIRFUNC
r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
+#else
+ r = glob(fn, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
+#endif
assert_se(r == GLOB_NOMATCH);
(void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL);
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -67,6 +67,12 @@
#include "umask-util.h"
#include "user-util.h"
+/* Don't fail if the standard library
+ * doesn't provide brace expansion */
+#ifndef GLOB_BRACE
+#define GLOB_BRACE 0
+#endif
+
/* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
* them in the file system. This is intended to be used to create
* properly owned directories beneath /tmp, /var/tmp, /run, which are
@@ -1961,7 +1967,9 @@ finish:
static int glob_item(Item *i, action_t action) {
_cleanup_globfree_ glob_t g = {
+#ifdef GLOB_ALTDIRFUNC
.gl_opendir = (void *(*)(const char *)) opendir_nomod,
+#endif
};
int r = 0, k;
char **fn;
@@ -1981,7 +1989,9 @@ static int glob_item(Item *i, action_t a
static int glob_item_recursively(Item *i, fdaction_t action) {
_cleanup_globfree_ glob_t g = {
+#ifdef GLOB_ALTDIRFUNC
.gl_opendir = (void *(*)(const char *)) opendir_nomod,
+#endif
};
int r = 0, k;
char **fn;

View File

@@ -0,0 +1,64 @@
From 7ca9887f84adba065dc2e59b3de55ace2fc72ec0 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 15:00:06 +0800
Subject: [PATCH] add missing FTW_ macros for musl
This is to avoid build failures like below for musl.
locale-util.c:296:24: error: 'FTW_STOP' undeclared
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/basic/missing_type.h | 20 ++++++++++++++++++++
src/shared/mount-setup.c | 1 +
2 files changed, 21 insertions(+)
--- a/src/basic/missing_type.h
+++ b/src/basic/missing_type.h
@@ -19,3 +19,23 @@ typedef int (*comparison_fn_t)(const voi
#define __COMPAR_FN_T
typedef int (*__compar_fn_t)(const void *, const void *);
#endif
+
+#ifndef FTW_ACTIONRETVAL
+#define FTW_ACTIONRETVAL 16
+#endif
+
+#ifndef FTW_CONTINUE
+#define FTW_CONTINUE 0
+#endif
+
+#ifndef FTW_STOP
+#define FTW_STOP 1
+#endif
+
+#ifndef FTW_SKIP_SUBTREE
+#define FTW_SKIP_SUBTREE 2
+#endif
+
+#ifndef FTW_SKIP_SIBLINGS
+#define FTW_SKIP_SIBLINGS 3
+#endif
--- a/src/shared/mount-setup.c
+++ b/src/shared/mount-setup.c
@@ -32,6 +32,7 @@
#include "strv.h"
#include "user-util.h"
#include "virt.h"
+#include "missing_type.h"
typedef enum MountMode {
MNT_NONE = 0,
--- a/src/test/test-recurse-dir.c
+++ b/src/test/test-recurse-dir.c
@@ -6,6 +6,7 @@
#include "recurse-dir.h"
#include "strv.h"
#include "tests.h"
+#include "missing_type.h"
static char **list_nftw = NULL;

View File

@@ -0,0 +1,43 @@
From c7453b716ae308b89cf4b2b231a36ddd38a49752 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 15:03:47 +0800
Subject: [PATCH] fix missing of __register_atfork for non-glibc builds
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/basic/process-util.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index 461bbfe9a5..2d06f9f60a 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -18,6 +18,9 @@
#if HAVE_VALGRIND_VALGRIND_H
#include <valgrind/valgrind.h>
#endif
+#ifndef __GLIBC__
+#include <pthread.h>
+#endif
#include "alloc-util.h"
#include "architecture.h"
@@ -1202,11 +1205,15 @@ void reset_cached_pid(void) {
cached_pid = CACHED_PID_UNSET;
}
+#ifdef __GLIBC__
/* We use glibc __register_atfork() + __dso_handle directly here, as they are not included in the glibc
* headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against
* libpthread, as it is part of glibc anyway. */
extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void *dso_handle);
extern void* __dso_handle _weak_;
+#else
+#define __register_atfork(prepare,parent,child,dso) pthread_atfork(prepare,parent,child)
+#endif
pid_t getpid_cached(void) {
static bool installed = false;

View File

@@ -0,0 +1,98 @@
From 856010e268a6aca8e5f02502457afe289bd877f1 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 15:12:41 +0800
Subject: [PATCH] Use uintmax_t for handling rlim_t
PRIu{32,64} is not right format to represent rlim_t type
therefore use %ju and typecast the rlim_t variables to
uintmax_t.
Fixes portablility errors like
execute.c:3446:36: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'rlim_t {aka long long unsigned int}' [-Werror=format=]
| fprintf(f, "%s%s: " RLIM_FMT "\n",
| ^~~~~~~~
| prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
| ~~~~~~~~~~~~~~~~~~~~~~
Upstream-Status: Denied [https://github.com/systemd/systemd/pull/7199]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
[Rebased for v241]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/basic/format-util.h | 8 +-------
src/basic/rlimit-util.c | 12 ++++++------
src/core/execute.c | 4 ++--
3 files changed, 9 insertions(+), 15 deletions(-)
--- a/src/basic/format-util.h
+++ b/src/basic/format-util.h
@@ -34,13 +34,7 @@ assert_cc(sizeof(gid_t) == sizeof(uint32
# error Unknown timex member size
#endif
-#if SIZEOF_RLIM_T == 8
-# define RLIM_FMT "%" PRIu64
-#elif SIZEOF_RLIM_T == 4
-# define RLIM_FMT "%" PRIu32
-#else
-# error Unknown rlim_t size
-#endif
+#define RLIM_FMT "%ju"
#if SIZEOF_DEV_T == 8
# define DEV_FMT "%" PRIu64
--- a/src/basic/rlimit-util.c
+++ b/src/basic/rlimit-util.c
@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, cons
fixed.rlim_max == highest.rlim_max)
return 0;
- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
+ log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
return RET_NERRNO(setrlimit(resource, &fixed));
}
@@ -307,13 +307,13 @@ int rlimit_format(const struct rlimit *r
if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY)
r = free_and_strdup(&s, "infinity");
else if (rl->rlim_cur >= RLIM_INFINITY)
- r = asprintf(&s, "infinity:" RLIM_FMT, rl->rlim_max);
+ r = asprintf(&s, "infinity:" RLIM_FMT, (uintmax_t)rl->rlim_max);
else if (rl->rlim_max >= RLIM_INFINITY)
- r = asprintf(&s, RLIM_FMT ":infinity", rl->rlim_cur);
+ r = asprintf(&s, RLIM_FMT ":infinity", (uintmax_t)rl->rlim_cur);
else if (rl->rlim_cur == rl->rlim_max)
- r = asprintf(&s, RLIM_FMT, rl->rlim_cur);
+ r = asprintf(&s, RLIM_FMT, (uintmax_t)rl->rlim_cur);
else
- r = asprintf(&s, RLIM_FMT ":" RLIM_FMT, rl->rlim_cur, rl->rlim_max);
+ r = asprintf(&s, RLIM_FMT ":" RLIM_FMT, (uintmax_t)rl->rlim_cur, (uintmax_t)rl->rlim_max);
if (r < 0)
return -ENOMEM;
@@ -403,7 +403,7 @@ int rlimit_nofile_safe(void) {
rl.rlim_cur = FD_SETSIZE;
if (setrlimit(RLIMIT_NOFILE, &rl) < 0)
- return log_debug_errno(errno, "Failed to lower RLIMIT_NOFILE's soft limit to " RLIM_FMT ": %m", rl.rlim_cur);
+ return log_debug_errno(errno, "Failed to lower RLIMIT_NOFILE's soft limit to " RLIM_FMT ": %m", (uintmax_t)rl.rlim_cur);
return 1;
}
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -5639,9 +5639,9 @@ void exec_context_dump(const ExecContext
for (unsigned i = 0; i < RLIM_NLIMITS; i++)
if (c->rlimit[i]) {
fprintf(f, "%sLimit%s: " RLIM_FMT "\n",
- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_max);
fprintf(f, "%sLimit%sSoft: " RLIM_FMT "\n",
- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_cur);
+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_cur);
}
if (c->ioprio_set) {

View File

@@ -0,0 +1,37 @@
From ad395dda5db9b1ae156be121cfc8a38960de6c55 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Wed, 28 Feb 2018 21:25:22 -0800
Subject: [PATCH] test-sizeof.c: Disable tests for missing typedefs in musl
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/test/test-sizeof.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/src/test/test-sizeof.c
+++ b/src/test/test-sizeof.c
@@ -55,8 +55,10 @@ int main(void) {
info(unsigned);
info(long unsigned);
info(long long unsigned);
+#ifdef __GLIBC__
info(__syscall_ulong_t);
info(__syscall_slong_t);
+#endif
info(intmax_t);
info(uintmax_t);
@@ -76,7 +78,9 @@ int main(void) {
info(ssize_t);
info(time_t);
info(usec_t);
+#ifdef __GLIBC__
info(__time_t);
+#endif
info(pid_t);
info(uid_t);
info(gid_t);

View File

@@ -0,0 +1,93 @@
From 5d4c6b2f4b88b69b31f967371d2a6136c65dc3fd Mon Sep 17 00:00:00 2001
From: Andre McCurdy <armccurdy@gmail.com>
Date: Tue, 10 Oct 2017 14:33:30 -0700
Subject: [PATCH] don't pass AT_SYMLINK_NOFOLLOW flag to faccessat()
Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right
thing to do and it's not portable (not supported by musl). See:
http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003610.html
http://www.openwall.com/lists/musl/2015/02/05/2
Note that laccess() is never passing AT_EACCESS so a lot of the
discussion in the links above doesn't apply. Note also that
(currently) all systemd callers of laccess() pass mode as F_OK, so
only check for existence of a file, not access permissions.
Therefore, in this case, the only distiction between faccessat()
with (flag == 0) and (flag == AT_SYMLINK_NOFOLLOW) is the behaviour
for broken symlinks; laccess() on a broken symlink will succeed with
(flag == AT_SYMLINK_NOFOLLOW) and fail (flag == 0).
The laccess() macros was added to systemd some time ago and it's not
clear if or why it needs to return success for broken symlinks. Maybe
just historical and not actually necessary or desired behaviour?
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
src/basic/fs-util.h | 23 +++++++++++++++++++++--
src/shared/base-filesystem.c | 6 +++---
2 files changed, 24 insertions(+), 5 deletions(-)
--- a/src/basic/fs-util.h
+++ b/src/basic/fs-util.h
@@ -46,8 +46,27 @@ int futimens_opath(int fd, const struct
int fd_warn_permissions(const char *path, int fd);
int stat_warn_permissions(const char *path, const struct stat *st);
+/*
+ Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right thing to
+ do and it's not portable (not supported by musl). See:
+
+ http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003610.html
+ http://www.openwall.com/lists/musl/2015/02/05/2
+
+ Note that laccess() is never passing AT_EACCESS so a lot of the discussion in
+ the links above doesn't apply. Note also that (currently) all systemd callers
+ of laccess() pass mode as F_OK, so only check for existence of a file, not
+ access permissions. Therefore, in this case, the only distiction between
+ faccessat() with (flag == 0) and (flag == AT_SYMLINK_NOFOLLOW) is the
+ behaviour for broken symlinks; laccess() on a broken symlink will succeed
+ with (flag == AT_SYMLINK_NOFOLLOW) and fail (flag == 0).
+
+ The laccess() macros was added to systemd some time ago and it's not clear if
+ or why it needs to return success for broken symlinks. Maybe just historical
+ and not actually necessary or desired behaviour?
+*/
#define laccess(path, mode) \
- RET_NERRNO(faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW))
+ RET_NERRNO(faccessat(AT_FDCWD, (path), (mode), 0))
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
int touch(const char *path);
--- a/src/shared/base-filesystem.c
+++ b/src/shared/base-filesystem.c
@@ -117,7 +117,7 @@ int base_filesystem_create(const char *r
return log_error_errno(errno, "Failed to open root file system: %m");
for (size_t i = 0; i < ELEMENTSOF(table); i++) {
- if (faccessat(fd, table[i].dir, F_OK, AT_SYMLINK_NOFOLLOW) >= 0)
+ if (faccessat(fd, table[i].dir, F_OK, 0) >= 0)
continue;
if (table[i].target) {
@@ -125,7 +125,7 @@ int base_filesystem_create(const char *r
/* check if one of the targets exists */
NULSTR_FOREACH(s, table[i].target) {
- if (faccessat(fd, s, F_OK, AT_SYMLINK_NOFOLLOW) < 0)
+ if (faccessat(fd, s, F_OK, 0) < 0)
continue;
/* check if a specific file exists at the target path */
@@ -136,7 +136,7 @@ int base_filesystem_create(const char *r
if (!p)
return log_oom();
- if (faccessat(fd, p, F_OK, AT_SYMLINK_NOFOLLOW) < 0)
+ if (faccessat(fd, p, F_OK, 0) < 0)
continue;
}

View File

@@ -0,0 +1,30 @@
From 1803ea271b93370fdcf7ec497277344f1e775429 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 27 May 2018 08:36:44 -0700
Subject: [PATCH] Define glibc compatible basename() for non-glibc systems
Fixes builds with musl, even though systemd is adamant about
using non-posix basename implementation, we have a way out
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/machine/machine-dbus.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/src/machine/machine-dbus.c
+++ b/src/machine/machine-dbus.c
@@ -10,6 +10,11 @@
#include <libgen.h>
#undef basename
+#if !defined(__GLIBC__)
+#include <string.h>
+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
+#endif
+
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-get-properties.h"

View File

@@ -0,0 +1,37 @@
From 30b08f76ea7f5c324afedf97f0867b76dac9f128 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Wed, 4 Jul 2018 15:00:44 +0800
Subject: [PATCH] Do not disable buffering when writing to oom_score_adj
On musl, disabling buffering when writing to oom_score_adj will
cause the following error.
Failed to adjust OOM setting: Invalid argument
This error appears for systemd-udevd.service and dbus.service.
This is because kernel receives '-' instead of the whole '-900'
if buffering is disabled.
This is libc implementation specific, as glibc does not have this issue.
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
[rebased for systemd 243]
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
src/basic/process-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -1489,7 +1489,7 @@ int set_oom_score_adjust(int value) {
xsprintf(t, "%i", value);
return write_string_file("/proc/self/oom_score_adj", t,
- WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_DISABLE_BUFFER);
+ WRITE_STRING_FILE_VERIFY_ON_FAILURE);
}
int get_oom_score_adjust(int *ret) {

View File

@@ -0,0 +1,56 @@
From 873202f63f9f117c6e5a98e444cc709057042979 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Tue, 10 Jul 2018 15:40:17 +0800
Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi
strerror_r
XSI-compliant strerror_r and GNU-specifi strerror_r are different.
int strerror_r(int errnum, char *buf, size_t buflen);
/* XSI-compliant */
char *strerror_r(int errnum, char *buf, size_t buflen);
/* GNU-specific */
We need to distinguish between them. Otherwise, we'll get an int value
assigned to (char *) variable, resulting in segment fault.
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/libsystemd/sd-bus/bus-error.c | 5 +++++
src/libsystemd/sd-journal/journal-send.c | 5 +++++
2 files changed, 10 insertions(+)
--- a/src/libsystemd/sd-bus/bus-error.c
+++ b/src/libsystemd/sd-bus/bus-error.c
@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_er
return;
errno = 0;
+#ifndef __GLIBC__
+ strerror_r(error, m, k);
+ x = m;
+#else
x = strerror_r(error, m, k);
+#endif
if (errno == ERANGE || strlen(x) >= k - 1) {
free(m);
k *= 2;
--- a/src/libsystemd/sd-journal/journal-send.c
+++ b/src/libsystemd/sd-journal/journal-send.c
@@ -348,7 +348,12 @@ static int fill_iovec_perror_and_send(co
char* j;
errno = 0;
+#ifndef __GLIBC__
+ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
+ j = buffer + 8 + k;
+#else
j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
+#endif
if (errno == 0) {
char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];

View File

@@ -0,0 +1,33 @@
From e7441559266074e7a33e3c11ff5cdaf5ba9c0e24 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 15:18:00 +0800
Subject: [PATCH] Hide __start_BUS_ERROR_MAP and __stop_BUS_ERROR_MAP
for currently unknown reasons they get exported to the shared libries
even without being listed in the sym file
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
[Rebased for v241]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/libsystemd/sd-bus/bus-error.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
index c49be29e46..90731bd7e7 100644
--- a/src/libsystemd/sd-bus/bus-error.c
+++ b/src/libsystemd/sd-bus/bus-error.c
@@ -55,8 +55,8 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
};
/* GCC maps this magically to the beginning and end of the BUS_ERROR_MAP section */
-extern const sd_bus_error_map __start_SYSTEMD_BUS_ERROR_MAP[];
-extern const sd_bus_error_map __stop_SYSTEMD_BUS_ERROR_MAP[];
+extern const sd_bus_error_map __start_SYSTEMD_BUS_ERROR_MAP[] _hidden_;
+extern const sd_bus_error_map __stop_SYSTEMD_BUS_ERROR_MAP[] _hidden_;
/* Additional maps registered with sd_bus_error_add_map() are in this
* NULL terminated array */

View File

@@ -0,0 +1,28 @@
From 64f4d2eb976b9f23ce85b3655a876f7299eafd58 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 15:27:54 +0800
Subject: [PATCH] missing_type.h: add __compar_d_fn_t definition
Fix the following compile failure:
src/basic/util.h:71:18: error: unknown type name '__compar_d_fn_t'; did you mean '__compar_fn_t'?
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/basic/missing_type.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h
index 3df1084ef2..697aa7f58a 100644
--- a/src/basic/missing_type.h
+++ b/src/basic/missing_type.h
@@ -13,6 +13,7 @@
#ifndef __GLIBC__
typedef int (*comparison_fn_t)(const void *, const void *);
+typedef int (*__compar_d_fn_t) (const void *, const void *, void *);
#endif
#ifndef __COMPAR_FN_T

View File

@@ -0,0 +1,30 @@
From d95330f328c23c1cd6c51aeca43f081746cf2899 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 15:44:54 +0800
Subject: [PATCH] avoid redefinition of prctl_mm_map structure
Fix the following compile failure:
error: redefinition of 'struct prctl_mm_map'
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/basic/missing_prctl.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/basic/missing_prctl.h b/src/basic/missing_prctl.h
index ab851306ba..5547cad875 100644
--- a/src/basic/missing_prctl.h
+++ b/src/basic/missing_prctl.h
@@ -1,7 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#ifdef __GLIBC__
#include <linux/prctl.h>
+#endif
/* 58319057b7847667f0c9585b9de0e8932b0fdb08 (4.3) */
#ifndef PR_CAP_AMBIENT

View File

@@ -0,0 +1,24 @@
From 2284f2f44b1b30f10b9196e0f5c6d0a2e0c1871f Mon Sep 17 00:00:00 2001
From: Alex Kiernan <alex.kiernan@gmail.com>
Date: Fri, 7 Aug 2020 15:19:27 +0000
Subject: [PATCH] Handle missing LOCK_EX
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
src/partition/makefs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/partition/makefs.c b/src/partition/makefs.c
index 7c94fbfedb..42f966722d 100644
--- a/src/partition/makefs.c
+++ b/src/partition/makefs.c
@@ -6,6 +6,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include <sys/file.h>
#include "alloc-util.h"
#include "blockdev-util.h"

View File

@@ -0,0 +1,36 @@
From a6a25e1ecae91f48a4f87bf0cc17eaaf0a919ffe Mon Sep 17 00:00:00 2001
From: Alex Kiernan <alex.kiernan@gmail.com>
Date: Fri, 7 Aug 2020 15:20:17 +0000
Subject: [PATCH] Fix incompatible pointer type struct sockaddr_un *
| ../../../../../../workspace/sources/systemd/src/nspawn/nspawn.c: In function 'cant_be_in_netns':
| ../../../../../../workspace/sources/systemd/src/nspawn/nspawn.c:4893:25: error: passing argument 2 of 'connect' from incompatible pointer type [-Werror=incompatible-pointer-types]
| 4893 | if (connect(fd, &sa.un, SOCKADDR_UN_LEN(sa.un)) < 0) {
| | ^~~~~~
| | |
| | struct sockaddr_un *
| In file included from ../../../../../../workspace/sources/systemd/src/systemd/sd-daemon.h:22,
| from ../../../../../../workspace/sources/systemd/src/nspawn/nspawn.c:21:
| /home/ubuntu/poky/build/tmp/work/core2-64-poky-linux-musl/systemd/1_246-r0/recipe-sysroot/usr/include/sys/socket.h:384:19: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_un *'
| 384 | int connect (int, const struct sockaddr *, socklen_t);
| | ^~~~~~~~~~~~~~~~~~~~~~~
| cc1: some warnings being treated as errors
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
src/nspawn/nspawn.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -5389,7 +5389,7 @@ static int cant_be_in_netns(void) {
if (fd < 0)
return log_error_errno(errno, "Failed to allocate udev control socket: %m");
- if (connect(fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0) {
+ if (connect(fd, (struct sockaddr *)&sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0) {
if (errno == ENOENT || ERRNO_IS_DISCONNECT(errno))
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),

View File

@@ -0,0 +1,29 @@
From 47472da6e8900773c26da8fd26699367447d97a6 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 16:53:06 +0800
Subject: [PATCH] test-json.c: define M_PIl
Fix the following compile failure:
src/test/test-json.c:305:50: error: 'M_PIl' undeclared (first use in this function); did you mean 'M_PI'?
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/test/test-json.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/src/test/test-json.c
+++ b/src/test/test-json.c
@@ -14,6 +14,10 @@
#include "tests.h"
#include "util.h"
+#ifndef M_PIl
+#define M_PIl 3.141592653589793238462643383279502884L
+#endif
+
static void test_tokenizer_one(const char *data, ...) {
unsigned line = 0, column = 0;
void *state = NULL;

View File

@@ -0,0 +1,420 @@
From 0f9422780a569c79a4b28e44c79c70b4a354bd92 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Fri, 1 Mar 2019 15:22:15 +0800
Subject: [PATCH] do not disable buffer in writing files
Do not disable buffer in writing files, otherwise we get
failure at boot for musl like below.
[!!!!!!] Failed to allocate manager object.
And there will be other failures, critical or not critical.
This is specific to musl.
Upstream-Status: Inappropriate [musl]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
[Rebased for v242]
Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
[rebased for systemd 243]
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
src/basic/cgroup-util.c | 10 +++++-----
src/basic/procfs-util.c | 4 ++--
src/basic/sysctl-util.c | 2 +-
src/basic/util.c | 2 +-
src/binfmt/binfmt.c | 6 +++---
src/core/main.c | 4 ++--
src/core/smack-setup.c | 8 ++++----
src/hibernate-resume/hibernate-resume.c | 2 +-
src/libsystemd/sd-device/sd-device.c | 2 +-
src/nspawn/nspawn-cgroup.c | 2 +-
src/nspawn/nspawn.c | 6 +++---
src/shared/cgroup-setup.c | 4 ++--
src/shared/mount-util.c | 4 ++--
src/shared/smack-util.c | 2 +-
src/sleep/sleep.c | 8 ++++----
src/vconsole/vconsole-setup.c | 2 +-
16 files changed, 34 insertions(+), 34 deletions(-)
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -390,7 +390,7 @@ int cg_kill_kernel_sigkill(const char *c
if (r < 0)
return r;
- r = write_string_file(killfile, "1", WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(killfile, "1", 0);
if (r < 0)
return r;
@@ -803,7 +803,7 @@ int cg_install_release_agent(const char
sc = strstrip(contents);
if (isempty(sc)) {
- r = write_string_file(fs, agent, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(fs, agent, 0);
if (r < 0)
return r;
} else if (!path_equal(sc, agent))
@@ -821,7 +821,7 @@ int cg_install_release_agent(const char
sc = strstrip(contents);
if (streq(sc, "0")) {
- r = write_string_file(fs, "1", WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(fs, "1", 0);
if (r < 0)
return r;
@@ -848,7 +848,7 @@ int cg_uninstall_release_agent(const cha
if (r < 0)
return r;
- r = write_string_file(fs, "0", WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(fs, "0", 0);
if (r < 0)
return r;
@@ -858,7 +858,7 @@ int cg_uninstall_release_agent(const cha
if (r < 0)
return r;
- r = write_string_file(fs, "", WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(fs, "", 0);
if (r < 0)
return r;
@@ -1704,7 +1704,7 @@ int cg_set_attribute(const char *control
if (r < 0)
return r;
- return write_string_file(p, value, WRITE_STRING_FILE_DISABLE_BUFFER);
+ return write_string_file(p, value, 0);
}
int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret) {
--- a/src/basic/procfs-util.c
+++ b/src/basic/procfs-util.c
@@ -64,13 +64,13 @@ int procfs_tasks_set_limit(uint64_t limi
* decrease it, as threads-max is the much more relevant sysctl. */
if (limit > pid_max-1) {
sprintf(buffer, "%" PRIu64, limit+1); /* Add one, since PID 0 is not a valid PID */
- r = write_string_file("/proc/sys/kernel/pid_max", buffer, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/proc/sys/kernel/pid_max", buffer, 0);
if (r < 0)
return r;
}
sprintf(buffer, "%" PRIu64, limit);
- r = write_string_file("/proc/sys/kernel/threads-max", buffer, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/proc/sys/kernel/threads-max", buffer, 0);
if (r < 0) {
uint64_t threads_max;
--- a/src/basic/sysctl-util.c
+++ b/src/basic/sysctl-util.c
@@ -58,7 +58,7 @@ int sysctl_write(const char *property, c
log_debug("Setting '%s' to '%s'", p, value);
- return write_string_file(p, value, WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER | WRITE_STRING_FILE_SUPPRESS_REDUNDANT_VIRTUAL);
+ return write_string_file(p, value, WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_SUPPRESS_REDUNDANT_VIRTUAL);
}
int sysctl_writef(const char *property, const char *format, ...) {
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -168,7 +168,7 @@ void disable_coredumps(void) {
if (detect_container() > 0)
return;
- r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0);
if (r < 0)
log_debug_errno(r, "Failed to turn off coredumps, ignoring: %m");
}
--- a/src/binfmt/binfmt.c
+++ b/src/binfmt/binfmt.c
@@ -29,7 +29,7 @@ static bool arg_unregister = false;
static int delete_rule(const char *rulename) {
const char *fn = strjoina("/proc/sys/fs/binfmt_misc/", rulename);
- return write_string_file(fn, "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
+ return write_string_file(fn, "-1", 0);
}
static int apply_rule(const char *filename, unsigned line, const char *rule) {
@@ -59,7 +59,7 @@ static int apply_rule(const char *filena
if (r >= 0)
log_debug("%s:%u: Rule '%s' deleted.", filename, line, rulename);
- r = write_string_file("/proc/sys/fs/binfmt_misc/register", rule, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/proc/sys/fs/binfmt_misc/register", rule, 0);
if (r < 0)
return log_error_errno(r, "%s:%u: Failed to add binary format '%s': %m",
filename, line, rulename);
@@ -226,7 +226,7 @@ static int run(int argc, char *argv[]) {
}
/* Flush out all rules */
- r = write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", 0);
if (r < 0)
log_warning_errno(r, "Failed to flush binfmt_misc rules, ignoring: %m");
else
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1466,7 +1466,7 @@ static int bump_unix_max_dgram_qlen(void
if (v >= DEFAULT_UNIX_MAX_DGRAM_QLEN)
return 0;
- r = write_string_filef("/proc/sys/net/unix/max_dgram_qlen", WRITE_STRING_FILE_DISABLE_BUFFER,
+ r = write_string_filef("/proc/sys/net/unix/max_dgram_qlen", 0,
"%lu", DEFAULT_UNIX_MAX_DGRAM_QLEN);
if (r < 0)
return log_full_errno(IN_SET(r, -EROFS, -EPERM, -EACCES) ? LOG_DEBUG : LOG_WARNING, r,
@@ -1737,7 +1737,7 @@ static void initialize_core_pattern(bool
if (getpid_cached() != 1)
return;
- r = write_string_file("/proc/sys/kernel/core_pattern", arg_early_core_pattern, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/proc/sys/kernel/core_pattern", arg_early_core_pattern, 0);
if (r < 0)
log_warning_errno(r, "Failed to write '%s' to /proc/sys/kernel/core_pattern, ignoring: %m",
arg_early_core_pattern);
--- a/src/core/smack-setup.c
+++ b/src/core/smack-setup.c
@@ -320,17 +320,17 @@ int mac_smack_setup(bool *loaded_policy)
}
#if HAVE_SMACK_RUN_LABEL
- r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL, 0);
if (r < 0)
log_warning_errno(r, "Failed to set SMACK label \"" SMACK_RUN_LABEL "\" on self: %m");
- r = write_string_file("/sys/fs/smackfs/ambient", SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/sys/fs/smackfs/ambient", SMACK_RUN_LABEL, 0);
if (r < 0)
log_warning_errno(r, "Failed to set SMACK ambient label \"" SMACK_RUN_LABEL "\": %m");
r = write_string_file("/sys/fs/smackfs/netlabel",
- "0.0.0.0/0 " SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
+ "0.0.0.0/0 " SMACK_RUN_LABEL, 0);
if (r < 0)
log_warning_errno(r, "Failed to set SMACK netlabel rule \"0.0.0.0/0 " SMACK_RUN_LABEL "\": %m");
- r = write_string_file("/sys/fs/smackfs/netlabel", "127.0.0.1 -CIPSO", WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/sys/fs/smackfs/netlabel", "127.0.0.1 -CIPSO", 0);
if (r < 0)
log_warning_errno(r, "Failed to set SMACK netlabel rule \"127.0.0.1 -CIPSO\": %m");
#endif
--- a/src/hibernate-resume/hibernate-resume.c
+++ b/src/hibernate-resume/hibernate-resume.c
@@ -45,7 +45,7 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}
- r = write_string_file("/sys/power/resume", major_minor, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/sys/power/resume", major_minor, 0);
if (r < 0) {
log_error_errno(r, "Failed to write '%s' to /sys/power/resume: %m", major_minor);
return EXIT_FAILURE;
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -2108,7 +2108,7 @@ _public_ int sd_device_set_sysattr_value
if (!value)
return -ENOMEM;
- r = write_string_file(path, value, WRITE_STRING_FILE_DISABLE_BUFFER | WRITE_STRING_FILE_NOFOLLOW);
+ r = write_string_file(path, value, 0 | WRITE_STRING_FILE_NOFOLLOW);
if (r < 0) {
/* On failure, clear cache entry, as we do not know how it fails. */
device_remove_cached_sysattr_value(device, sysattr);
--- a/src/nspawn/nspawn-cgroup.c
+++ b/src/nspawn/nspawn-cgroup.c
@@ -124,7 +124,7 @@ int sync_cgroup(pid_t pid, CGroupUnified
fn = strjoina(tree, cgroup, "/cgroup.procs");
sprintf(pid_string, PID_FMT, pid);
- r = write_string_file(fn, pid_string, WRITE_STRING_FILE_DISABLE_BUFFER|WRITE_STRING_FILE_MKDIR_0755);
+ r = write_string_file(fn, pid_string, WRITE_STRING_FILE_MKDIR_0755);
if (r < 0) {
log_error_errno(r, "Failed to move process: %m");
goto finish;
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -2757,7 +2757,7 @@ static int reset_audit_loginuid(void) {
if (streq(p, "4294967295"))
return 0;
- r = write_string_file("/proc/self/loginuid", "4294967295", WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/proc/self/loginuid", "4294967295", 0);
if (r < 0) {
log_error_errno(r,
"Failed to reset audit login UID. This probably means that your kernel is too\n"
@@ -4163,7 +4163,7 @@ static int setup_uid_map(
return log_oom();
xsprintf(uid_map, "/proc/" PID_FMT "/uid_map", pid);
- r = write_string_file(uid_map, s, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(uid_map, s, 0);
if (r < 0)
return log_error_errno(r, "Failed to write UID map: %m");
@@ -4173,7 +4173,7 @@ static int setup_uid_map(
return log_oom();
xsprintf(uid_map, "/proc/" PID_FMT "/gid_map", pid);
- r = write_string_file(uid_map, s, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(uid_map, s, 0);
if (r < 0)
return log_error_errno(r, "Failed to write GID map: %m");
--- a/src/shared/cgroup-setup.c
+++ b/src/shared/cgroup-setup.c
@@ -345,7 +345,7 @@ int cg_attach(const char *controller, co
xsprintf(c, PID_FMT "\n", pid);
- r = write_string_file(fs, c, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(fs, c, 0);
if (r < 0)
return r;
@@ -877,7 +877,7 @@ int cg_enable_everywhere(
return log_debug_errno(errno, "Failed to open cgroup.subtree_control file of %s: %m", p);
}
- r = write_string_stream(f, s, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_stream(f, s, 0);
if (r < 0) {
log_debug_errno(r, "Failed to %s controller %s for %s (%s): %m",
FLAGS_SET(mask, bit) ? "enable" : "disable", n, p, fs);
--- a/src/shared/smack-util.c
+++ b/src/shared/smack-util.c
@@ -114,7 +114,7 @@ int mac_smack_apply_pid(pid_t pid, const
return 0;
p = procfs_file_alloca(pid, "attr/current");
- r = write_string_file(p, label, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(p, label, 0);
if (r < 0)
return r;
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -46,7 +46,7 @@ static int write_hibernate_location_info
assert(hibernate_location->swap);
xsprintf(resume_str, "%u:%u", major(hibernate_location->devno), minor(hibernate_location->devno));
- r = write_string_file("/sys/power/resume", resume_str, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/sys/power/resume", resume_str, 0);
if (r < 0)
return log_debug_errno(r, "Failed to write partition device to /sys/power/resume for '%s': '%s': %m",
hibernate_location->swap->device, resume_str);
@@ -73,7 +73,7 @@ static int write_hibernate_location_info
}
xsprintf(offset_str, "%" PRIu64, hibernate_location->offset);
- r = write_string_file("/sys/power/resume_offset", offset_str, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/sys/power/resume_offset", offset_str, 0);
if (r < 0)
return log_debug_errno(r, "Failed to write swap file offset to /sys/power/resume_offset for '%s': '%s': %m",
hibernate_location->swap->device, offset_str);
@@ -90,7 +90,7 @@ static int write_mode(char **modes) {
STRV_FOREACH(mode, modes) {
int k;
- k = write_string_file("/sys/power/disk", *mode, WRITE_STRING_FILE_DISABLE_BUFFER);
+ k = write_string_file("/sys/power/disk", *mode, 0);
if (k >= 0)
return 0;
@@ -112,7 +112,7 @@ static int write_state(FILE **f, char **
STRV_FOREACH(state, states) {
int k;
- k = write_string_stream(*f, *state, WRITE_STRING_FILE_DISABLE_BUFFER);
+ k = write_string_stream(*f, *state, 0);
if (k >= 0)
return 0;
log_debug_errno(k, "Failed to write '%s' to /sys/power/state: %m", *state);
--- a/src/vconsole/vconsole-setup.c
+++ b/src/vconsole/vconsole-setup.c
@@ -108,7 +108,7 @@ static int toggle_utf8_vc(const char *na
static int toggle_utf8_sysfs(bool utf8) {
int r;
- r = write_string_file("/sys/module/vt/parameters/default_utf8", one_zero(utf8), WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/sys/module/vt/parameters/default_utf8", one_zero(utf8), 0);
if (r < 0)
return log_warning_errno(r, "Failed to %s sysfs UTF-8 flag: %m", enable_disable(utf8));
--- a/src/basic/namespace-util.c
+++ b/src/basic/namespace-util.c
@@ -202,12 +202,12 @@ int userns_acquire(const char *uid_map,
freeze();
xsprintf(path, "/proc/" PID_FMT "/uid_map", pid);
- r = write_string_file(path, uid_map, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(path, uid_map, 0);
if (r < 0)
return log_error_errno(r, "Failed to write UID map: %m");
xsprintf(path, "/proc/" PID_FMT "/gid_map", pid);
- r = write_string_file(path, gid_map, WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(path, gid_map, 0);
if (r < 0)
return log_error_errno(r, "Failed to write GID map: %m");
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -4140,7 +4140,7 @@ int unit_cgroup_freezer_action(Unit *u,
else
u->freezer_state = FREEZER_THAWING;
- r = write_string_file(path, one_zero(action == FREEZER_FREEZE), WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(path, one_zero(action == FREEZER_FREEZE), 0);
if (r < 0)
return r;
--- a/src/home/homework.c
+++ b/src/home/homework.c
@@ -284,7 +284,7 @@ static void drop_caches_now(void) {
* details. We write "2" into /proc/sys/vm/drop_caches to ensure dentries/inodes are flushed, but not
* more. */
- r = write_string_file("/proc/sys/vm/drop_caches", "2\n", WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/proc/sys/vm/drop_caches", "2\n", 0);
if (r < 0)
log_warning_errno(r, "Failed to drop caches, ignoring: %m");
else
--- a/src/shared/binfmt-util.c
+++ b/src/shared/binfmt-util.c
@@ -26,7 +26,7 @@ int disable_binfmt(void) {
if (r < 0)
return log_warning_errno(r, "Failed to determine whether binfmt_misc is mounted: %m");
- r = write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", 0);
if (r < 0)
return log_warning_errno(r, "Failed to unregister binfmt_misc entries: %m");
--- a/src/shared/coredump-util.c
+++ b/src/shared/coredump-util.c
@@ -70,5 +70,5 @@ int set_coredump_filter(uint64_t value)
sprintf(t, "0x%"PRIx64, value);
return write_string_file("/proc/self/coredump_filter", t,
- WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_DISABLE_BUFFER);
+ WRITE_STRING_FILE_VERIFY_ON_FAILURE);
}
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -2181,7 +2181,6 @@ static int udev_rule_apply_token_to_even
log_rule_debug(dev, rules, "ATTR '%s' writing '%s'", buf, value);
r = write_string_file(buf, value,
WRITE_STRING_FILE_VERIFY_ON_FAILURE |
- WRITE_STRING_FILE_DISABLE_BUFFER |
WRITE_STRING_FILE_AVOID_NEWLINE |
WRITE_STRING_FILE_VERIFY_IGNORE_NEWLINE);
if (r < 0)

View File

@@ -0,0 +1,58 @@
From e4f9ef547fa342102db15188544daa18e71e9c66 Mon Sep 17 00:00:00 2001
From: Scott Murray <scott.murray@konsulko.com>
Date: Fri, 13 Sep 2019 19:26:27 -0400
Subject: [PATCH] Handle __cpu_mask usage
Fixes errors:
src/test/test-cpu-set-util.c:18:54: error: '__cpu_mask' undeclared (first use in this function)
src/test/test-sizeof.c:73:14: error: '__cpu_mask' undeclared (first use in this function)
__cpu_mask is an internal type of glibc's cpu_set implementation, not
part of the POSIX definition, which is problematic when building with
musl, which does not define a matching type. From inspection of musl's
sched.h, however, it is clear that the corresponding type would be
unsigned long, which does match glibc's actual __CPU_MASK_TYPE. So,
add a typedef to cpu-set-util.h defining __cpu_mask appropriately.
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
src/shared/cpu-set-util.h | 2 ++
src/test/test-sizeof.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/shared/cpu-set-util.h b/src/shared/cpu-set-util.h
index 3c63a58826..4c2d4347fc 100644
--- a/src/shared/cpu-set-util.h
+++ b/src/shared/cpu-set-util.h
@@ -6,6 +6,8 @@
#include "macro.h"
#include "missing_syscall.h"
+typedef unsigned long __cpu_mask;
+
/* This wraps the libc interface with a variable to keep the allocated size. */
typedef struct CPUSet {
cpu_set_t *set;
diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
index 4403c0aa52..e7e4ae112d 100644
--- a/src/test/test-sizeof.c
+++ b/src/test/test-sizeof.c
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <sched.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
@@ -10,6 +9,7 @@
#include <float.h>
#include "time-util.h"
+#include "cpu-set-util.h"
/* Print information about various types. Useful when diagnosing
* gcc diagnostics on an unfamiliar architecture. */

View File

@@ -0,0 +1,165 @@
From 66a926cf906260c2fb5ea851e55efe03edd444dc Mon Sep 17 00:00:00 2001
From: Alex Kiernan <alex.kiernan@gmail.com>
Date: Tue, 10 Mar 2020 11:05:20 +0000
Subject: [PATCH] Handle missing gshadow
gshadow usage is now present in the userdb code. Mask all uses of it to
allow compilation on musl
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
[Rebased for v247]
Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
---
src/shared/user-record-nss.c | 20 ++++++++++++++++++++
src/shared/user-record-nss.h | 4 ++++
src/shared/userdb.c | 7 ++++++-
3 files changed, 30 insertions(+), 1 deletion(-)
--- a/src/shared/user-record-nss.c
+++ b/src/shared/user-record-nss.c
@@ -331,8 +331,10 @@ int nss_group_to_group_record(
if (isempty(grp->gr_name))
return -EINVAL;
+#if ENABLE_GSHADOW
if (sgrp && !streq_ptr(sgrp->sg_namp, grp->gr_name))
return -EINVAL;
+#endif
g = group_record_new();
if (!g)
@@ -348,6 +350,7 @@ int nss_group_to_group_record(
g->gid = grp->gr_gid;
+#if ENABLE_GSHADOW
if (sgrp) {
if (looks_like_hashed_password(utf8_only(sgrp->sg_passwd))) {
g->hashed_password = strv_new(sgrp->sg_passwd);
@@ -363,6 +366,7 @@ int nss_group_to_group_record(
if (r < 0)
return r;
}
+#endif
r = json_build(&g->json, JSON_BUILD_OBJECT(
JSON_BUILD_PAIR("groupName", JSON_BUILD_STRING(g->group_name)),
@@ -388,6 +392,7 @@ int nss_sgrp_for_group(const struct grou
assert(ret_sgrp);
assert(ret_buffer);
+#if ENABLE_GSHADOW
for (;;) {
_cleanup_free_ char *buf = NULL;
struct sgrp sgrp, *result;
@@ -416,6 +421,9 @@ int nss_sgrp_for_group(const struct grou
buflen *= 2;
buf = mfree(buf);
}
+#else
+ return -ESRCH;
+#endif
}
int nss_group_record_by_name(
@@ -427,7 +435,9 @@ int nss_group_record_by_name(
struct group grp, *result;
bool incomplete = false;
size_t buflen = 4096;
+#if ENABLE_GSHADOW
struct sgrp sgrp, *sresult = NULL;
+#endif
int r;
assert(name);
@@ -457,6 +467,7 @@ int nss_group_record_by_name(
buf = mfree(buf);
}
+#if ENABLE_GSHADOW
if (with_shadow) {
r = nss_sgrp_for_group(result, &sgrp, &sbuf);
if (r < 0) {
@@ -468,6 +479,9 @@ int nss_group_record_by_name(
incomplete = true;
r = nss_group_to_group_record(result, sresult, ret);
+#else
+ r = nss_group_to_group_record(result, NULL, ret);
+#endif
if (r < 0)
return r;
@@ -484,7 +498,9 @@ int nss_group_record_by_gid(
struct group grp, *result;
bool incomplete = false;
size_t buflen = 4096;
+#if ENABLE_GSHADOW
struct sgrp sgrp, *sresult = NULL;
+#endif
int r;
assert(ret);
@@ -512,6 +528,7 @@ int nss_group_record_by_gid(
buf = mfree(buf);
}
+#if ENABLE_GSHADOW
if (with_shadow) {
r = nss_sgrp_for_group(result, &sgrp, &sbuf);
if (r < 0) {
@@ -523,6 +540,9 @@ int nss_group_record_by_gid(
incomplete = true;
r = nss_group_to_group_record(result, sresult, ret);
+#else
+ r = nss_group_to_group_record(result, NULL, ret);
+#endif
if (r < 0)
return r;
--- a/src/shared/user-record-nss.h
+++ b/src/shared/user-record-nss.h
@@ -2,7 +2,11 @@
#pragma once
#include <grp.h>
+#if ENABLE_GSHADOW
#include <gshadow.h>
+#else
+struct sgrp;
+#endif
#include <pwd.h>
#include <shadow.h>
--- a/src/shared/userdb.c
+++ b/src/shared/userdb.c
@@ -1046,13 +1046,15 @@ int groupdb_iterator_get(UserDBIterator
if (gr) {
_cleanup_free_ char *buffer = NULL;
bool incomplete = false;
+#if ENABLE_GSHADOW
struct sgrp sgrp;
-
+#endif
if (streq_ptr(gr->gr_name, "root"))
iterator->synthesize_root = false;
if (gr->gr_gid == GID_NOBODY)
iterator->synthesize_nobody = false;
+#if ENABLE_GSHADOW
if (!FLAGS_SET(iterator->flags, USERDB_SUPPRESS_SHADOW)) {
r = nss_sgrp_for_group(gr, &sgrp, &buffer);
if (r < 0) {
@@ -1065,6 +1067,9 @@ int groupdb_iterator_get(UserDBIterator
}
r = nss_group_to_group_record(gr, r >= 0 ? &sgrp : NULL, ret);
+#else
+ r = nss_group_to_group_record(gr, NULL, ret);
+#endif
if (r < 0)
return r;

View File

@@ -0,0 +1,32 @@
From 6f0dd2ba75b68036d7b4ebfe47ac5eaf44d26f06 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 12 Apr 2021 23:44:53 -0700
Subject: [PATCH] missing_syscall.h: Define MIPS ABI defines for musl
musl does not define _MIPS_SIM_ABI32, _MIPS_SIM_NABI32, _MIPS_SIM_ABI64
unlike glibc where these are provided by libc headers, therefore define
them here in case they are undefined
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/basic/missing_syscall.h | 6 ++++++
1 file changed, 6 insertions(+)
--- a/src/basic/missing_syscall.h
+++ b/src/basic/missing_syscall.h
@@ -20,6 +20,12 @@
#include <asm/sgidefs.h>
#endif
+#ifndef _MIPS_SIM_ABI32
+#define _MIPS_SIM_ABI32 1
+#define _MIPS_SIM_NABI32 2
+#define _MIPS_SIM_ABI64 3
+#endif
+
#include "macro.h"
#include "missing_keyctl.h"
#include "missing_stat.h"

View File

@@ -0,0 +1,9 @@
--- a/src/libsystemd/libsystemd.pc.in
+++ b/src/libsystemd/libsystemd.pc.in
@@ -16,5 +16,5 @@ Name: systemd
Description: systemd Library
URL: {{PROJECT_URL}}
Version: {{PROJECT_VERSION}}
-Libs: -L${libdir} -lsystemd
+Libs: -L${libdir} -lsystemd -lrt -lmount -lcap
Cflags: -I${includedir}

View File

@@ -0,0 +1,79 @@
SUMMARY = "libsystemd static library"
DESCRIPTION = "libsystemd static library built specifically as an integral component of sdbus-c++"
SECTION = "libs"
LICENSE = "LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
inherit meson pkgconfig
DEPENDS += "gperf-native gettext-native util-linux libcap util-linux python3-jinja2-native"
SRCREV = "1d5e0e9910500f3c3584485f77bfc35e601036e3"
SRCBRANCH = "v250-stable"
SRC_URI = "git://github.com/systemd/systemd-stable.git;protocol=https;branch=${SRCBRANCH} \
file://static-libsystemd-pkgconfig.patch \
file://0001-dirent-util-Remove-asserts-on-dirent64-dirent.patch \
"
# patches needed by musl
SRC_URI:append:libc-musl = " ${SRC_URI_MUSL}"
SRC_URI_MUSL = "\
file://0002-don-t-use-glibc-specific-qsort_r.patch \
file://0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch \
file://0004-add-fallback-parse_printf_format-implementation.patch \
file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \
file://0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \
file://0008-add-missing-FTW_-macros-for-musl.patch \
file://0009-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
file://0010-Use-uintmax_t-for-handling-rlim_t.patch \
file://0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
file://0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
file://0013-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
file://0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
file://0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
file://0016-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
file://0017-missing_type.h-add-__compar_d_fn_t-definition.patch \
file://0018-avoid-redefinition-of-prctl_mm_map-structure.patch \
file://0019-Handle-missing-LOCK_EX.patch \
file://0020-Fix-incompatible-pointer-type-struct-sockaddr_un.patch \
file://0021-test-json.c-define-M_PIl.patch \
file://0022-do-not-disable-buffer-in-writing-files.patch \
file://0025-Handle-__cpu_mask-usage.patch \
file://0026-Handle-missing-gshadow.patch \
file://0028-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch \
file://0002-Add-sys-stat.h-for-S_IFDIR.patch \
file://0001-Adjust-for-musl-headers.patch \
"
PACKAGECONFIG ??= "gshadow idn"
PACKAGECONFIG:remove:libc-musl = " gshadow idn"
PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
CFLAGS:append:libc-musl = " -D__UAPI_DEF_ETHHDR=0 "
EXTRA_OEMESON += "-Dstatic-libsystemd=pic"
S = "${WORKDIR}/git"
RDEPENDS:${PN}-dev = ""
do_compile() {
ninja -v ${PARALLEL_MAKE} version.h
ninja -v ${PARALLEL_MAKE} libsystemd.a
ninja -v ${PARALLEL_MAKE} src/libsystemd/libsystemd.pc
}
do_install () {
install -d ${D}${libdir}
install ${B}/libsystemd.a ${D}${libdir}
install -d ${D}${includedir}/systemd
install ${S}/src/systemd/*.h ${D}${includedir}/systemd
install -d ${D}${libdir}/pkgconfig
install ${B}/src/libsystemd/libsystemd.pc ${D}${libdir}/pkgconfig
}

View File

@@ -0,0 +1,16 @@
SUMMARY = "sdbus-c++ native tools"
DESCRIPTION = "Native interface code generator for development with sdbus-c++"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=1803fa9c2c3ce8cb06b4861d75310742"
inherit cmake
DEPENDS += "expat"
SRCREV = "751c1addc4fd2f949a466f488c1b7de2ca3b76dc"
SRC_URI = "git://github.com/Kistler-Group/sdbus-cpp.git;protocol=https;branch=master;subpath=tools"
S = "${WORKDIR}/tools"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,47 @@
SUMMARY = "sdbus-c++"
DESCRIPTION = "High-level C++ D-Bus library designed to provide easy-to-use yet powerful API in modern C++"
SECTION = "libs"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=1803fa9c2c3ce8cb06b4861d75310742"
inherit cmake pkgconfig systemd ptest
PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'with-external-libsystemd', 'with-builtin-libsystemd', d)} \
${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)}"
PACKAGECONFIG[with-builtin-libsystemd] = ",,sdbus-c++-libsystemd,libcap"
PACKAGECONFIG[with-external-libsystemd] = ",,systemd,libsystemd"
PACKAGECONFIG[with-tests] = "-DBUILD_TESTS=ON -DTESTS_INSTALL_PATH=${libdir}/${BPN}/tests,-DBUILD_TESTS=OFF,googletest gmock"
DEPENDS += "expat"
SRCREV = "751c1addc4fd2f949a466f488c1b7de2ca3b76dc"
SRC_URI = "git://github.com/Kistler-Group/sdbus-cpp.git;protocol=https;branch=master"
SRC_URI += "file://run-ptest"
EXTRA_OECMAKE = "-DBUILD_CODE_GEN=OFF \
-DBUILD_DOC=ON \
-DBUILD_DOXYGEN_DOC=OFF"
S = "${WORKDIR}/git"
# Link libatomic on architectures without 64bit atomics fixes
# libsdbus-c++.so.1.1.0: undefined reference to `__atomic_load_8'
LDFLAGS:append:mips = " -Wl,--no-as-needed -latomic -Wl,--as-needed"
LDFLAGS:append:powerpc = " -Wl,--no-as-needed -latomic -Wl,--as-needed"
LDFLAGS:append:riscv32 = " -Wl,--no-as-needed -latomic -Wl,--as-needed"
do_install:append() {
if ! ${@bb.utils.contains('PTEST_ENABLED', '1', 'true', 'false', d)}; then
rm -rf ${D}${sysconfdir}/dbus-1
fi
}
PTEST_PATH = "${libdir}/${BPN}/tests"
FILES:${PN}-ptest =+ "${sysconfdir}/dbus-1/system.d/"
FILES:${PN}-dev += "${bindir}/sdbus-c++-xml2cpp"
# It adds -isystem which is spurious, no idea where it gets it from
CCACHE_DISABLE = "1"

View File

@@ -0,0 +1,26 @@
# STARTUP
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -t sysfs sysfs /sys
::sysinit:/bin/mount -t devtmpfs devtmpfs /dev
::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mkdir -p /dev/pts
::sysinit:/bin/mount -t devpts devpts /dev/pts
::sysinit:/bin/mount -a
::sysinit:/bin/ln -sf /proc/self/fd /dev/fd
::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin
::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout
::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
::sysinit:/bin/hostname -F /etc/hostname
::sysinit:/etc/init.d/rcS
# REBOOT
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/init.d/rcK
::shutdown:/bin/umount -a -r
# RESTART INIT
::restart:/sbin/init

View File

@@ -0,0 +1,26 @@
#!/bin/sh
# Stop all init scripts in /etc/rc6.d
# executing them in numerical order.
#
for i in /etc/rc6.d/K??*; do
# Ignore dangling symlinks (if any).
[ ! -f "$i" ] && continue
case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set stop
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i stop
;;
esac
done

View File

@@ -0,0 +1,27 @@
#!/bin/sh
# Start all init scripts in /etc/rcS.d and /etc/rc5.d
# executing them in numerical order.
#
for i in /etc/rcS.d/S??* /etc/rc5.d/S??* ;do
# Ignore dangling symlinks (if any).
[ ! -f "$i" ] && continue
case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set start
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i start
;;
esac
done

View File

@@ -0,0 +1,64 @@
SUMMARY = "Toybox Inittab Configuration"
LICENSE = "0BSD"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/0BSD;md5=f667a3c3830a55a17ec3067709f4526c"
# Unpack to ${S}/orig
#
SRC_URI = "\
file://inittab;subdir=${BP}/orig \
file://rcK;subdir=${BP}/orig \
file://rcS;subdir=${BP}/orig \
"
PACKAGE_ARCH = "${MACHINE_ARCH}"
RCONFLICTS:${PN} = "\
busybox-inittab \
sysvinit-inittab \
"
# Just being sure.
B = "${S}"
# most users may want to have getty enabled by default
PACKAGECONFIG ??= "getty"
PACKAGECONFIG[getty] = "\
enable_getty \
"
do_patch[noexec] = "1"
do_configure() {
# copy over files now to have a fresh start on each config
cp orig/* .
for config in ${PACKAGECONFIG_CONFARGS}; do
if [[ ${config} == "enable_getty" ]]; then
echo "# generated by bitbake recipe ${PN}" >> ${S}/inittab
for console in "${SERIAL_CONSOLES}"; do
param=$(echo ${console} | sed s/\;/\ /g)
name=$(echo ${param} | cut -d' ' -f2)
echo "$name::respawn:${base_sbindir}/getty ${param}" >> ${S}/inittab
done
fi
done
}
do_compile[noexec] = "1"
do_install() {
install -d ${D}${sysconfdir}
install -D -m 0644 ${S}/inittab ${D}${sysconfdir}/inittab
install -d ${D}${sysconfdir}/init.d
install -D -m 0744 ${S}/rcK ${D}${sysconfdir}/init.d/rcK
install -D -m 0744 ${S}/rcS ${D}${sysconfdir}/init.d/rcS
}
FILES:${PN} = "\
${sysconfdir}/inittab \
${sysconfdir}/init.d/rcK \
${sysconfdir}/init.d/rcS \
"

View File

@@ -0,0 +1,37 @@
From 7284c7ae0df9aa5a9c8aa0a81a018e17289fe2c4 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 8 Sep 2022 07:22:26 -0700
Subject: [PATCH] portability: Fix timer_settime_wrap for 32bit systems with
64bit time_t
glibc does not define SYS_timer_settime if the 32bit syscall is not
available, new architectures like riscv32 has defaulted to 64bit time_t
from get go and avoided wiring 32bit syscall, therefore alias it to
64bit version here
Upstream-Status: Submitted [https://github.com/landley/toybox/pull/373]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/portability.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/portability.c b/lib/portability.c
index d955d081..4baa9367 100644
--- a/lib/portability.c
+++ b/lib/portability.c
@@ -711,6 +711,12 @@ int timer_create_wrap(clockid_t c, struct sigevent *se, timer_t *t)
return 0;
}
+#if !defined(SYS_timer_settime) && defined(SYS_timer_settime64)
+// glibc does not define defines SYS_timer_settime on 32-bit systems
+// with 64-bit time_t defaults e.g. riscv32
+#define SYS_timer_settime SYS_timer_settime64
+#endif
+
int timer_settime_wrap(timer_t t, int flags, struct itimerspec *val,
struct itimerspec *old)
{
--
2.37.3

Some files were not shown because too many files have changed in this diff Show More