Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 01/15] new recipe : host-systemd
Date: Sat, 9 Nov 2019 22:49:22 +0100	[thread overview]
Message-ID: <20191109214922.GQ3419@scaer> (raw)
In-Reply-To: <20191103165640.21819-2-jeremy.rosen@smile.fr>

J?r?my, All,

On 2019-11-03 17:56 +0100, J?r?my Rosen spake thusly:
> 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 <jeremy.rosen@smile.fr>
[--SNIP--]
> diff --git a/package/systemd/Config.in.host b/package/systemd/Config.in.host
> new file mode 100644
> index 0000000000..09099752d2
> --- /dev/null
> +++ b/package/systemd/Config.in.host
> @@ -0,0 +1,4 @@
> +config BR2_PACKAGE_HOST_SYSTEMD
> +	bool "host systemd tools"
> +	help
> +	  Systemd command-line tools for the host

I don;t think we (at the current point) need a user-visible option.

This host-systemd is initially a way to get systemctl only, and this is
just internal to how Buildroot will enable the units (by using systemctl
preset-all or so).

Later, if/when it becomes possible to build extra utilities for users to
manually run (or in a post-build/image script), then we can expose a
user-visible host-systemd option.

But for now, it is not needed.

> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index 94d5f703cd..1e4f706517 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -550,3 +550,95 @@ SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
>  SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
>  
>  $(eval $(meson-package))
> +
> +
> +

Too many empty lines. Run 'make check-package'.

> +#
> +# Host-systemd configuration
> +#
> +HOST_SYSTEMD_CONF_OPTS= \
> +	-Dsplit-bin=true \
> +	-Dsplit-usr=false \
> +	-Dutmp=false \
> +	-Dhibernate=false \
> +	-Dldconfig=false \
> +	-Dresolve=false \
[--SNIP--]
> +	-Dsysvinit-path='' \
> +	--prefix=/usr \
> +	--libdir=lib \
> +	--sysconfdir=/etc \
> +	--localstatedir=/var \

This list will be difficult to maintain on each version bump... :-(
Can't we push for upstream to implement a simple switch:
--disable-all-that-is-not-explicitly-enabled-please-and-i-d-like-a-pony-too-pretty-please

> +
> +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

Once again, I think we should just keep systemctl for now: remove
everything else. We just need systemctl for now.

We can then *later* add those (esp. analyse).

> +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)

It is not possible to make an RPATH longer than it previously was. How
can we ensure that the rpath that is set by meson will be big enough to
later cary our own rpath?

Regards,
Yann E. MORIN.

> +	)
> +endef
> +
> +HOST_SYSTEMD_POST_INSTALL_HOOKS +=  HOST_SYSTEMD_FIX_RPATH
> +HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
> +
> +$(eval $(host-meson-package))
> -- 
> 2.24.0.rc1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  parent reply	other threads:[~2019-11-09 21:49 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-03 16:56 [Buildroot] [PATCH 00/15] use host-systemd to enable units Jérémy Rosen
2019-11-03 16:56 ` [Buildroot] [PATCH 01/15] new recipe : host-systemd Jérémy Rosen
2019-11-03 17:20   ` James Hilliard
2019-11-04 17:02     ` Jérémy ROSEN
     [not found]       ` <CAJ4jsafSoX5ayztTZgOS38YPtVZbT7gYkk3FKHQ0U1FDG8u+bA@mail.gmail.com>
     [not found]         ` <CAFvCimWyMdTTZDxv3EyKDaHGXhrzOd2brLSe+BgbuU9oxJ3S8A@mail.gmail.com>
2019-11-04 20:40           ` Carlos Santos
2019-11-09 21:52     ` Yann E. MORIN
2019-11-09 21:49   ` Yann E. MORIN [this message]
2019-11-10 10:43     ` Jérémy ROSEN
2019-11-03 16:56 ` [Buildroot] [PATCH 02/15] use host-systemctl preset all to enable units Jérémy Rosen
2019-11-03 16:56 ` [Buildroot] [PATCH 03/15] fix tty handling Jérémy Rosen
2019-11-03 17:48   ` James Hilliard
2019-11-04 17:08     ` Jérémy ROSEN
2019-11-03 16:56 ` [Buildroot] [PATCH 04/15] fix trivial packages with buildroot-provided services Jérémy Rosen
2019-11-03 16:56 ` [Buildroot] [PATCH 05/15] fix trivial cases, upstream-provided services Jérémy Rosen
2019-11-03 16:56 ` [Buildroot] [PATCH 06/15] package/avahi: adapt to preset-all Jérémy Rosen
2019-11-03 17:15   ` James Hilliard
2019-11-03 17:17     ` Jérémy ROSEN
2019-11-09 22:08       ` Yann E. MORIN
2019-11-03 16:56 ` [Buildroot] [PATCH 07/15] package/connman: " Jérémy Rosen
2019-11-03 17:39   ` James Hilliard
2019-11-09 22:11   ` Yann E. MORIN
2019-11-09 22:36     ` James Hilliard
2019-11-10 10:19       ` Jérémy ROSEN
2019-11-03 16:56 ` [Buildroot] [PATCH 08/15] package/dante: " Jérémy Rosen
2019-11-03 17:17   ` James Hilliard
2019-11-03 16:56 ` [Buildroot] [PATCH 09/15] package/linuxptp " Jérémy Rosen
2019-11-03 17:23   ` James Hilliard
2019-11-03 16:56 ` [Buildroot] [PATCH 10/15] package/docker-engine: " Jérémy Rosen
2019-11-03 17:25   ` James Hilliard
2019-11-04 17:03     ` Jérémy ROSEN
2019-11-03 16:56 ` [Buildroot] [PATCH 11/15] package/network-manager: " Jérémy Rosen
2019-11-03 17:30   ` James Hilliard
2019-11-09 22:14   ` Yann E. MORIN
2019-11-09 22:25     ` James Hilliard
2019-11-03 16:56 ` [Buildroot] [PATCH 12/15] package/wpa_supplicant: adapt for preset-all Jérémy Rosen
2019-11-03 17:32   ` James Hilliard
2019-11-03 16:56 ` [Buildroot] [PATCH 13/15] package/sysklogd: adapt to preset-all Jérémy Rosen
2019-11-03 17:33   ` James Hilliard
2019-11-03 16:56 ` [Buildroot] [PATCH 14/15] package/targetcli-fb: " Jérémy Rosen
2019-11-03 17:34   ` James Hilliard
2019-11-03 16:56 ` [Buildroot] [PATCH 15/15] package/tor: " Jérémy Rosen
2019-11-03 17:31   ` James Hilliard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191109214922.GQ3419@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox