All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 13271] New: systemd-resolved: /etc/resolv.conf link broken on per-package build
@ 2020-10-13 13:53 bugzilla at busybox.net
  2021-03-25 20:38 ` [Buildroot] [Bug 13271] " bugzilla at busybox.net
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bugzilla at busybox.net @ 2020-10-13 13:53 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13271

            Bug ID: 13271
           Summary: systemd-resolved: /etc/resolv.conf link broken on
                    per-package build
           Product: buildroot
           Version: 2020.08.1
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at buildroot.uclibc.org
          Reporter: posted at heine.so
                CC: buildroot at uclibc.org
  Target Milestone: ---

Issue:

systemd-resolved needs the /etc/resolv.conf entry like this:

/etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf

When using per-package build this isn't the case anymore. It still has the
default value from the skeleton:

/etc/resolv.conf -> ../tmp/resolv.conf


Analysis:

this is the code currently creating the link:

ifeq ($(BR2_PACKAGE_SYSTEMD_RESOLVED),y)
define SYSTEMD_INSTALL_RESOLVCONF_HOOK
        ln -sf ../run/systemd/resolve/resolv.conf \
                $(TARGET_DIR)/etc/resolv.conf
endef


As I learned on irc this doesn't work with per-package build as it is not
allowed to alter files from another package (even the skeleton). So this is why
it doesn't work.


Conclusion:

I'm not sure if this is properly fixable by the systemd package itself or if
this needs a removal from the skeleton with all its consequences.

Any Ideas welcome...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Buildroot] [Bug 13271] systemd-resolved: /etc/resolv.conf link broken on per-package build
  2020-10-13 13:53 [Buildroot] [Bug 13271] New: systemd-resolved: /etc/resolv.conf link broken on per-package build bugzilla at busybox.net
@ 2021-03-25 20:38 ` bugzilla at busybox.net
  2021-03-25 20:49 ` bugzilla at busybox.net
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla at busybox.net @ 2021-03-25 20:38 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13271

Leo <leojrfs@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |leojrfs at gmail.com

--- Comment #1 from Leo <leojrfs@gmail.com> ---
Created attachment 8836
  --> https://bugs.busybox.net/attachment.cgi?id=8836&action=edit
skeleton-init-systemd per-package workaround

I can confirm this.

This kind of issues might happen when using `per-package`.
The reason for this is that `target-finalize` rsyncs all the target
subdirectories under the package directory (example:
`$O/per-package/foo/target`) in alphabetic order:

```
$(call per-package-rsync,$(sort $(PACKAGES)),target,$(TARGET_DIR))
```

So, files in the final target, might get consecutively overwritten in that
process by the content of each package `per-package` `target` directory.

In this case, `udev` is one of the packages that overrides the `resolv.conf`,
it comes after `systemd` in the rsync order previously mentioned.

`udev` depends on `toolchain` which in turn depends on `skeleton-init-systemd`,
where `resolv.conf` is a link to `../tmp/resolv.conf`, thus,
`$O/per-package/udev/target/etc/resolv.conf` gets its value by rsyncing
`$O/per-package/toolchain/target/etc/resolv.conf` just before building.


Ideally, rsync would execute in dependency order instead of alphabetic order. I
tried to tinker around that, but had not much success. Im not sure how to solve
this problem.


In the meanwhile, I attach a patch for `skeleton-init-systemd.mk`, which solves
this specific issue. Im not sure it is the best way to solve this problem, for
the reasons I just mentioned.

Any thoughts?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Buildroot] [Bug 13271] systemd-resolved: /etc/resolv.conf link broken on per-package build
  2020-10-13 13:53 [Buildroot] [Bug 13271] New: systemd-resolved: /etc/resolv.conf link broken on per-package build bugzilla at busybox.net
  2021-03-25 20:38 ` [Buildroot] [Bug 13271] " bugzilla at busybox.net
@ 2021-03-25 20:49 ` bugzilla at busybox.net
  2021-03-27 21:11 ` bugzilla at busybox.net
  2021-04-13 19:16 ` bugzilla at busybox.net
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla at busybox.net @ 2021-03-25 20:49 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13271

Leo <leojrfs@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2020.08.1                   |2021.02

--- Comment #2 from Leo <leojrfs@gmail.com> ---
btw, this is still reproducible on 2021.02

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Buildroot] [Bug 13271] systemd-resolved: /etc/resolv.conf link broken on per-package build
  2020-10-13 13:53 [Buildroot] [Bug 13271] New: systemd-resolved: /etc/resolv.conf link broken on per-package build bugzilla at busybox.net
  2021-03-25 20:38 ` [Buildroot] [Bug 13271] " bugzilla at busybox.net
  2021-03-25 20:49 ` bugzilla at busybox.net
@ 2021-03-27 21:11 ` bugzilla at busybox.net
  2021-04-13 19:16 ` bugzilla at busybox.net
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla at busybox.net @ 2021-03-27 21:11 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13271

Yann E. MORIN <yann.morin.1998@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yann.morin.1998 at free.fr

--- Comment #3 from Yann E. MORIN <yann.morin.1998@free.fr> ---
Michael, All,

> define SYSTEMD_INSTALL_RESOLVCONF_HOOK
> 	ln -sf ../run/systemd/resolve/resolv.conf \
> 		$(TARGET_DIR)/etc/resolv.conf
> endef
> [...]
> SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
> 	SYSTEMD_INSTALL_RESOLVCONF_HOOK

Indeed, a hook doing such changes should be made to be a target-fianlize
hook rather than a post-target-install hook.

In systemd, there is already a target-finalize hook, for the nsswitch
configuration file.

Care to send a patch, please?

Regards,
Yann E. MORIN.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Buildroot] [Bug 13271] systemd-resolved: /etc/resolv.conf link broken on per-package build
  2020-10-13 13:53 [Buildroot] [Bug 13271] New: systemd-resolved: /etc/resolv.conf link broken on per-package build bugzilla at busybox.net
                   ` (2 preceding siblings ...)
  2021-03-27 21:11 ` bugzilla at busybox.net
@ 2021-04-13 19:16 ` bugzilla at busybox.net
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla at busybox.net @ 2021-04-13 19:16 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13271

Yann E. MORIN <yann.morin.1998@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Yann E. MORIN <yann.morin.1998@free.fr> ---
Michael, All,

Thanks for the report.

This is now supposedly fixed with commit 511fbda0be that has just been pushed.

Regards,
Yann E. MORIN.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2021-04-13 19:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 13:53 [Buildroot] [Bug 13271] New: systemd-resolved: /etc/resolv.conf link broken on per-package build bugzilla at busybox.net
2021-03-25 20:38 ` [Buildroot] [Bug 13271] " bugzilla at busybox.net
2021-03-25 20:49 ` bugzilla at busybox.net
2021-03-27 21:11 ` bugzilla at busybox.net
2021-04-13 19:16 ` bugzilla at busybox.net

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.