All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: Norbert Lange <nolange79@gmail.com>,
	Sen Hastings <sen@hastings.org>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/systemd: link host systemd utilities statically
Date: Wed, 11 Sep 2024 18:44:54 +0200	[thread overview]
Message-ID: <ZuHJBtCNOIRW68wi@landeda> (raw)
In-Reply-To: <20240910193641.1711056-1-james.hilliard1@gmail.com>

James, All,

On 2024-09-10 13:36 -0600, James Hilliard spake thusly:
> This makes it less likely that we will run into missing library
> errors when running host systemd utilities

What error exactly are you trying to fix here?
Why does it happen only now?

Stating "less likekely" implies that it is not systematic, so there are
conditions that trigger it. What conditions would tht be, so we can try
and reproduce the issue?

While "missing libraries" is atually an issue, what library are missing?
Why are they missing?

These are critical information that must be present in the commit log.

Let me guess. You are hitting the same issue as reported there:
    https://gitlab.com/buildroot.org/buildroot/-/issues/39

If so, then I think your patch is just hidding the dust under the rug.

Indeed, it is possible that other packages suffer from the same issue,
and we certainly do not want to build all such packages statically.

Instead, we want to fix the rpath fixups (he! fix the fixups!).

Regards,
Yann E. MORIN.

> and lets us remove the
> HOST_SYSTEMD_FIX_RPATH hack.

> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>  .../fakeroot_tmpfiles.sh                      |  2 +-
>  .../skeleton-init-systemd.mk                  |  2 +-
>  package/systemd/systemd.mk                    | 30 +++++++------------
>  3 files changed, 13 insertions(+), 21 deletions(-)
> 
> diff --git a/package/skeleton-init-systemd/fakeroot_tmpfiles.sh b/package/skeleton-init-systemd/fakeroot_tmpfiles.sh
> index 9498638f0b..5381750500 100755
> --- a/package/skeleton-init-systemd/fakeroot_tmpfiles.sh
> +++ b/package/skeleton-init-systemd/fakeroot_tmpfiles.sh
> @@ -25,7 +25,7 @@
>  # [1] - https://github.com/systemd/systemd/pull/16187
>  
>  [ -n "${HOST_SYSTEMD_TMPFILES-}" ] ||
> -    HOST_SYSTEMD_TMPFILES=systemd-tmpfiles
> +    HOST_SYSTEMD_TMPFILES=systemd-tmpfiles.standalone
>  
>  [ -n "${1-}" -a -d "${1-}"/usr/lib/tmpfiles.d ] ||
>      { echo 1>&2 "$0: need ROOTFS argument"; exit 1; }
> diff --git a/package/skeleton-init-systemd/skeleton-init-systemd.mk b/package/skeleton-init-systemd/skeleton-init-systemd.mk
> index b312fe33e4..cd51ce209a 100644
> --- a/package/skeleton-init-systemd/skeleton-init-systemd.mk
> +++ b/package/skeleton-init-systemd/skeleton-init-systemd.mk
> @@ -80,7 +80,7 @@ endif  # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
>  
>  ifeq ($(BR2_INIT_SYSTEMD_POPULATE_TMPFILES),y)
>  define SKELETON_INIT_SYSTEMD_CREATE_TMPFILES_HOOK
> -	HOST_SYSTEMD_TMPFILES=$(HOST_DIR)/bin/systemd-tmpfiles \
> +	HOST_SYSTEMD_TMPFILES=$(HOST_DIR)/bin/systemd-tmpfiles.standalone \
>  		$(SKELETON_INIT_SYSTEMD_PKGDIR)/fakeroot_tmpfiles.sh $(TARGET_DIR)
>  endef
>  SKELETON_INIT_SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SKELETON_INIT_SYSTEMD_CREATE_TMPFILES_HOOK
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index 5dca8681bc..9a18d91533 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -899,6 +899,17 @@ endef
>  # We need a very minimal host variant, so we disable as much as possible.
>  HOST_SYSTEMD_CONF_OPTS = \
>  	-Dsplit-bin=true \
> +	-Dlink-udev-shared=false \
> +	-Dlink-executor-shared=false \
> +	-Dlink-systemctl-shared=false \
> +	-Dlink-networkd-shared=false \
> +	-Dlink-timesyncd-shared=false \
> +	-Dlink-journalctl-shared=false \
> +	-Dlink-boot-shared=false \
> +	-Dlink-portabled-shared=false \
> +	-Dstatic-libsystemd=true \
> +	-Dstatic-libudev=true \
> +	-Dstandalone-binaries=true \
>  	--prefix=/usr \
>  	--libdir=lib \
>  	--sysconfdir=/etc \
> @@ -1022,24 +1033,5 @@ HOST_SYSTEMD_DEPENDENCIES = \
>  
>  HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
>  
> -# 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 rpath is thus lost.
> -# * the original path had been tweaked by buildroot via LDFLAGS to add
> -#   $(HOST_DIR)/lib
> -# * thus re-tweak rpath after the installation for all binaries that need it
> -HOST_SYSTEMD_HOST_TOOLS = busctl journalctl systemctl systemd-* udevadm
> -
> -define HOST_SYSTEMD_FIX_RPATH
> -	for f in $(addprefix $(HOST_DIR)/bin/,$(HOST_SYSTEMD_HOST_TOOLS)); do \
> -		[ -e $$f ] || continue; \
> -		$(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $${f} \
> -		|| exit 1; \
> -	done
> -endef
> -HOST_SYSTEMD_POST_INSTALL_HOOKS += HOST_SYSTEMD_FIX_RPATH
> -
>  $(eval $(meson-package))
>  $(eval $(host-meson-package))
> -- 
> 2.34.1
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-09-11 16:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10 19:36 [Buildroot] [PATCH 1/1] package/systemd: link host systemd utilities statically James Hilliard
2024-09-11 16:44 ` Yann E. MORIN [this message]
2024-09-11 17:07   ` James Hilliard
2024-09-11 19:14     ` Yann E. MORIN

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=ZuHJBtCNOIRW68wi@landeda \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=james.hilliard1@gmail.com \
    --cc=nolange79@gmail.com \
    --cc=sen@hastings.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.