All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed
@ 2020-08-25  0:02 Joseph Kogut
  2020-08-25  8:43 ` Thomas Petazzoni
  2022-01-08 19:12 ` Arnout Vandecappelle
  0 siblings, 2 replies; 9+ messages in thread
From: Joseph Kogut @ 2020-08-25  0:02 UTC (permalink / raw)
  To: buildroot

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@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)
-- 
2.28.0

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

* [Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed
  2020-08-25  0:02 [Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed Joseph Kogut
@ 2020-08-25  8:43 ` Thomas Petazzoni
  2020-08-25 12:58   ` Norbert Lange
  2022-01-08 19:12 ` Arnout Vandecappelle
  1 sibling, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2020-08-25  8:43 UTC (permalink / raw)
  To: buildroot

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

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

* [Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed
  2020-08-25  8:43 ` Thomas Petazzoni
@ 2020-08-25 12:58   ` Norbert Lange
  2020-08-26  1:50     ` Joseph Kogut
  0 siblings, 1 reply; 9+ messages in thread
From: Norbert Lange @ 2020-08-25 12:58 UTC (permalink / raw)
  To: buildroot

Am Di., 25. Aug. 2020 um 10:43 Uhr schrieb Thomas Petazzoni
<thomas.petazzoni@bootlin.com>:
>
> 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@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@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

Not sure what I should add here, technically the patch is fine.

- Should BR support /var/lock?
Then probably adding you own buildroot.conf to one of the skeletons
would be better (handle /var/lock and /var/run at a central spot)

If not, then patching out its uses should be the long-term goal. I am
not sure I agree with Joseph that many packages use /var/lock,
even less so if you use a systemd rootfs (only know of a few busybox
and if-updown services that do).

Being the guy that spent time removing all those legacy files I am
prolly biased then it comes to the right answer;

Norbert

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

* [Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed
  2020-08-25 12:58   ` Norbert Lange
@ 2020-08-26  1:50     ` Joseph Kogut
  2020-08-26  8:17       ` Norbert Lange
  0 siblings, 1 reply; 9+ messages in thread
From: Joseph Kogut @ 2020-08-26  1:50 UTC (permalink / raw)
  To: buildroot

Hi Norbert,

On Tue, Aug 25, 2020 at 5:58 AM Norbert Lange <nolange79@gmail.com> wrote:
>
> Am Di., 25. Aug. 2020 um 10:43 Uhr schrieb Thomas Petazzoni
> <thomas.petazzoni@bootlin.com>:
> >
> > 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@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@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
>
> Not sure what I should add here, technically the patch is fine.
>
> - Should BR support /var/lock?
> Then probably adding you own buildroot.conf to one of the skeletons
> would be better (handle /var/lock and /var/run at a central spot)
>

I'm unfamiliar with any technical discussion around this. The Linux
documentation [1] itself specifies that lock files should be stored at
/var/lock. It seems odd to me that this path would be expected not to
exist at all. Do you have any insight? I might add, this same approach
was adopted by Arch Linux [2] some time ago.

> If not, then patching out its uses should be the long-term goal. I am
> not sure I agree with Joseph that many packages use /var/lock,
> even less so if you use a systemd rootfs (only know of a few busybox
> and if-updown services that do).
>

Admittedly, I'm not sure how many packages actually still use
/var/lock. One would need to download and extract every package
supported by buildroot to have an accurate picture. In my build
directory, I grepped for it and found references in alsa-utils,
busybox, linux-pam, and uboot-tools, the last of which this patch
attempted to fix.

Would it be preferable to patch uboot-tools to default to /run/lock? What
are the technical reasons for this? It seems equivalent to me to
symlink /var/lock -> ../run/lock, and prevents applications which
haven't yet been updated to use the new path from breaking
inexplicably.

> Being the guy that spent time removing all those legacy files I am
> prolly biased then it comes to the right answer;
>
> Norbert

[1] https://www.kernel.org/doc/Documentation/admin-guide/devices.rst
[2] https://github.com/archlinux/svntogit-packages/blob/febacd7859ba2556df1122c89fcdc7383676514f/trunk/PKGBUILD#L195

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

* [Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed
  2020-08-26  1:50     ` Joseph Kogut
@ 2020-08-26  8:17       ` Norbert Lange
  0 siblings, 0 replies; 9+ messages in thread
From: Norbert Lange @ 2020-08-26  8:17 UTC (permalink / raw)
  To: buildroot

Am Mi., 26. Aug. 2020 um 03:51 Uhr schrieb Joseph Kogut
<joseph.kogut@gmail.com>:
>
> Hi Norbert,
>
> On Tue, Aug 25, 2020 at 5:58 AM Norbert Lange <nolange79@gmail.com> wrote:
> >
> > Am Di., 25. Aug. 2020 um 10:43 Uhr schrieb Thomas Petazzoni
> > <thomas.petazzoni@bootlin.com>:
> > >
> > > 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@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@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
> >
> > Not sure what I should add here, technically the patch is fine.
> >
> > - Should BR support /var/lock?
> > Then probably adding you own buildroot.conf to one of the skeletons
> > would be better (handle /var/lock and /var/run at a central spot)
> >
>
> I'm unfamiliar with any technical discussion around this. The Linux
> documentation [1] itself specifies that lock files should be stored at
> /var/lock. It seems odd to me that this path would be expected not to
> exist at all. Do you have any insight? I might add, this same approach
> was adopted by Arch Linux [2] some time ago.

/run holds the runtime state, /var is a bad fit for locks, indicated
by /var/lock
already being a symlink. Most distros use /run/lock as backing storage,
aswell as systemd and openrc, see for ex.  [1].

Nowadays you should use flock, those uucp locks for serial ports are a
thing long past, it is weird that it's still in the Linux docs.
For ex I dont know of any Linux related tools (util-linux, etc.) using
lockfiles.

Note that the legacy.conf also creates the /var/run -> /run symlink,
which is actually still often needed (even if it should go away aswell),
and that Arch is a more "general" distro.

Said /var/run symlink comes from buildroot skeleton, and I would
put /var/lock there too (solve it for all init systems).
systemd-tmpfiles further can be disabled in
buildroot, I dont think thats a good idea and should be mandatory,
but some action is necessary.

>
> > If not, then patching out its uses should be the long-term goal. I am
> > not sure I agree with Joseph that many packages use /var/lock,
> > even less so if you use a systemd rootfs (only know of a few busybox
> > and if-updown services that do).
> >
>
> Admittedly, I'm not sure how many packages actually still use
> /var/lock. One would need to download and extract every package
> supported by buildroot to have an accurate picture. In my build
> directory, I grepped for it and found references in alsa-utils,
> busybox, linux-pam, and uboot-tools, the last of which this patch
> attempted to fix.
>
> Would it be preferable to patch uboot-tools to default to /run/lock? What
> are the technical reasons for this? It seems equivalent to me to
> symlink /var/lock -> ../run/lock, and prevents applications which
> haven't yet been updated to use the new path from breaking
> inexplicably.

Yeah, it's a legacy workaround in other words. Question is, if everyone
should be blessed with that workaround. BR also adds systemd service files
instead of using upstream init scripts.
There are distros which have separate /run/lock and /var/lock directories,
(thanks to FHS allowing this), so those apps don't really lock systemwide there.

And for a technical reason, you are needlessly depending on the blockdevice
that's continuously written to.

Norbert

>
> > Being the guy that spent time removing all those legacy files I am
> > prolly biased then it comes to the right answer;
> >
> > Norbert
>
> [1] https://www.kernel.org/doc/Documentation/admin-guide/devices.rst
> [2] https://github.com/archlinux/svntogit-packages/blob/febacd7859ba2556df1122c89fcdc7383676514f/trunk/PKGBUILD#L195

[1] - https://wiki.debian.org/ReleaseGoals/RunDirectory

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

* Re: [Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed
  2020-08-25  0:02 [Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed Joseph Kogut
  2020-08-25  8:43 ` Thomas Petazzoni
@ 2022-01-08 19:12 ` Arnout Vandecappelle
  2022-01-08 20:40   ` Arnout Vandecappelle
  1 sibling, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2022-01-08 19:12 UTC (permalink / raw)
  To: Joseph Kogut, buildroot
  Cc: Norbert Lange, Yann E . MORIN, Adam Duskett, Maxime Hadjinlian



On 25/08/2020 02:02, Joseph Kogut 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@gmail.com>

  After all the discussion, I did finally apply to master, thanks.

  For Norbert: we simply have legacy packages that write to /var/lock instead of 
/run/lock. In an ideal world, we'd patch all of them to do the right thing. 
However, that's not realistic. So let's enable this legacy stuff to make sure 
that those legacy packages don't actually write to disk.

  We could indeed instead enable sysv compatibility, for maximum support of 
legacy packages. What exactly would be the effects of that?

  Regards,
  Arnout


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

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

* Re: [Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed
  2022-01-08 19:12 ` Arnout Vandecappelle
@ 2022-01-08 20:40   ` Arnout Vandecappelle
  2022-01-08 21:17     ` Norbert Lange
  0 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2022-01-08 20:40 UTC (permalink / raw)
  To: Joseph Kogut, buildroot
  Cc: Norbert Lange, Yann E . MORIN, Adam Duskett, Maxime Hadjinlian


On 08/01/2022 20:12, Arnout Vandecappelle wrote:
>
>
> On 25/08/2020 02:02, Joseph Kogut 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@gmail.com>
>
>  After all the discussion, I did finally apply to master, thanks.

  And I ended up reverting it again - legacy.conf is now legacy.conf.in and it 
needs to be preprocessed, but that is only done if sysv-compat is enabled.

  So if we want this, our only option is to enable sysv-compat (which is 
probably something we should do anyway).


  Regards,
  Arnout


>
>  For Norbert: we simply have legacy packages that write to /var/lock instead 
> of /run/lock. In an ideal world, we'd patch all of them to do the right thing. 
> However, that's not realistic. So let's enable this legacy stuff to make sure 
> that those legacy packages don't actually write to disk.
>
>  We could indeed instead enable sysv compatibility, for maximum support of 
> legacy packages. What exactly would be the effects of that?
>
>  Regards,
>  Arnout
>
>
>> ---
>>   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)
>>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed
  2022-01-08 20:40   ` Arnout Vandecappelle
@ 2022-01-08 21:17     ` Norbert Lange
  2022-01-08 22:28       ` Arnout Vandecappelle
  0 siblings, 1 reply; 9+ messages in thread
From: Norbert Lange @ 2022-01-08 21:17 UTC (permalink / raw)
  To: Arnout Vandecappelle
  Cc: Joseph Kogut, Maxime Hadjinlian, Yann E . MORIN, Adam Duskett, buildroot

Am Sa., 8. Jan. 2022 um 21:40 Uhr schrieb Arnout Vandecappelle <arnout@mind.be>:
>
>
> On 08/01/2022 20:12, Arnout Vandecappelle wrote:
> >
> >
> > On 25/08/2020 02:02, Joseph Kogut 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@gmail.com>
> >
> >  After all the discussion, I did finally apply to master, thanks.
>
>   And I ended up reverting it again - legacy.conf is now legacy.conf.in and it
> needs to be preprocessed, but that is only done if sysv-compat is enabled.
>
>   So if we want this, our only option is to enable sysv-compat (which is
> probably something we should do anyway).

Why the only option? you should just ship your own legacy.conf, it wont change.
Adding sysv compatibility, which is alot more than just the mkdir and
symlink, would mean adding alot baggage.
Baggage that wont even work as Yann spake thusly [1]

a tmpfile.conf with those 3 lines would be enough:
d /run/lock 0755 root root -
L /var/lock - - - - ../run/lock
d /run/lock/subsys 0755 root root -

Norbert.

PS. I am too lazy to google everything up, but I believe I brought up
this very topic before.

[1] - https://lists.buildroot.org/pipermail/buildroot/2020-July/287275.html
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed
  2022-01-08 21:17     ` Norbert Lange
@ 2022-01-08 22:28       ` Arnout Vandecappelle
  0 siblings, 0 replies; 9+ messages in thread
From: Arnout Vandecappelle @ 2022-01-08 22:28 UTC (permalink / raw)
  To: Norbert Lange
  Cc: Joseph Kogut, Maxime Hadjinlian, Yann E . MORIN, Adam Duskett, buildroot



On 08/01/2022 22:17, Norbert Lange wrote:
> Am Sa., 8. Jan. 2022 um 21:40 Uhr schrieb Arnout Vandecappelle <arnout@mind.be>:
>>
>>
>> On 08/01/2022 20:12, Arnout Vandecappelle wrote:
>>>
>>>
>>> On 25/08/2020 02:02, Joseph Kogut 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@gmail.com>
>>>
>>>   After all the discussion, I did finally apply to master, thanks.
>>
>>    And I ended up reverting it again - legacy.conf is now legacy.conf.in and it
>> needs to be preprocessed, but that is only done if sysv-compat is enabled.
>>
>>    So if we want this, our only option is to enable sysv-compat (which is
>> probably something we should do anyway).
> 
> Why the only option? you should just ship your own legacy.conf, it wont change.

  I meant: if we want to use the legacy.conf from upstream. But you're right 
it's not the only option, we could also manually sed out stuff from the .in file.


> Adding sysv compatibility, which is alot more than just the mkdir and
> symlink, would mean adding alot baggage.

  Ack.

> Baggage that wont even work as Yann spake thusly [1]
> 
> a tmpfile.conf with those 3 lines would be enough:
> d /run/lock 0755 root root -
> L /var/lock - - - - ../run/lock
> d /run/lock/subsys 0755 root root -

  All right, I hope I remember this by the time a see the patch :-)

> 
> Norbert.
> 
> PS. I am too lazy to google everything up, but I believe I brought up
> this very topic before.

  I'm also too lazy to google it.

  Regards,
  Arnout

> 
> [1] - https://lists.buildroot.org/pipermail/buildroot/2020-July/287275.html
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-01-08 22:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25  0:02 [Buildroot] [PATCH 1/1] systemd: ensure tmpfiles.d/legacy.conf is installed Joseph Kogut
2020-08-25  8:43 ` Thomas Petazzoni
2020-08-25 12:58   ` Norbert Lange
2020-08-26  1:50     ` Joseph Kogut
2020-08-26  8:17       ` Norbert Lange
2022-01-08 19:12 ` Arnout Vandecappelle
2022-01-08 20:40   ` Arnout Vandecappelle
2022-01-08 21:17     ` Norbert Lange
2022-01-08 22:28       ` Arnout Vandecappelle

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.