mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] systemd: add setting to enable ldconfig service
@ 2016-05-19 17:05 Clemens Gruber
  2016-05-26  9:53 ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Clemens Gruber @ 2016-05-19 17:05 UTC (permalink / raw)
  To: ptxdist; +Cc: Clemens Gruber

Add a ptxdist setting to enable the systemd ldconfig.service, which
calls /sbin/ldconfig -X if /etc/ld.so.cache does not exist and the
machine boots or was updated.
Having a /etc/ld.so.cache file reduces the number of necessary syscalls
dramatically. This is especially noticeable when often calling small
binaries like /bin/true.
See: LD_DEBUG=libs /bin/true or strace /bin/true

Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
---
 rules/systemd.in   | 7 +++++++
 rules/systemd.make | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/rules/systemd.in b/rules/systemd.in
index 876a890..fba72bc 100644
--- a/rules/systemd.in
+++ b/rules/systemd.in
@@ -73,6 +73,13 @@ config SYSTEMD_DISABLE_RANDOM_SEED
 	  the random seed is not possible.
 	  Warning: enabling this option may be insecure.
 
+config SYSTEMD_LDCONFIG
+	bool
+	prompt "enable ldconfig to initialize /etc/ld.so.cache"
+	help
+	  Enables ldconfig.service, which calls ldconfig at first boot and after
+	  systemd-update-done if /etc/ld.so.cache does not exist.
+
 config SYSTEMD_LOGIND
 	bool
 	select SYSTEMD_DBUS
diff --git a/rules/systemd.make b/rules/systemd.make
index 71c633a..776942d 100644
--- a/rules/systemd.make
+++ b/rules/systemd.make
@@ -121,7 +121,7 @@ SYSTEMD_CONF_OPT	:= \
 	--$(call ptx/endis,PTXCONF_UDEV_HWDB)-hwdb \
 	--disable-manpages \
 	--disable-hibernate \
-	--disable-ldconfig \
+	--$(call ptx/endis,PTXCONF_SYSTEMD_LDCONFIG)-ldconfig \
 	--enable-split-usr \
 	--disable-tests \
 	--disable-debug \
-- 
2.8.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] systemd: add setting to enable ldconfig service
  2016-05-19 17:05 [ptxdist] [PATCH] systemd: add setting to enable ldconfig service Clemens Gruber
@ 2016-05-26  9:53 ` Michael Olbrich
  2016-05-26 13:41   ` Clemens Gruber
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2016-05-26  9:53 UTC (permalink / raw)
  To: ptxdist

On Thu, May 19, 2016 at 07:05:51PM +0200, Clemens Gruber wrote:
> Add a ptxdist setting to enable the systemd ldconfig.service, which
> calls /sbin/ldconfig -X if /etc/ld.so.cache does not exist and the
> machine boots or was updated.
> Having a /etc/ld.so.cache file reduces the number of necessary syscalls
> dramatically. This is especially noticeable when often calling small
> binaries like /bin/true.
> See: LD_DEBUG=libs /bin/true or strace /bin/true

Not like this. This should be handled in rc-once where the rootfs is
actually writeable. Also, as far as I know, there is currently no option to
install ldconfig. You should probably with a patch for this.

Michael

> Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
> ---
>  rules/systemd.in   | 7 +++++++
>  rules/systemd.make | 2 +-
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/rules/systemd.in b/rules/systemd.in
> index 876a890..fba72bc 100644
> --- a/rules/systemd.in
> +++ b/rules/systemd.in
> @@ -73,6 +73,13 @@ config SYSTEMD_DISABLE_RANDOM_SEED
>  	  the random seed is not possible.
>  	  Warning: enabling this option may be insecure.
>  
> +config SYSTEMD_LDCONFIG
> +	bool
> +	prompt "enable ldconfig to initialize /etc/ld.so.cache"
> +	help
> +	  Enables ldconfig.service, which calls ldconfig at first boot and after
> +	  systemd-update-done if /etc/ld.so.cache does not exist.
> +
>  config SYSTEMD_LOGIND
>  	bool
>  	select SYSTEMD_DBUS
> diff --git a/rules/systemd.make b/rules/systemd.make
> index 71c633a..776942d 100644
> --- a/rules/systemd.make
> +++ b/rules/systemd.make
> @@ -121,7 +121,7 @@ SYSTEMD_CONF_OPT	:= \
>  	--$(call ptx/endis,PTXCONF_UDEV_HWDB)-hwdb \
>  	--disable-manpages \
>  	--disable-hibernate \
> -	--disable-ldconfig \
> +	--$(call ptx/endis,PTXCONF_SYSTEMD_LDCONFIG)-ldconfig \
>  	--enable-split-usr \
>  	--disable-tests \
>  	--disable-debug \
> -- 
> 2.8.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] systemd: add setting to enable ldconfig service
  2016-05-26  9:53 ` Michael Olbrich
@ 2016-05-26 13:41   ` Clemens Gruber
  2016-05-26 14:11     ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Clemens Gruber @ 2016-05-26 13:41 UTC (permalink / raw)
  To: ptxdist

Hi Michael,

On Thu, May 26, 2016 at 11:53:30AM +0200, Michael Olbrich wrote:
> Not like this. This should be handled in rc-once where the rootfs is
> actually writeable. Also, as far as I know, there is currently no option to
> install ldconfig. You should probably with a patch for this.

Hm, you mean you don't want to use the ldconfig.service from systemd,
keep the --disable-ldconfig option and call ldconfig -X manually from a
rc-once.d script, for it to work with read-only rootfs usecases?

Regarding the ldconfig binary. You are right, totally forgot that I have
a custom rule for that. I'll send a patch for that too with v2 of this
patch.
Btw. where should I put the ptxdist setting for the ldconfig binary?
Is shell_and_console the right place, even though it is copied from the
toolchain directory?

Thanks,
Clemens

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] systemd: add setting to enable ldconfig service
  2016-05-26 13:41   ` Clemens Gruber
@ 2016-05-26 14:11     ` Michael Olbrich
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2016-05-26 14:11 UTC (permalink / raw)
  To: ptxdist

Hi,

On Thu, May 26, 2016 at 03:41:54PM +0200, Clemens Gruber wrote:
> On Thu, May 26, 2016 at 11:53:30AM +0200, Michael Olbrich wrote:
> > Not like this. This should be handled in rc-once where the rootfs is
> > actually writeable. Also, as far as I know, there is currently no option to
> > install ldconfig. You should probably with a patch for this.
> 
> Hm, you mean you don't want to use the ldconfig.service from systemd,
> keep the --disable-ldconfig option and call ldconfig -X manually from a
> rc-once.d script, for it to work with read-only rootfs usecases?

Exactly.

> Regarding the ldconfig binary. You are right, totally forgot that I have
> a custom rule for that. I'll send a patch for that too with v2 of this
> patch.
> Btw. where should I put the ptxdist setting for the ldconfig binary?
> Is shell_and_console the right place, even though it is copied from the
> toolchain directory?

Add it to glibc please, before locale and localedef. And use the same
kconfig symbol to install the rc-once script as well, unless you have
use-case to keep it separate.

Regards,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-26 14:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-19 17:05 [ptxdist] [PATCH] systemd: add setting to enable ldconfig service Clemens Gruber
2016-05-26  9:53 ` Michael Olbrich
2016-05-26 13:41   ` Clemens Gruber
2016-05-26 14:11     ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox