Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] Makefile: Fix overlay overwriting everything
Date: Wed, 10 Feb 2016 21:35:03 +0100	[thread overview]
Message-ID: <56BB9EF7.80805@mind.be> (raw)
In-Reply-To: <CAGduivxYY-U23A63DHFhtmsAQ-jrEHmhNze=WQX82FmkF6MsBA@mail.gmail.com>

On 10-02-16 21:16, Maxime Hadjinlian wrote:
> Hi Arnout, all
> 
> On Wed, Feb 10, 2016 at 9:09 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
>> On 10-02-16 16:58, Maxime Hadjinlian wrote:
>>> After bumping from a 2 years old Buildroot installation, I got the
>>> following messages from the kernel at boot:
>>>
>>> Failed to execute /init (error -2)
>>>
>>> It appears that the overlay mechanisms was causing my issues.
>>>
>>> Description:
>>> The overlay mechanisms works by rsync'ing files from a folder specified
>>> by the user into target.
>>> Since c5bd8af65e50a51735eb112fed9cbe6337f14e06, /bin, /sbin and /lib are
>>> symlinked into /usr.
>>>
>>> Problem:
>>> If you have an overlay that contains the directory /bin, /sbin or /lib, rsync
>>> will erase the symlink and create a directory in its place.
>>> The directory, say .../target/lib, would *only* contains the overlay's content.
>>> Obviously, this causes a lot of troubles, starting with the kernel
>>> failing to start init (because of missing shared libraries).
>>>
>>> Solution:
>>> Telling rsync to treat symlinked dir on the receiver side as directory
>>> allow users to be blissfully ignorant of that problem.
>>
>>  I'm not so sure of this one... It makes it impossible to override the symlinks
>> in the skeleton in the overlay. Say, you want to populate /var/spool with some
>> directories so it becomes useable.
> Just a precision: it's not all the symlinks only the symlinks that
> points to a directory, like /var/spool
>>
>>  That said, it's probably better in that case to override the skeleton directly,
>> so that package installation can pick up the new directory.
>>
>>  Still, you _are_ breaking a valid use case with this patch.
> Another way to deal with this, is to test if in the overlay, there's a
> a folder that is a link is the default skeleton and in that case,
> treat it differently.

 That is just dealing with the "accident" that the /bin and /lib symlinks are
created with an explicit ln instead of being present in the skeleton. It could
just as well have been the reverse, that they are symlinks in the skeleton and
mkdirs in the makefile. So I wouldn't rely on that.


 Regards,
 Arnout

> In the spur of the moment it seems too complicated. But maybe it's the
> right solution after all.
[snip]

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

  reply	other threads:[~2016-02-10 20:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10 15:58 [Buildroot] [PATCH] Makefile: Fix overlay overwriting everything Maxime Hadjinlian
2016-02-10 20:09 ` Arnout Vandecappelle
2016-02-10 20:16   ` Maxime Hadjinlian
2016-02-10 20:35     ` Arnout Vandecappelle [this message]
2016-02-11  9:10       ` Maxime Hadjinlian
2016-02-11 22:26   ` Peter Korsgaard
2016-02-12 13:40     ` Maxime Hadjinlian
2016-06-02 22:20 ` Yann E. MORIN

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=56BB9EF7.80805@mind.be \
    --to=arnout@mind.be \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox