[Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed

Thomas Petazzoni thomas.petazzoni at bootlin.com
Tue Aug 25 08:43:13 UTC 2020


Hello,

I'm adding Norbert Lange in Cc, since he has done quite a bit of
systemd work in Buildroot recently. Norbert, could you review the below
patch ?

Also, Norbert, I think it would be nice if you could add yourself in
the DEVELOPERS file for package/systemd/. You have been very active
recently in improving our systemd package, and it would be good to have
someone review systemd related patches.

Thanks!

Thomas

On Mon, 24 Aug 2020 17:02:46 -0700
Joseph Kogut <joseph.kogut at gmail.com> wrote:

> Systemd doesn't install tmpfiles.d/legacy.conf when sysv compatiblity
> isn't enabled. This config sets up /var/lock, which many programs such
> as uboot's fw_printenv/setenv still depend on by default.
> 
> Signed-off-by: Joseph Kogut <joseph.kogut at gmail.com>
> ---
>  package/systemd/systemd.mk | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index e356cb1add..8454993823 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -512,10 +512,18 @@ define SYSTEMD_INSTALL_MACHINEID_HOOK
>  	touch $(TARGET_DIR)/etc/machine-id
>  endef
>  
> +# systemd doesn't install legacy.conf without sysv-compat
> +# This config ensures /var/lock is created
> +define SYSTEMD_INSTALL_LEGACY_CONF_HOOK
> +	$(INSTALL) -D -m 0644 $(@D)/tmpfiles.d/legacy.conf \
> +		$(TARGET_DIR)/usr/lib/tmpfiles.d
> +endef
> +
>  SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
>  	SYSTEMD_INSTALL_INIT_HOOK \
>  	SYSTEMD_INSTALL_MACHINEID_HOOK \
> -	SYSTEMD_INSTALL_RESOLVCONF_HOOK
> +	SYSTEMD_INSTALL_RESOLVCONF_HOOK \
> +	SYSTEMD_INSTALL_LEGACY_CONF_HOOK
>  
>  define SYSTEMD_INSTALL_IMAGES_CMDS
>  	$(SYSTEMD_INSTALL_BOOT_FILES)



-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the buildroot mailing list