All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] system/skeleton: provide run/lock directory
@ 2022-01-12 10:10 Norbert Lange
  2022-01-12 10:19 ` Norbert Lange
  0 siblings, 1 reply; 6+ messages in thread
From: Norbert Lange @ 2022-01-12 10:10 UTC (permalink / raw)
  To: buildroot; +Cc: Norbert Lange, thomas.petazzoni

We changed the skeletons in bf01e51f3c, so that var/lock
points to run/lock. This resulted in build failures as
some packages want to work with these paths.

-   Create run/lock, the run directory will be purged
    later anyway (since 5e78e7e97d).
-   for init == systemd, create the var/lock symlink early
    to prevent packages creating this path as directory.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
---
 package/skeleton-init-systemd/skeleton-init-systemd.mk | 2 ++
 system/skeleton/run/{ => lock}/.empty                  | 0
 2 files changed, 2 insertions(+)
 rename system/skeleton/run/{ => lock}/.empty (100%)

diff --git a/package/skeleton-init-systemd/skeleton-init-systemd.mk b/package/skeleton-init-systemd/skeleton-init-systemd.mk
index 1e212cc2f7..795a171809 100644
--- a/package/skeleton-init-systemd/skeleton-init-systemd.mk
+++ b/package/skeleton-init-systemd/skeleton-init-systemd.mk
@@ -62,6 +62,8 @@ define SKELETON_INIT_SYSTEMD_INSTALL_TARGET_CMDS
 	mkdir -p $(TARGET_DIR)/srv
 	mkdir -p $(TARGET_DIR)/var
 	ln -s ../run $(TARGET_DIR)/var/run
+	# prevent install scripts to create var/lock as directory
+	ln -s ../run/lock $(TARGET_DIR)/var/lock
 	install -D -m644 $(SKELETON_INIT_SYSTEMD_PKGDIR)/legacy.conf $(TARGET_DIR)/usr/lib/tmpfiles.d/legacy.conf
 	$(SKELETON_INIT_SYSTEMD_ROOT_RO_OR_RW)
 endef
diff --git a/system/skeleton/run/.empty b/system/skeleton/run/lock/.empty
similarity index 100%
rename from system/skeleton/run/.empty
rename to system/skeleton/run/lock/.empty
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] system/skeleton: provide run/lock directory
  2022-01-12 10:10 [Buildroot] [PATCH] system/skeleton: provide run/lock directory Norbert Lange
@ 2022-01-12 10:19 ` Norbert Lange
  2022-01-12 19:39   ` Arnout Vandecappelle
  0 siblings, 1 reply; 6+ messages in thread
From: Norbert Lange @ 2022-01-12 10:19 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Petazzoni

Am Mi., 12. Jan. 2022 um 11:10 Uhr schrieb Norbert Lange <nolange79@gmail.com>:
>
> We changed the skeletons in bf01e51f3c, so that var/lock
> points to run/lock. This resulted in build failures as
> some packages want to work with these paths.
>
> -   Create run/lock, the run directory will be purged
>     later anyway (since 5e78e7e97d).
> -   for init == systemd, create the var/lock symlink early
>     to prevent packages creating this path as directory.
>
> Signed-off-by: Norbert Lange <nolange79@gmail.com>
> ---
>  package/skeleton-init-systemd/skeleton-init-systemd.mk | 2 ++
>  system/skeleton/run/{ => lock}/.empty                  | 0
>  2 files changed, 2 insertions(+)
>  rename system/skeleton/run/{ => lock}/.empty (100%)
>
> diff --git a/package/skeleton-init-systemd/skeleton-init-systemd.mk b/package/skeleton-init-systemd/skeleton-init-systemd.mk
> index 1e212cc2f7..795a171809 100644
> --- a/package/skeleton-init-systemd/skeleton-init-systemd.mk
> +++ b/package/skeleton-init-systemd/skeleton-init-systemd.mk
> @@ -62,6 +62,8 @@ define SKELETON_INIT_SYSTEMD_INSTALL_TARGET_CMDS
>         mkdir -p $(TARGET_DIR)/srv
>         mkdir -p $(TARGET_DIR)/var
>         ln -s ../run $(TARGET_DIR)/var/run
> +       # prevent install scripts to create var/lock as directory
> +       ln -s ../run/lock $(TARGET_DIR)/var/lock
>         install -D -m644 $(SKELETON_INIT_SYSTEMD_PKGDIR)/legacy.conf $(TARGET_DIR)/usr/lib/tmpfiles.d/legacy.conf
>         $(SKELETON_INIT_SYSTEMD_ROOT_RO_OR_RW)
>  endef
> diff --git a/system/skeleton/run/.empty b/system/skeleton/run/lock/.empty
> similarity index 100%
> rename from system/skeleton/run/.empty
> rename to system/skeleton/run/lock/.empty
> --
> 2.34.1
>

Fixes: http://autobuild.buildroot.net/results/3ee/3ee8f9ee55e51af38e9dbe7b9840c9589d88a30f
(and alot more containing the vtun package)

For someone not fluent with mailing list workflows, and working with a
couple projects,
it might help having a few example commit messages (-templates) in the docs.
ie for respins, bug fixes, versioning (potentially of series)

Norbert
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] system/skeleton: provide run/lock directory
  2022-01-12 10:19 ` Norbert Lange
