All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] How to provide one default skeleton per init system?
Date: Tue, 10 Jun 2014 09:34:16 +0200	[thread overview]
Message-ID: <20140610093416.27e1bd35@free-electrons.com> (raw)
In-Reply-To: <20140609211341.GB10459@ned>

Dear Eric Le Bihan,

On Mon, 9 Jun 2014 23:13:43 +0200, Eric Le Bihan wrote:

> To properly use systemd as init system, some modifications should be performed
> on the default skeleton. This can be done via an overlay and a post-build
> script, as done in [1]. However, it would be best for Buildroot users to have
> it done automatically, as noted per ThomasP and MaximeH [2]. This brings forth
> the idea of having one target skeleton per init system.

Right. This looks a necessary cleanup to me.

> IHMO, there are two solutions for implementing it:
> 
> a) Move system/skeleton to system/skeleton/busybox, then add
>    system/skeleton/systemd, and maybe system/skeleton/sysv. The menu in
>    system/Config.in will be updated to select BR2_ROOTFS_SKELETON_BUSYBOX,
>    or BR2_ROOTFS_SKELETON_CUSTOM.
> b) Add a new virtual package: target-skeleton, with some providers:
>    target-skeleton-busybox, target-skeleton-systemd and
>    target-skeleton-custom (path to the custom skeleton would be handled in the
>    configuration menu).
> 
> Solution A is the quickest and less intrusive to implement, but it can only
> copy the files of the skeleton, not perform the additional operations from the
> post-build script. So solution B seems the best.
> 
> But if a new package target-skeleton is added, what would be the dependency
> chain? Would `make target-skeleton-rebuild` rebuild... the whole rootfs?

Clearly, some sort of solution (b), i.e something based on packages.

Regarding the names, I'd use just skeleton-*, not target-skeleton-*.
And I believe I would make skeleton a virtual package provided by
skeleton-systemd and skeleton-busybox, but instead have the 'skeleton'
package be a real package that provides all the files common to both
the Busybox and Systemd cases, and then have skeleton-systemd and
skeleton-busybox depend on skeleton, and adding the additional stuff
needed by systemd or busybox.

Also, there is the case of sysvinit, which is another init system that
we support.

Regarding the dependency chain, I believe all target packages will have
to depend on 'skeleton-<init>', just like they all depend on the
'toolchain' package. Since 'skeleton-<init>' are also going to be
target packages, it will require a little trick to avoid the circular
dependency, but nothing really terrible here.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  parent reply	other threads:[~2014-06-10  7:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09 21:13 [Buildroot] How to provide one default skeleton per init system? Eric Le Bihan
2014-06-10  7:21 ` Maxime Hadjinlian
2014-06-10  9:50   ` Thomas Petazzoni
2014-06-10 15:33     ` Jérôme Pouiller
2014-06-10  7:34 ` Thomas Petazzoni [this message]
2014-06-10  8:01 ` Maxime Ripard
2014-06-10  9:52   ` 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=20140610093416.27e1bd35@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.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.