From patchwork Sun May 22 17:31:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqing Zhao X-Patchwork-Id: 8350 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1782CC433F5 for ; Sun, 22 May 2022 17:31:59 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.18139.1653240717973447423 for ; Sun, 22 May 2022 10:31:58 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=R6BXI12a; spf=none, err=permanent DNS error (domain: linux.intel.com, ip: 192.55.52.93, mailfrom: jiaqing.zhao@linux.intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653240718; x=1684776718; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1Fr5b8/Suyn0/937eu2VY6LIojYFKkTWGjlzaJ2X25s=; b=R6BXI12a4I6wXMB4PiVQw2C/ebOyusQ7XtgkuPIneZsWMDddvgkA88S4 e1vkYkgnbfy9W0RNixP3RDn+yQPPX0ecHuWhy4PTFMRYaQsV9QQx1efB2 ToUfjXe9TAeB5/CrkOeSrSpz8YjD/zTDGNoOnqtwBwOU9KX0HzO660R7v jwl1MNQmD5B7K0etO1xXq2tyOFwrIVuL+zfVRaZsd/qx9gYzFlEx4DnvO r49ZGOpg9wEWtWhLCA7kf1nBxgX+smgzhApU9mrRHQOw8zs6H9Ykh1EfU JU0LufDN6qin60BUAPb1HZET0Mvpa26c0mwq/WujVyHEr6QcoOBaIbcbP Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="270597919" X-IronPort-AV: E=Sophos;i="5.91,244,1647327600"; d="scan'208";a="270597919" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 10:31:57 -0700 X-IronPort-AV: E=Sophos;i="5.91,244,1647327600"; d="scan'208";a="571693872" Received: from unknown (HELO jiaqingz-bmcdev-container.sh.intel.com) ([10.239.138.232]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 10:31:56 -0700 From: Jiaqing Zhao To: openembedded-core@lists.openembedded.org Cc: Jiaqing Zhao Subject: [oe-core] [PATCH 1/4] systemd: Drop 0001-test-parse-argument-Include-signal.h.patch Date: Mon, 23 May 2022 01:31:42 +0800 Message-Id: <20220522173145.1015305-2-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220522173145.1015305-1-jiaqing.zhao@linux.intel.com> References: <20220522173145.1015305-1-jiaqing.zhao@linux.intel.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 22 May 2022 17:31:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165981 This patch has already been upstreamed in commit systemd/850f0008bff7 ("test-parse-argument: Include signal.h") since v249 stable release. Signed-off-by: Jiaqing Zhao --- ...test-parse-argument-Include-signal.h.patch | 27 ------------------- meta/recipes-core/systemd/systemd_250.5.bb | 1 - 2 files changed, 28 deletions(-) delete mode 100644 meta/recipes-core/systemd/systemd/0001-test-parse-argument-Include-signal.h.patch diff --git a/meta/recipes-core/systemd/systemd/0001-test-parse-argument-Include-signal.h.patch b/meta/recipes-core/systemd/systemd/0001-test-parse-argument-Include-signal.h.patch deleted file mode 100644 index 898e8af904..0000000000 --- a/meta/recipes-core/systemd/systemd/0001-test-parse-argument-Include-signal.h.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 93c7e482d39cf7765974b3c729d29c1b120a60e3 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 24 May 2021 18:26:27 -0700 -Subject: [PATCH] test-parse-argument: Include signal.h - -Fixes -src/test/test-parse-argument.c:49:29: error: use of undeclared identifier 'SIGABRT' - -Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/19718] -Signed-off-by: Khem Raj - ---- - src/test/test-parse-argument.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/test/test-parse-argument.c b/src/test/test-parse-argument.c -index cf3d54288a..15104e5282 100644 ---- a/src/test/test-parse-argument.c -+++ b/src/test/test-parse-argument.c -@@ -5,6 +5,7 @@ - #include "parse-argument.h" - #include "stdio-util.h" - #include "tests.h" -+#include - - TEST(parse_json_argument) { - JsonFormatFlags flags = JSON_FORMAT_PRETTY; diff --git a/meta/recipes-core/systemd/systemd_250.5.bb b/meta/recipes-core/systemd/systemd_250.5.bb index c121fb763e..aca140d4d4 100644 --- a/meta/recipes-core/systemd/systemd_250.5.bb +++ b/meta/recipes-core/systemd/systemd_250.5.bb @@ -24,7 +24,6 @@ SRC_URI += "file://touchscreen.rules \ file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ file://0003-implment-systemd-sysv-install-for-OE.patch \ file://0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch \ - file://0001-test-parse-argument-Include-signal.h.patch \ file://0001-resolve-Use-sockaddr-pointer-type-for-bind.patch \ " From patchwork Sun May 22 17:31:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqing Zhao X-Patchwork-Id: 8352 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF7A1C433F5 for ; Sun, 22 May 2022 17:32:08 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web08.18537.1653240719483110589 for ; Sun, 22 May 2022 10:31:59 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=n+m2JXpZ; spf=none, err=permanent DNS error (domain: linux.intel.com, ip: 192.55.52.93, mailfrom: jiaqing.zhao@linux.intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653240719; x=1684776719; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QXZuAO+jHMzWiHUir5KHsEBufR8jNILqQGi/zYFe4YI=; b=n+m2JXpZeNcI0+MA7ihwVzEiUuzyfomJ3o0OGXrT+IhxaCuZFpxhuLpl 7pUx08/3dvTXhZNBY5Ok09bAE/fB0yHtHf9SyZrLiYcIcGbg+hZZn5joa hDkFcbrYnW4VFs4G9S07JPE9cfbmst6hpILGVgDx78LdnXfzRD68AN8P6 unYk//vaEa+sb4BJIqk58byrATFdnFu/ZYdLOgxI2qPkSTUg+KeLBA9DI vmhDj5GFwFRZL6+8kMyjc7DaBEZYS1mj7lz1u+iarhn4i3F+Xg5q56LcN HMrArZPDyX1e76yr9XeGMw5RUDaOF7VmOPHa55SuD3150vdziOeqr4cT9 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="270597920" X-IronPort-AV: E=Sophos;i="5.91,244,1647327600"; d="scan'208";a="270597920" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 10:31:59 -0700 X-IronPort-AV: E=Sophos;i="5.91,244,1647327600"; d="scan'208";a="571693875" Received: from unknown (HELO jiaqingz-bmcdev-container.sh.intel.com) ([10.239.138.232]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 10:31:57 -0700 From: Jiaqing Zhao To: openembedded-core@lists.openembedded.org Cc: Jiaqing Zhao Subject: [oe-core] [PATCH 2/4] systemd: Remove __compare_fn_t type in musl-specific patch Date: Mon, 23 May 2022 01:31:43 +0800 Message-Id: <20220522173145.1015305-3-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220522173145.1015305-1-jiaqing.zhao@linux.intel.com> References: <20220522173145.1015305-1-jiaqing.zhao@linux.intel.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 22 May 2022 17:32:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165983 Since systemd v250, commit d8f16737005e ("sort-util: avoid using glibc's internal __compar_d_fn_t type"), __compare_fn_t type is no longer used. This patch removes that type in the musl-specific patch. Signed-off-by: Jiaqing Zhao --- ...-missing_type.h-add-comparison_fn_t.patch} | 44 ++++++------------- ...missing.h-check-for-missing-strndupa.patch | 14 +++--- meta/recipes-core/systemd/systemd_250.5.bb | 2 +- 3 files changed, 22 insertions(+), 38 deletions(-) rename meta/recipes-core/systemd/systemd/{0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch => 0003-missing_type.h-add-comparison_fn_t.patch} (61%) diff --git a/meta/recipes-core/systemd/systemd/0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch b/meta/recipes-core/systemd/systemd/0003-missing_type.h-add-comparison_fn_t.patch similarity index 61% rename from meta/recipes-core/systemd/systemd/0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch rename to meta/recipes-core/systemd/systemd/0003-missing_type.h-add-comparison_fn_t.patch index dfe4164900..c28c8381e8 100644 --- a/meta/recipes-core/systemd/systemd/0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch +++ b/meta/recipes-core/systemd/systemd/0003-missing_type.h-add-comparison_fn_t.patch @@ -1,13 +1,9 @@ -From a4f51ef07375466f79cb148ff1178ed11f808f0a Mon Sep 17 00:00:00 2001 +From 5513b918d02900a3a78fd0e0300a118b163edfef Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Mon, 25 Feb 2019 13:55:12 +0800 -Subject: [PATCH] missing_type.h: add __compare_fn_t and comparison_fn_t +Subject: [PATCH] missing_type.h: add comparison_fn_t -Make it work with musl where comparison_fn_t and __compare_fn_t -is not provided. - -Revisit this when upgrading to 251+ systemd since systemd does not need -__compare_fn_t anymore +Make it work with musl where comparison_fn_t and is not provided. Upstream-Status: Inappropriate [musl specific] @@ -16,19 +12,19 @@ Signed-off-by: Alex Kiernan Signed-off-by: Chen Qi [Rebased for v242] Signed-off-by: Andrej Valek - +[Rebased for v250, Drop __compare_fn_t] +Signed-off-by: Jiaqing Zhao --- - src/basic/missing_type.h | 9 +++++++++ + src/basic/missing_type.h | 4 ++++ src/basic/sort-util.h | 1 + - src/core/kmod-setup.c | 1 + src/libsystemd/sd-journal/catalog.c | 1 + - 4 files changed, 12 insertions(+) + 3 files changed, 6 insertions(+) diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h -index f6233090a9..aeaf6ad5ec 100644 +index f6233090a9..6c0456349d 100644 --- a/src/basic/missing_type.h +++ b/src/basic/missing_type.h -@@ -10,3 +10,12 @@ +@@ -10,3 +10,7 @@ #if !HAVE_CHAR16_T #define char16_t uint16_t #endif @@ -36,13 +32,8 @@ index f6233090a9..aeaf6ad5ec 100644 +#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 diff --git a/src/basic/sort-util.h b/src/basic/sort-util.h -index cb448df109..fd738a65ab 100644 +index 02a6784d99..0b33c83d59 100644 --- a/src/basic/sort-util.h +++ b/src/basic/sort-util.h @@ -4,6 +4,7 @@ @@ -53,18 +44,6 @@ index cb448df109..fd738a65ab 100644 /* 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 -diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c -index d054668b8e..d3bf55acbe 100644 ---- 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" diff --git a/src/libsystemd/sd-journal/catalog.c b/src/libsystemd/sd-journal/catalog.c index 8fc87b131a..36a6efdbd8 100644 --- a/src/libsystemd/sd-journal/catalog.c @@ -77,3 +56,6 @@ index 8fc87b131a..36a6efdbd8 100644 const char * const catalog_file_dirs[] = { "/usr/local/lib/systemd/catalog/", +-- +2.34.1 + diff --git a/meta/recipes-core/systemd/systemd/0005-src-basic-missing.h-check-for-missing-strndupa.patch b/meta/recipes-core/systemd/systemd/0005-src-basic-missing.h-check-for-missing-strndupa.patch index 4b1fac06b5..680930ca3c 100644 --- a/meta/recipes-core/systemd/systemd/0005-src-basic-missing.h-check-for-missing-strndupa.patch +++ b/meta/recipes-core/systemd/systemd/0005-src-basic-missing.h-check-for-missing-strndupa.patch @@ -1,4 +1,4 @@ -From 55d48dd81e57add5b2d4b5a7d697c575a0f37ef5 Mon Sep 17 00:00:00 2001 +From 106b7bd7186c9d6c1dcd72bd4ca6457d3fa72d0b Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Mon, 25 Feb 2019 14:18:21 +0800 Subject: [PATCH] src/basic/missing.h: check for missing strndupa @@ -17,7 +17,6 @@ Signed-off-by: Alex Kiernan [rebased for systemd 244] [Rebased for v247] Signed-off-by: Luca Boccassi - --- meson.build | 1 + src/backlight/backlight.c | 1 + @@ -74,7 +73,7 @@ Signed-off-by: Luca Boccassi 52 files changed, 63 insertions(+) diff --git a/meson.build b/meson.build -index ae53345260..8c8a6c9bdf 100644 +index cb9936ee8b..7ab201c6d9 100644 --- a/meson.build +++ b/meson.build @@ -507,6 +507,7 @@ foreach ident : ['secure_getenv', '__secure_getenv'] @@ -310,13 +309,13 @@ index 0b20d386d3..fccfb9268c 100644 #define IDLE_TIMEOUT_USEC (5*USEC_PER_SEC) #define IDLE_TIMEOUT2_USEC (1*USEC_PER_SEC) diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c -index d3bf55acbe..63dd807b8a 100644 +index d054668b8e..9b4caa7651 100644 --- a/src/core/kmod-setup.c +++ b/src/core/kmod-setup.c -@@ -11,6 +11,7 @@ +@@ -10,6 +10,7 @@ + #include "macro.h" #include "recurse-dir.h" #include "string-util.h" - #include "missing_type.h" +#include "missing_stdlib.h" #if HAVE_KMOD @@ -705,3 +704,6 @@ index 1a384d6b38..0089833e3f 100644 #define RULES_DIRS (const char* const*) CONF_PATHS_STRV("udev/rules.d") +-- +2.34.1 + diff --git a/meta/recipes-core/systemd/systemd_250.5.bb b/meta/recipes-core/systemd/systemd_250.5.bb index aca140d4d4..6d6b3f2ded 100644 --- a/meta/recipes-core/systemd/systemd_250.5.bb +++ b/meta/recipes-core/systemd/systemd_250.5.bb @@ -31,7 +31,7 @@ SRC_URI += "file://touchscreen.rules \ 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://0003-missing_type.h-add-comparison_fn_t.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 \ From patchwork Sun May 22 17:31:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqing Zhao X-Patchwork-Id: 8351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC004C433FE for ; Sun, 22 May 2022 17:32:08 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web08.18537.1653240719483110589 for ; Sun, 22 May 2022 10:32:00 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ZDY4d+W4; spf=none, err=permanent DNS error (domain: linux.intel.com, ip: 192.55.52.93, mailfrom: jiaqing.zhao@linux.intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653240720; x=1684776720; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CoRxwj2iA/JYbb+R18NkPPJ8E5WO3lEId/gjnFL9fTc=; b=ZDY4d+W4IPykzvrajLORNUrUZpoGJbwr8dF0j/X+rQJ6Hkv33ClXx0mB gOlqKxwd5jT1XaTnkmtQXwDtzwNACx/GRqlw1OigK5I1rU/02WLCLQUCa LZy7Wub2vwFJ/eIU00NocGu9JuquYCmpJ9zNPlU2MLHnT/2etXl0txSR+ bt4AGZhPxwrhwFXQET94QkGLiJRSagQg5o/J2mQ2CWiXonMyZ7eXwUlEX bO+J1QHE1tnOnB4oHmjOxtRXBDIxGKNu8Hr2upVRZb1mwrMEBXFsJ4shR +G+fwzRxhJpwZdLAJ4urNu+M7Cz1qfCBm8RZex2SeU1IhCFso/VD/Hoib g==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="270597931" X-IronPort-AV: E=Sophos;i="5.91,244,1647327600"; d="scan'208";a="270597931" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 10:32:00 -0700 X-IronPort-AV: E=Sophos;i="5.91,244,1647327600"; d="scan'208";a="571693876" Received: from unknown (HELO jiaqingz-bmcdev-container.sh.intel.com) ([10.239.138.232]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 10:31:59 -0700 From: Jiaqing Zhao To: openembedded-core@lists.openembedded.org Cc: Jiaqing Zhao Subject: [oe-core] [PATCH 3/4] systemd: Drop 0002-don-t-use-glibc-specific-qsort_r.patch Date: Mon, 23 May 2022 01:31:44 +0800 Message-Id: <20220522173145.1015305-4-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220522173145.1015305-1-jiaqing.zhao@linux.intel.com> References: <20220522173145.1015305-1-jiaqing.zhao@linux.intel.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 22 May 2022 17:32:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165984 musl 1.2.3 implements qsort_r function. Signed-off-by: Jiaqing Zhao --- ...002-don-t-use-glibc-specific-qsort_r.patch | 163 ------------------ meta/recipes-core/systemd/systemd_250.5.bb | 1 - 2 files changed, 164 deletions(-) delete mode 100644 meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch diff --git a/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch b/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch deleted file mode 100644 index d109860e1a..0000000000 --- a/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch +++ /dev/null @@ -1,163 +0,0 @@ -From c542d2d93cf536e91d4edb8791fdc0de732b0a52 Mon Sep 17 00:00:00 2001 -From: Chen Qi -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 -[Rebased for v241] -Signed-off-by: Chen Qi -[Rebased for v242] -Signed-off-by: Andrej Valek -[Rebased for v247] -Signed-off-by: Luca Boccassi - ---- - 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(-) - -diff --git a/src/basic/sort-util.h b/src/basic/sort-util.h -index 02a6784d99..cb448df109 100644 ---- a/src/basic/sort-util.h -+++ b/src/basic/sort-util.h -@@ -61,18 +61,4 @@ static inline void _qsort_safe(void *base, size_t nmemb, size_t size, comparison - _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); -diff --git a/src/shared/format-table.c b/src/shared/format-table.c -index b95680b365..5ffa208615 100644 ---- a/src/shared/format-table.c -+++ b/src/shared/format-table.c -@@ -1324,30 +1324,32 @@ static int cell_data_compare(TableData *a, size_t index_a, TableData *b, size_t - 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 **ret) { - 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) -diff --git a/src/shared/hwdb-util.c b/src/shared/hwdb-util.c -index fe4785f3e5..827e1639c3 100644 ---- a/src/shared/hwdb-util.c -+++ b/src/shared/hwdb-util.c -@@ -127,9 +127,13 @@ static struct trie* trie_free(struct trie *trie) { - - 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 trie *trie, struct trie_node *node, - .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 trie *trie, struct trie_node *node, - .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; - } - diff --git a/meta/recipes-core/systemd/systemd_250.5.bb b/meta/recipes-core/systemd/systemd_250.5.bb index 6d6b3f2ded..81fe0c88e0 100644 --- a/meta/recipes-core/systemd/systemd_250.5.bb +++ b/meta/recipes-core/systemd/systemd_250.5.bb @@ -30,7 +30,6 @@ SRC_URI += "file://touchscreen.rules \ # 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-comparison_fn_t.patch \ file://0004-add-fallback-parse_printf_format-implementation.patch \ file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \ From patchwork Sun May 22 17:31:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqing Zhao X-Patchwork-Id: 8353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB4EFC433EF for ; Sun, 22 May 2022 17:32:08 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web08.18537.1653240719483110589 for ; Sun, 22 May 2022 10:32:02 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Im6Kh/KS; spf=none, err=permanent DNS error (domain: linux.intel.com, ip: 192.55.52.93, mailfrom: jiaqing.zhao@linux.intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653240721; x=1684776721; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bck9FA8q4Vk8fPwis2AlyJf52jB3QoraDTGJ26rOMVg=; b=Im6Kh/KSTY+jGgxkl2yE9jQtBpQBz15l4SGDXhwNJt82+Jq+QwJFDVzP fe5RQA+S6Cy6IoluVRe+EekH1CxYW9i87QeWr7/pebaw1WglM+QPR+XmF fuHLCS9oHtnH/wdfUxgLQE5o269PsbcvSNFlH0Hdf+lci+nnM8KNaKQIN XkytNr7JB/BliaFl4iTUTXU83XvWQLkiYB0MTzWiU7l+NOb/BytRL8nxF ES6FrOWGMFbBwHJt3TOwYELDPO1ald8kXEdERUXJCcJBozeJLTPlYajmh 8dEMreh8w5nnEvK3tJe22amTsD3BY5y4CTdLfHA/tWkbe6XhiLmcMDXB1 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="270597934" X-IronPort-AV: E=Sophos;i="5.91,244,1647327600"; d="scan'208";a="270597934" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 10:32:01 -0700 X-IronPort-AV: E=Sophos;i="5.91,244,1647327600"; d="scan'208";a="571693877" Received: from unknown (HELO jiaqingz-bmcdev-container.sh.intel.com) ([10.239.138.232]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 10:32:00 -0700 From: Jiaqing Zhao To: openembedded-core@lists.openembedded.org Cc: Jiaqing Zhao Subject: [oe-core] [PATCH 4/4] systemd: Fix path returned in sd_path_lookup() Date: Mon, 23 May 2022 01:31:45 +0800 Message-Id: <20220522173145.1015305-5-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220522173145.1015305-1-jiaqing.zhao@linux.intel.com> References: <20220522173145.1015305-1-jiaqing.zhao@linux.intel.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 22 May 2022 17:32:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165985 In oe-core, sysusers.d/sysctl.d/binfmt.d/modules-load.d are still kept under /usr/lib instead of /lib changed in systemd v246. This patch changes the SD_PATH_{SYSUSERS,SYSCTL,BINFMT,MODULES_LOAD} returned in sd_path_lookup() back to the /usr/lib ones. Also updates the patch description and upstream status. Signed-off-by: Jiaqing Zhao --- ...sysctl.d-binfmt.d-modules-load.d-to-.patch | 73 +++++++++++++++++++ ...se-ROOTPREFIX-without-suffixed-slash.patch | 42 ----------- meta/recipes-core/systemd/systemd_250.5.bb | 2 +- 3 files changed, 74 insertions(+), 43 deletions(-) create mode 100644 meta/recipes-core/systemd/systemd/0001-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch delete mode 100644 meta/recipes-core/systemd/systemd/0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch diff --git a/meta/recipes-core/systemd/systemd/0001-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch b/meta/recipes-core/systemd/systemd/0001-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch new file mode 100644 index 0000000000..31efc4cc4b --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch @@ -0,0 +1,73 @@ +From beb0219b71510bc63aed81d2a970a04349d6c616 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 29 Sep 2020 18:01:41 -0700 +Subject: [PATCH] Move sysusers.d/sysctl.d/binfmt.d/modules-load.d to /usr + +These directories are moved to /lib since systemd v246, commit +4a56315a990b ("path: use ROOTPREFIX properly"), but in oe-core/yocto, +the old /usr/lib is still being used. + +Upstream-Status: Inappropriate (OE-specific) +Signed-off-by: Khem Raj +Signed-off-by: Jiaqing Zhao +--- + src/core/systemd.pc.in | 8 ++++---- + src/libsystemd/sd-path/sd-path.c | 8 ++++---- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in +index fc0f8c34fa..65996bbed8 100644 +--- a/src/core/systemd.pc.in ++++ b/src/core/systemd.pc.in +@@ -65,16 +65,16 @@ systemdshutdowndir=${systemd_shutdown_dir} + tmpfiles_dir=${prefix}/lib/tmpfiles.d + tmpfilesdir=${tmpfiles_dir} + +-sysusers_dir=${rootprefix}/lib/sysusers.d ++sysusers_dir=${prefix}/lib/sysusers.d + sysusersdir=${sysusers_dir} + +-sysctl_dir=${rootprefix}/lib/sysctl.d ++sysctl_dir=${prefix}/lib/sysctl.d + sysctldir=${sysctl_dir} + +-binfmt_dir=${rootprefix}/lib/binfmt.d ++binfmt_dir=${prefix}/lib/binfmt.d + binfmtdir=${binfmt_dir} + +-modules_load_dir=${rootprefix}/lib/modules-load.d ++modules_load_dir=${prefix}/lib/modules-load.d + modulesloaddir=${modules_load_dir} + + catalog_dir=${prefix}/lib/systemd/catalog +diff --git a/src/libsystemd/sd-path/sd-path.c b/src/libsystemd/sd-path/sd-path.c +index ff1e0d5f8e..19a001f47e 100644 +--- a/src/libsystemd/sd-path/sd-path.c ++++ b/src/libsystemd/sd-path/sd-path.c +@@ -362,19 +362,19 @@ static int get_path(uint64_t type, char **buffer, const char **ret) { + return 0; + + case SD_PATH_SYSUSERS: +- *ret = ROOTPREFIX_NOSLASH "/lib/sysusers.d"; ++ *ret = "/usr/lib/sysusers.d"; + return 0; + + case SD_PATH_SYSCTL: +- *ret = ROOTPREFIX_NOSLASH "/lib/sysctl.d"; ++ *ret = "/usr/lib/sysctl.d"; + return 0; + + case SD_PATH_BINFMT: +- *ret = ROOTPREFIX_NOSLASH "/lib/binfmt.d"; ++ *ret = "/usr/lib/binfmt.d"; + return 0; + + case SD_PATH_MODULES_LOAD: +- *ret = ROOTPREFIX_NOSLASH "/lib/modules-load.d"; ++ *ret = "/usr/lib/modules-load.d"; + return 0; + + case SD_PATH_CATALOG: +-- +2.34.1 + diff --git a/meta/recipes-core/systemd/systemd/0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch b/meta/recipes-core/systemd/systemd/0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch deleted file mode 100644 index 752824688f..0000000000 --- a/meta/recipes-core/systemd/systemd/0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 58860e0f248576a80ff2af256ba42713c186ae93 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 29 Sep 2020 18:01:41 -0700 -Subject: [PATCH] systemd.pc.in: use ROOTPREFIX without suffixed slash - -This complements the commit -https://github.com/poettering/systemd/commit/b612c26ceb9f56af0271fc9f07c1724d2d260a8a - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - src/core/systemd.pc.in | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in -index b5cc8f9..21dbf30 100644 ---- a/src/core/systemd.pc.in -+++ b/src/core/systemd.pc.in -@@ -65,16 +65,16 @@ systemdshutdowndir=${systemd_shutdown_dir} - tmpfiles_dir=${prefix}/lib/tmpfiles.d - tmpfilesdir=${tmpfiles_dir} - --sysusers_dir=${rootprefix}/lib/sysusers.d -+sysusers_dir=${prefix}/lib/sysusers.d - sysusersdir=${sysusers_dir} - --sysctl_dir=${rootprefix}/lib/sysctl.d -+sysctl_dir=${prefix}/lib/sysctl.d - sysctldir=${sysctl_dir} - --binfmt_dir=${rootprefix}/lib/binfmt.d -+binfmt_dir=${prefix}/lib/binfmt.d - binfmtdir=${binfmt_dir} - --modules_load_dir=${rootprefix}/lib/modules-load.d -+modules_load_dir=${prefix}/lib/modules-load.d - modulesloaddir=${modules_load_dir} - - catalog_dir=${prefix}/lib/systemd/catalog --- -2.25.1 - diff --git a/meta/recipes-core/systemd/systemd_250.5.bb b/meta/recipes-core/systemd/systemd_250.5.bb index 81fe0c88e0..006b2f86ea 100644 --- a/meta/recipes-core/systemd/systemd_250.5.bb +++ b/meta/recipes-core/systemd/systemd_250.5.bb @@ -23,7 +23,7 @@ SRC_URI += "file://touchscreen.rules \ file://systemd-pager.sh \ file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ file://0003-implment-systemd-sysv-install-for-OE.patch \ - file://0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch \ + file://0001-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \ file://0001-resolve-Use-sockaddr-pointer-type-for-bind.patch \ "