@ 2022-01-12 19:39   ` Arnout Vandecappelle
  0 siblings, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2022-01-12 19:39 UTC (permalink / raw)
  To: Norbert Lange, buildroot; +Cc: Thomas Petazzoni



On 12/01/2022 11:19, Norbert Lange wrote:
> Am Mi., 12. Jan. 2022 um 11:10 Uhr schrieb Norbert Lange <nolange79@gmail.com>:
>>
>> We changed the skeletons in bf01e51f3c, so that var/lock
>> points to run/lock. This resulted in build failures as
>> some packages want to work with these paths.
>>
>> -   Create run/lock, the run directory will be purged
>>      later anyway (since 5e78e7e97d).
>> -   for init == systemd, create the var/lock symlink early
>>      to prevent packages creating this path as directory.
>>
>> Signed-off-by: Norbert Lange <nolange79@gmail.com>
>> ---
>>   package/skeleton-init-systemd/skeleton-init-systemd.mk | 2 ++
>>   system/skeleton/run/{ => lock}/.empty                  | 0
>>   2 files changed, 2 insertions(+)
>>   rename system/skeleton/run/{ => lock}/.empty (100%)
>>
>> diff --git a/package/skeleton-init-systemd/skeleton-init-systemd.mk b/package/skeleton-init-systemd/skeleton-init-systemd.mk
>> index 1e212cc2f7..795a171809 100644
>> --- a/package/skeleton-init-systemd/skeleton-init-systemd.mk
>> +++ b/package/skeleton-init-systemd/skeleton-init-systemd.mk
>> @@ -62,6 +62,8 @@ define SKELETON_INIT_SYSTEMD_INSTALL_TARGET_CMDS
>>          mkdir -p $(TARGET_DIR)/srv
>>          mkdir -p $(TARGET_DIR)/var
>>          ln -s ../run $(TARGET_DIR)/var/run
>> +       # prevent install scripts to create var/lock as directory
>> +       ln -s ../run/lock $(TARGET_DIR)/var/lock
>>          install -D -m644 $(SKELETON_INIT_SYSTEMD_PKGDIR)/legacy.conf $(TARGET_DIR)/usr/lib/tmpfiles.d/legacy.conf
>>          $(SKELETON_INIT_SYSTEMD_ROOT_RO_OR_RW)
>>   endef
>> diff --git a/system/skeleton/run/.empty b/system/skeleton/run/lock/.empty
>> similarity index 100%
>> rename from system/skeleton/run/.empty
>> rename to system/skeleton/run/lock/.empty
>> --
>> 2.34.1
>>
> 
> Fixes: http://autobuild.buildroot.net/results/3ee/3ee8f9ee55e51af38e9dbe7b9840c9589d88a30f

  Applied to master with that added, thanks.

> (and alot more containing the vtun package)
> 
> For someone not fluent with mailing list workflows, and working with a
> couple projects,
> it might help having a few example commit messages (-templates) in the docs.
> ie for respins, bug fixes, versioning (potentially of series)

  Absolutely! I'm waiting for a really nice example to turn up on the list and 
steal that for the documentation.

  Regards,
  Arnout

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] system/skeleton: provide run/lock directory
  2022-04-18 20:47 ` Norbert Lange
