From patchwork Mon Nov 11 17:24:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsOpbXkgUk9TRU4=?= X-Patchwork-Id: 1193036 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=smile.fr Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=smile-fr.20150623.gappssmtp.com header.i=@smile-fr.20150623.gappssmtp.com header.b="kCsKRUvS"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47Bd6q2N1Qz9sP3 for ; Tue, 12 Nov 2019 04:25:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0DB82867BD; Mon, 11 Nov 2019 17:25:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YD6Pb4KSkHj3; Mon, 11 Nov 2019 17:25:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7C1738672E; Mon, 11 Nov 2019 17:25:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 70B4D1BF955 for ; Mon, 11 Nov 2019 17:24:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6E0A8820F7 for ; Mon, 11 Nov 2019 17:24:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sOzYKvtUnOxh for ; Mon, 11 Nov 2019 17:24:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id DCC9B81ED9 for ; Mon, 11 Nov 2019 17:24:55 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id i12so8620354wro.5 for ; Mon, 11 Nov 2019 09:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Pj4ofB2/AgI1Ip3MsfS6Y/ivnPt3AdvxwW9M23WTV4A=; b=kCsKRUvSy7XjGkpmqSJAkIBIIxEPpzuzFp9UUOxltS6MslDWd19+2mzlZHPpGhf67M 0iXuQrJDejsKKMKzHGRlQD8dmgHByupWJy07ZEGVzBEKpOdNHkE1HFqQ05CoXABt+auy RKd4hnD+sbtgi4rxwzBJPau6n1TeQ2rTmgb54uHxb+rMEa2L4G3oILEkuM5SF7881j7i NdrZfv1beSFSUN68pZaSWR/uEuLxkHfge/4J/Ycu3sZWsqR6ZNe8pni3RX0y+0oD2DL/ toGRmpBhPrUUiQrvS3pbjKqQe2J0e69R2MYN0gXebkb2FVQeErrzGrbDOOZHKQAcWhLn p6OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Pj4ofB2/AgI1Ip3MsfS6Y/ivnPt3AdvxwW9M23WTV4A=; b=DsR/6RI7eqGYa+Hir9fm5vljUQKdq6J0suSqKFyjaoMufkcEOnAzPN2giMBAzsC1V9 iCSpqZo1z1hcd0xat+PdRLTEr/BInUyuTzS3rSAczyRM8xI/RN3v5R8Jzz/i72f6xc6I nQvK3GU6bLNh0N0jUYPAkuL1GFMj0fWxz9A/E/qFBDvwr+VIFZ+kSxSppQCNaTk4RQo3 RM9R+16LNfvLYIqrbwVArSUF72pw4Y/DcCPsAKO3k5axZwW37TOabmnznXRqeMaOyCRz kGJkCxFzvoI4OBGiamhLD12Mwj2faBxels0VMPEXY5M0KyocaSoSzkA4wYYnQYHpz/RI eMwQ== X-Gm-Message-State: APjAAAWt9I5dPeXoI3X/m7gmiXffY9h6KQ633QC6ytJKITS5DO3JoljZ Vm8ZnW7wS8O+6s8lk2afs5o+OVZn4Q== X-Google-Smtp-Source: APXvYqzmYaWQ6U8sH1pZSJY5E3v0fOVCgypDlSgMBZ/6rz4zBTFVtbQEQgrFMRMVebjqtbcX9AerWQ== X-Received: by 2002:a5d:6389:: with SMTP id p9mr20574240wru.324.1573493093681; Mon, 11 Nov 2019 09:24:53 -0800 (PST) Received: from localhost.localdomain (2a02-8428-0351-c201-62d6-24fd-3fad-e4ae.rev.sfr.net. [2a02:8428:351:c201:62d6:24fd:3fad:e4ae]) by smtp.googlemail.com with ESMTPSA id h15sm13393905wrb.44.2019.11.11.09.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 09:24:53 -0800 (PST) From: =?utf-8?b?SsOpcsOpbXkgUm9zZW4=?= To: buildroot@buildroot.org Date: Mon, 11 Nov 2019 18:24:35 +0100 Message-Id: <20191111172443.6874-2-jeremy.rosen@smile.fr> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191111172443.6874-1-jeremy.rosen@smile.fr> References: <20191111172443.6874-1-jeremy.rosen@smile.fr> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/9] new recipe : host-systemd X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?SsOpcsOpbXkgUm9zZW4=?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add the infrastructure to build the host version of systemd * disable all optional features, they can be re-added when needed * systemd has creative way of dealing with cross compile we build a "normal" host systemd, but install it in $HOST_DIR we use systemctl --root to correctly act on TARGET_DIR * we need to adjust RPATH using patchelf because meson can't do it correctly by itsel Signed-off-by: Jérémy Rosen --- package/systemd/systemd.mk | 93 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk index 92490eb86b..d1db60b5ef 100644 --- a/package/systemd/systemd.mk +++ b/package/systemd/systemd.mk @@ -551,3 +551,96 @@ SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV) SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV) $(eval $(meson-package)) + +# +# Host-systemd configuration +# +#Options tweaked for buildroot +HOST_SYSTEMD_CONF_OPTS= \ + -Dsplit-bin=true \ + -Dsplit-usr=false \ + --prefix=/usr \ + --libdir=lib \ + --sysconfdir=/etc \ + --localstatedir=/var + +#disable everything else +HOST_SYSTEMD_CONF_OPTS+= \ + -Dutmp=false \ + -Dhibernate=false \ + -Dldconfig=false \ + -Dresolve=false \ + -Defi=false \ + -Dtpm=false \ + -Denvironment-d=false \ + -Dbinfmt=false \ + -Dcoredump=false \ + -Dpstore=false \ + -Dlogind=false \ + -Dhostnamed=false \ + -Dlocaled=false \ + -Dmachined=false \ + -Dportabled=false \ + -Dnetworkd=false \ + -Dtimedated=false \ + -Dtimesyncd=false \ + -Dremote=false \ + -Dcreate-log-dirs=false \ + -Dnss-myhostname=false \ + -Dnss-mymachines=false \ + -Dnss-resolve=false \ + -Dnss-systemd=false \ + -Dfirstboot=false \ + -Drandomseed=false \ + -Dbacklight=false \ + -Dvconsole=false \ + -Dquotacheck=false \ + -Dsysusers=false \ + -Dtmpfiles=false \ + -Dimportd=false \ + -Dhwdb=false \ + -Drfkill=false \ + -Dman=false \ + -Dhtml=false \ + -Dsmack=false \ + -Dpolkit=false \ + -Dblkid=false \ + -Didn=false \ + -Dadm-group=false \ + -Dwheel-group=false \ + -Dzlib=false \ + -Dgshadow=false \ + -Dima=false \ + -Dtests=false \ + -Dglib=false \ + -Dacl=false \ + -Dsysvinit-path='' + +HOST_SYSTEMD_DEPENDENCIES = \ + host-util-linux \ + host-patchelf \ + host-libcap \ + host-gperf + +# Fix RPATH After installation +# * systemd provides a install_rpath instruction to meson because the binaries need to link with +# libsystemd which is not in a standard path +# * meson can only replace the RPATH, not append to it +# * the original rpatch is thus lost. +# * the original path had been tweaked by buildroot vial LD_FLAGS to add $(HOST_DIR)/lib +# * thus re-tweak rpath after the installation for all binaries that need it +#buildroot detects incorrect RPATH, so adding new binaries should be safe (it won't compile +#unless properly integrated). +HOST_SYSTEMD_HOST_TOOLS = \ + systemd-analyze systemd-mount systemctl + +define HOST_SYSTEMD_FIX_RPATH + $(foreach f,$(HOST_SYSTEMD_HOST_TOOLS), \ + $(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $(HOST_DIR)/bin/$(f) + ) +endef + +HOST_SYSTEMD_POST_INSTALL_HOOKS += HOST_SYSTEMD_FIX_RPATH +HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR) + +$(eval $(host-meson-package))