From patchwork Mon Feb 12 20:13:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waldemar Brodkorb X-Patchwork-Id: 872360 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zgH1W4BFxz9t32 for ; Tue, 13 Feb 2018 07:13:50 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0CC6188CE6; Mon, 12 Feb 2018 20:13:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w7cjnJnDcMON; Mon, 12 Feb 2018 20:13:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 06B7888CCA; Mon, 12 Feb 2018 20:13:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id A26341C3E85 for ; Mon, 12 Feb 2018 20:13:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9C8272F692 for ; Mon, 12 Feb 2018 20:13:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VO43Pxpo2wCa for ; Mon, 12 Feb 2018 20:13:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) by silver.osuosl.org (Postfix) with ESMTPS id DEA8E2EBE8 for ; Mon, 12 Feb 2018 20:13:43 +0000 (UTC) Received: by helium.openadk.org (Postfix, from userid 1000) id 246A3100E9; Mon, 12 Feb 2018 21:13:41 +0100 (CET) Date: Mon, 12 Feb 2018 21:13:41 +0100 From: Waldemar Brodkorb To: buildroot@buildroot.org Message-ID: <20180212201340.GA4165@waldemar-brodkorb.de> MIME-Version: 1.0 Content-Disposition: inline X-Operating-System: Linux 3.16.0-5-amd64 x86_64 User-Agent: Mutt/1.5.23 (2014-03-12) Subject: [Buildroot] [PATCH v5] systemd: allow to build with uClibc toolchains X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" We need to disable any systemd parts using either IDN, NSS or gshadow. IDN is only disabled in C library function call to getnameinfo(), it does not effect libidn/libidn2 usage in systemd. While trying to disable resolve functionality, a typo was recognized. Tested with qemu-system-arm. Signed-off-by: Waldemar Brodkorb --- v1 -> v2: - added Upstream commit URL suggested by Thomas Petazzoni - rework enable/disable options suggested by Thomas Petazzoni - extend commit message a little bit v2 -> v3: - sync to latest master changes - remove patches included upstream - disable features not usable with uClibc-ng lacking nss.h v3 -> v4: - add comment about missing nss suggested by Arnout - add extra parenthesis suggested by Arnout v4 -> v5: - update after switch to meson - fix typo for resolve option --- package/systemd/Config.in | 3 +++ package/systemd/systemd.mk | 15 +++++++++++++-- system/Config.in | 6 +++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/package/systemd/Config.in b/package/systemd/Config.in index 661f40d..81eee96 100644 --- a/package/systemd/Config.in +++ b/package/systemd/Config.in @@ -190,6 +190,7 @@ config BR2_PACKAGE_SYSTEMD_MACHINED config BR2_PACKAGE_SYSTEMD_MYHOSTNAME bool "enable myhostname NSS plugin" + depends on !BR2_TOOLCHAIN_USES_UCLIBC # needs nss.h default y help nss-myhostname is a plug-in module for the GNU Name Service @@ -245,6 +246,7 @@ config BR2_PACKAGE_SYSTEMD_RANDOMSEED config BR2_PACKAGE_SYSTEMD_RESOLVED bool "enable resolve daemon" + depends on !BR2_TOOLCHAIN_USES_UCLIBC # needs nss.h default y help systemd-resolved is a system service that provides network @@ -278,6 +280,7 @@ config BR2_PACKAGE_SYSTEMD_SMACK_SUPPORT config BR2_PACKAGE_SYSTEMD_SYSUSERS bool "enable sysusers support" + depends on !BR2_TOOLCHAIN_USES_UCLIBC # needs gshadow.h help systemd-sysusers creates system users and groups, based on the file format and location specified in sysusers.d(5). diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk index 1c31ebb..2bc665e 100644 --- a/package/systemd/systemd.mk +++ b/package/systemd/systemd.mk @@ -48,6 +48,17 @@ SYSTEMD_CONF_OPTS += \ -Dmount-path=/usr/bin/mount \ -Dumount-path=/usr/bin/umount +# disable unsupported features for non-glibc toolchains +ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y) +SYSTEMD_CONF_OPTS += \ + -Didn=true \ + -Dnss-systemd=true +else +SYSTEMD_CONF_OPTS += \ + -Didn=false \ + -Dnss-systemd=false +endif + ifeq ($(BR2_PACKAGE_ACL),y) SYSTEMD_DEPENDENCIES += acl SYSTEMD_CONF_OPTS += -Dacl=true @@ -287,10 +298,10 @@ SYSTEMD_CONF_OPTS += -Dnetworkd=false endif ifeq ($(BR2_PACKAGE_SYSTEMD_RESOLVED),y) -SYSTEMD_CONF_OPTS += -Dresolved=true +SYSTEMD_CONF_OPTS += -Dresolve=true SYSTEMD_RESOLVED_USER = systemd-resolve -1 systemd-resolve -1 * - - - Network Name Resolution Manager else -SYSTEMD_CONF_OPTS += -Dresolved=false +SYSTEMD_CONF_OPTS += -Dresolve=false endif ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y) diff --git a/system/Config.in b/system/Config.in index d48cf8d..7b36516 100644 --- a/system/Config.in +++ b/system/Config.in @@ -127,7 +127,7 @@ config BR2_INIT_SYSV config BR2_INIT_SYSTEMD bool "systemd" depends on BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS - depends on BR2_TOOLCHAIN_USES_GLIBC + depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_UCLIBC depends on BR2_USE_WCHAR depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_TOOLCHAIN_HAS_SSP @@ -137,8 +137,8 @@ config BR2_INIT_SYSTEMD select BR2_ROOTFS_MERGED_USR select BR2_PACKAGE_SYSTEMD -comment "systemd needs a glibc toolchain, headers >= 3.10" - depends on !(BR2_TOOLCHAIN_USES_GLIBC \ +comment "systemd needs a glibc or uClibc toolchain, headers >= 3.10" + depends on !(BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_UCLIBC \ && BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10) config BR2_INIT_NONE