@ 2022-04-19 15:33   ` Tim Hammer
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Hammer @ 2022-04-19 15:33 UTC (permalink / raw)
  To: Norbert Lange; +Cc: thomas.petazzoni, buildroot

On Mon, Apr 18, 2022 at 10:47:46PM +0200, Norbert Lange wrote:
> Am Montag, 18. April 2022 schrieb Tim Hammer <Tim.Hammer@orolia.com>:
>
> > On Wed, Jan 12, 2022 at 11:10:20AM +0100, Norbert Lange wrote:
> > > We changed the skeletons in bf01e51f3c, so that var/lock
> > > points to run/lock. This resulted in build failures as
> > > some packages want to work with these paths.
> > >
> > > -   Create run/lock, the run directory will be purged
> > >     later anyway (since 5e78e7e97d).
> >
> > Yes, run/lock is removed later (see
> > https://lore.kernel.org/buildroot/20200605224858.
> > 12870-2-nolange79@gmail.com/
> > and
> > https://lore.kernel.org/buildroot/20220319190531.
> > 975B183CB8@busybox.osuosl.org/).
> >
> > However, the soft link in var/ is not. It ends up in the rootfs for the
> > target
> > and can cause problems later.
> >
> > Is there a reason the link created by skeleton was not cleaned up?
> >
> >
> Yeah, it's supposed to be there in the final roots.
> The run/lock directory is just *in the skeleton* so you don't have a broken
> symlink *during building with buildroot*.
>
> > I will be honest, I do not understand the full process and why the items
> > created by
> > the skeleton package are not just left in place...
>
>
> The running system will mount a tmpfs onto /run (and most likely /tmp) and
> will create /run/lock anew each bootup
>

Ah, now it makes sense.
Our bootstrap environment is not running the "normal"
startup so the lock directory needs to be created by us!

Thank you very much for the help!
.Tim
Tim D. Hammer
tim.hammer@orolia.com

> Means all content on you image is
>
> - irrelevant
> - prone to leaking info from the system where you built the rootfs.
>
> Norbert
>
>
> > .Tim
> > Tim D. Hammer
> > tim.hammer@orolia.com
> >
> >
> > > -   for init == systemd, create the var/lock symlink early
> > >     to prevent packages creating this path as directory.
> > >
> > > Signed-off-by: Norbert Lange <nolange79@gmail.com>
> > > ---
> > >  package/skeleton-init-systemd/skeleton-init-systemd.mk | 2 ++
> > >  system/skeleton/run/{ => lock}/.empty                  | 0
> > >  2 files changed, 2 insertions(+)
> > >  rename system/skeleton/run/{ => lock}/.empty (100%)
> > >
> > > diff --git a/package/skeleton-init-systemd/skeleton-init-systemd.mk
> > b/package/skeleton-init-systemd/skeleton-init-sys>> index
> > 1e212cc2f7..795a171809 100644
> > > --- a/package/skeleton-init-systemd/skeleton-init-systemd.mk
> > > +++ b/package/skeleton-init-systemd/skeleton-init-systemd.mk
> > > @@ -62,6 +62,8 @@ define SKELETON_INIT_SYSTEMD_INSTALL_TARGET_CMDS
> > >       mkdir -p $(TARGET_DIR)/srv
> > >       mkdir -p $(TARGET_DIR)/var
> > >       ln -s ../run $(TARGET_DIR)/var/run
> > > +     # prevent install scripts to create var/lock as directory
> > > +     ln -s ../run/lock $(TARGET_DIR)/var/lock
> > >       install -D -m644 $(SKELETON_INIT_SYSTEMD_PKGDIR)/legacy.conf
> > $(TARGET_DIR)/usr/lib/tmpfiles.d/legacy.conf
> > >       $(SKELETON_INIT_SYSTEMD_ROOT_RO_OR_RW)
> > >  endef
> > > diff --git a/system/skeleton/run/.empty b/system/skeleton/run/lock/.
> > empty
> > > similarity index 100%
> > > rename from system/skeleton/run/.empty
> > > rename to system/skeleton/run/lock/.empty
> > > --
> > > 2.34.1
> > >
> > > _______________________________________________
> > > buildroot mailing list
> > > buildroot@buildroot.org
> > > https://lists.buildroot.org/mailman/listinfo/buildroot
> >
> >

> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] system/skeleton: provide run/lock directory
  2022-04-18 18:18 Tim Hammer
@ 2022-04-18 20:47 ` Norbert Lange
  2022-04-19 15:33   ` Tim Hammer
  0 siblings, 1 reply; 6+ messages in thread
From: Norbert Lange @ 2022-04-18 20:47 UTC (permalink / raw)
  To: Tim Hammer; +Cc: thomas.petazzoni, buildroot


[-- Attachment #1.1: Type: text/plain, Size: 3011 bytes --]

Am Montag, 18. April 2022 schrieb Tim Hammer <Tim.Hammer@orolia.com>:

> On Wed, Jan 12, 2022 at 11:10:20AM +0100, Norbert Lange wrote:
> > We changed the skeletons in bf01e51f3c, so that var/lock
> > points to run/lock. This resulted in build failures as
> > some packages want to work with these paths.
> >
> > -   Create run/lock, the run directory will be purged
> >     later anyway (since 5e78e7e97d).
>
> Yes, run/lock is removed later (see
> https://lore.kernel.org/buildroot/20200605224858.
> 12870-2-nolange79@gmail.com/
> and
> https://lore.kernel.org/buildroot/20220319190531.
> 975B183CB8@busybox.osuosl.org/).
>
> However, the soft link in var/ is not. It ends up in the rootfs for the
> target
> and can cause problems later.
>
> Is there a reason the link created by skeleton was not cleaned up?
>
>
Yeah, it's supposed to be there in the final roots.
The run/lock directory is just *in the skeleton* so you don't have a broken
symlink *during building with buildroot*.

I will be honest, I do not understand the full process and why the items
> created by
> the skeleton package are not just left in place...


The running system will mount a tmpfs onto /run (and most likely /tmp) and
will create /run/lock anew each bootup

Means all content on you image is

- irrelevant
- prone to leaking info from the system where you built the rootfs.

Norbert


> .Tim
> Tim D. Hammer
> tim.hammer@orolia.com
>
>
> > -   for init == systemd, create the var/lock symlink early
> >     to prevent packages creating this path as directory.
> >
> > Signed-off-by: Norbert Lange <nolange79@gmail.com>
> > ---
> >  package/skeleton-init-systemd/skeleton-init-systemd.mk | 2 ++
> >  system/skeleton/run/{ => lock}/.empty                  | 0
> >  2 files changed, 2 insertions(+)
> >  rename system/skeleton/run/{ => lock}/.empty (100%)
> >
> > diff --git a/package/skeleton-init-systemd/skeleton-init-systemd.mk
> b/package/skeleton-init-systemd/skeleton-init-sys>> index
> 1e212cc2f7..795a171809 100644
> > --- a/package/skeleton-init-systemd/skeleton-init-systemd.mk
> > +++ b/package/skeleton-init-systemd/skeleton-init-systemd.mk
> > @@ -62,6 +62,8 @@ define SKELETON_INIT_SYSTEMD_INSTALL_TARGET_CMDS
> >       mkdir -p $(TARGET_DIR)/srv
> >       mkdir -p $(TARGET_DIR)/var
> >       ln -s ../run $(TARGET_DIR)/var/run
> > +     # prevent install scripts to create var/lock as directory
> > +     ln -s ../run/lock $(TARGET_DIR)/var/lock
> >       install -D -m644 $(SKELETON_INIT_SYSTEMD_PKGDIR)/legacy.conf
> $(TARGET_DIR)/usr/lib/tmpfiles.d/legacy.conf
> >       $(SKELETON_INIT_SYSTEMD_ROOT_RO_OR_RW)
> >  endef
> > diff --git a/system/skeleton/run/.empty b/system/skeleton/run/lock/.
> empty
> > similarity index 100%
> > rename from system/skeleton/run/.empty
> > rename to system/skeleton/run/lock/.empty
> > --
> > 2.34.1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
>
>

[-- Attachment #1.2: Type: text/html, Size: 4729 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] system/skeleton: provide run/lock directory
@ 2022-04-18 18:18 Tim Hammer
  2022-04-18 20:47 ` Norbert Lange
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Hammer @ 2022-04-18 18:18 UTC (permalink / raw)
  To: Norbert Lange; +Cc: thomas.petazzoni, buildroot

