From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v7 3/8] core: implement per-package SDK and target
Date: Tue, 5 Nov 2019 17:38:30 +0100 [thread overview]
Message-ID: <20191105173830.6c8fc5d1@windsurf> (raw)
In-Reply-To: <b92540ca-37ad-42ad-9bf3-eee8f6f6ed26@cesnet.cz>
Hello Jan,
Yes, some feedback on an almost year old comment!
On Tue, 08 Jan 2019 19:02:56 +0100
Jan Kundr?t <jan.kundrat@cesnet.cz> wrote:
> I gave this series (the ppsh-v7-work merged into master, actually, with a
> revert of 51395b14ed1a23858eef5d7f2bcf3a03cca6dfb3). The only immediate
> breakage I see so far on my config (ARM, systemd, glibc, linaro toolchain)
> is related to systemd-networkd and its /etc/resolv.conf symlink handling,
> but I am afraid that I see a bigger problem.
>
> The basic skeleton defines a symlink (it's in
> system/skeleton/etc/resolv.conf) pointing to ../tmp/resolv.conf . This is
> overwritten in package/systemd/systemd.mk through
> SYSTEMD_INSTALL_RESOLVCONF_HOOK, and indeed it results in a correct symlink
> in the systemd's per-package target dir:
>
> per-package/systemd/target/etc/resolv.conf ->
> ../run/systemd/resolve/resolv.conf
>
> The problem is that at the rsync time, packages are processed in
> alphabetical order. If the very last package to be rsynced (in my case,
> this is zlib) does not transitively depend on systemd, then rsync will
> update the /etc/resolv.conf symlink back to one obtained from the default
> skeleton.
Indeed. Clearly, we have identified since quite a while that the
per-package directory mechanism only works if all packages install
distinct set of files, unless they have a dependency relationship.
> I think that this is -- potentially -- also a problem for any package "P2"
> which calls `ln -sf` from its *_INSTALL_TARGET_HOOKS to overwrite stuff
> which belongs to another package "P1". If any other package "P3" depends on
> "P1" and not on "P2", *and* if P3's name sorts after P2, then the P1's
> symlink gets preserved via P3.
>
> This will not necessary be fixed by changing to do the rsync in a
> dependency order because "P3" can still be rsynced after "P2".
>
> What is the cleanest fix here? Should this symlink overriding go to
> *_TARGET_FINALIZE_HOOKS? If the `ln -sf` was just in TARGET_FINALIZE_HOOKS,
> that would mean that the corresponding per-package/*/target would *not*
> contain these fixes which would be quite confusing, IMHO... OTOH, two hooks
> for overwriting would be ugly.
For the case of resolv.conf, I think solving it through a
TARGET_FINALIZE_HOOKS is probably the most appropriate option for now.
We'll have to see later on if we have other cases like this, and if
there is a pattern that allows us to invent some useful bit of
additional infrastructure.
Or we could:
(1) Move the /etc/resolv.conf symlink from system/skeleton/ to
package/skeleton-init-sysv/skeleton/etc.
(2) Tweak the systemd.mk so that it always creates resolv.conf, either
pointing to ../run/systemd/resolve/resolv.conf when resolved is
enabled, or to /tmp/resolv.conf otherwise.
This would avoid the overwriting entirely.
What do you think ?
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2019-11-05 16:38 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-28 10:43 [Buildroot] [PATCH v7 0/8] Top-level parallel build support Thomas Petazzoni
2018-12-28 10:43 ` [Buildroot] [PATCH v7 1/8] support/scripts/check-host-rpath: document existing functions Thomas Petazzoni
2018-12-28 12:47 ` Yann E. MORIN
2019-01-17 21:33 ` Peter Korsgaard
2018-12-28 10:43 ` [Buildroot] [PATCH v7 2/8] Makefile: move definition of TARGET_DIR inside .config condition Thomas Petazzoni
2018-12-28 12:49 ` Yann E. MORIN
2019-01-17 21:35 ` Peter Korsgaard
2018-12-28 10:43 ` [Buildroot] [PATCH v7 3/8] core: implement per-package SDK and target Thomas Petazzoni
2018-12-30 21:52 ` Yann E. MORIN
2018-12-31 14:31 ` Thomas Petazzoni
2018-12-31 14:45 ` Yann E. MORIN
2019-01-08 18:02 ` Jan Kundrát
2019-11-05 16:38 ` Thomas Petazzoni [this message]
2019-11-05 19:05 ` Carlos Santos
2019-11-06 7:57 ` Thomas Petazzoni
2019-11-06 8:13 ` Jan Kundrát
2018-12-28 10:43 ` [Buildroot] [PATCH v7 4/8] Makefile: allow top-level parallel build with BR2_PER_PACKAGE_DIRECTORIES=y Thomas Petazzoni
2018-12-28 12:51 ` Yann E. MORIN
2018-12-28 10:43 ` [Buildroot] [PATCH v7 5/8] package/pkg-generic: make libtool .la files compatible with per-package directories Thomas Petazzoni
2018-12-31 8:44 ` Yann E. MORIN
2018-12-28 10:43 ` [Buildroot] [PATCH v7 6/8] package/pkg-kconfig: handle KCONFIG_DEPENDENCIES " Thomas Petazzoni
2018-12-28 10:43 ` [Buildroot] [PATCH v7 7/8] docs/manual: add details about top-level parallel build support Thomas Petazzoni
2018-12-28 13:03 ` Yann E. MORIN
2018-12-28 13:08 ` Thomas Petazzoni
2018-12-31 8:46 ` Yann E. MORIN
2018-12-28 10:43 ` [Buildroot] [PATCH v7 8/8] docs/manual: document the effect of per-package directory on variables Thomas Petazzoni
2018-12-28 17:21 ` [Buildroot] [PATCH v7 0/8] Top-level parallel build support Thomas Petazzoni
2019-02-22 16:18 ` Andreas Naumann
2019-02-22 18:07 ` Vadim Kochan
2019-02-22 20:29 ` Thomas Petazzoni
2019-02-25 1:10 ` Vadim Kochan
2019-02-25 8:05 ` Thomas Petazzoni
2019-02-25 8:33 ` Vadim Kochan
2019-03-01 14:50 ` Vadym Kochan
2019-03-01 17:18 ` Yann E. MORIN
2019-03-04 7:24 ` Arnout Vandecappelle
2019-03-04 10:22 ` Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191105173830.6c8fc5d1@windsurf \
--to=thomas.petazzoni@bootlin.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.