On Wed, Jan 12, 2022 at 11:10:20AM +0100, Norbert Lange wrote:
> We changed the skeletons in bf01e51f3c, so that var/lock
> points to run/lock. This resulted in build failures as
> some packages want to work with these paths.
>
> -   Create run/lock, the run directory will be purged
>     later anyway (since 5e78e7e97d).

Yes, run/lock is removed later (see
https://lore.kernel.org/buildroot/20200605224858.12870-2-nolange79@gmail.com/
and
https://lore.kernel.org/buildroot/20220319190531.975B183CB8@busybox.osuosl.org/).

However, the soft link in var/ is not. It ends up in the rootfs for the target
and can cause problems later.

Is there a reason the link created by skeleton was not cleaned up?

I will be honest, I do not understand the full process and why the items created by
the skeleton package are not just left in place...

.Tim
Tim D. Hammer
tim.hammer@orolia.com


> -   for init == systemd, create the var/lock symlink early
>     to prevent packages creating this path as directory.
>
> Signed-off-by: Norbert Lange <nolange79@gmail.com>
> ---
>  package/skeleton-init-systemd/skeleton-init-systemd.mk | 2 ++
>  system/skeleton/run/{ => lock}/.empty                  | 0
>  2 files changed, 2 insertions(+)
>  rename system/skeleton/run/{ => lock}/.empty (100%)
>
> diff --git a/package/skeleton-init-systemd/skeleton-init-systemd.mk b/package/skeleton-init-systemd/skeleton-init-sys>> index 1e212cc2f7..795a171809 100644
> --- a/package/skeleton-init-systemd/skeleton-init-systemd.mk
> +++ b/package/skeleton-init-systemd/skeleton-init-systemd.mk
> @@ -62,6 +62,8 @@ define SKELETON_INIT_SYSTEMD_INSTALL_TARGET_CMDS
>       mkdir -p $(TARGET_DIR)/srv
>       mkdir -p $(TARGET_DIR)/var
>       ln -s ../run $(TARGET_DIR)/var/run
> +     # prevent install scripts to create var/lock as directory
> +     ln -s ../run/lock $(TARGET_DIR)/var/lock
>       install -D -m644 $(SKELETON_INIT_SYSTEMD_PKGDIR)/legacy.conf $(TARGET_DIR)/usr/lib/tmpfiles.d/legacy.conf
>       $(SKELETON_INIT_SYSTEMD_ROOT_RO_OR_RW)
>  endef
> diff --git a/system/skeleton/run/.empty b/system/skeleton/run/lock/.empty
> similarity index 100%
> rename from system/skeleton/run/.empty
> rename to system/skeleton/run/lock/.empty
> --
> 2.34.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-04-19 15:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 10:10 [Buildroot] [PATCH] system/skeleton: provide run/lock directory Norbert Lange
2022-01-12 10:19 ` Norbert Lange
2022-01-12 19:39   ` Arnout Vandecappelle
2022-04-18 18:18 Tim Hammer
2022-04-18 20:47 ` Norbert Lange
2022-04-19 15:33   ` Tim Hammer

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.