From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/3] Rework of the init system
Date: Fri, 06 Jan 2012 10:15:46 +0100 [thread overview]
Message-ID: <4F06BBC2.6050002@free-electrons.com> (raw)
In-Reply-To: <201201060813.26133.arnout@mind.be>
Hi,
On 06/01/2012 08:13, Arnout Vandecappelle wrote:
> On Monday 02 January 2012 10:52:13 Maxime Ripard wrote:
>> On 20/12/2011 09:03, Arnout Vandecappelle wrote:
>>> On Wednesday 23 November 2011 12:30:10 Maxime Ripard wrote:
> [snip]
>>>> diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
>>>> index 9e91136..73c4969 100644
>>>> --- a/package/busybox/busybox.mk
>>>> +++ b/package/busybox/busybox.mk
>>>> @@ -129,6 +129,16 @@ define BUSYBOX_DISABLE_MMU_APPLETS
>>>> endef
>>>> endif
>>>>
>>>> +ifeq ($(BR2_INIT_BUSYBOX),y)
>>>> +define BUSYBOX_SET_INIT
>>>> + $(call KCONFIG_ENABLE_OPT,CONFIG_INIT,$(BUSYBOX_BUILD_CONFIG))
>>>> +endef
>>>> +else
>>>> +define BUSYBOX_SET_INIT
>>>> + $(call KCONFIG_DISABLE_OPT,CONFIG_INIT,$(BUSYBOX_BUILD_CONFIG))
>>>> +endef
>>>> +endif
>>>> +
>>> I'm not sure if I'd want to have the disable there if BR2_INIT_BUSYBOX
>>> is not selected. There's nothing against a parallel install of
>>> systemd and busybox-init, selectable by 'init=...' on the kernel
>>> command line. (Well, except that systemd's symlinks destroy busybox init.)
>>
>> Well mutually exclusive init systems is the more obvious solution.
>> Having an sysv init and systemd should be ok at the same time should be
>> ok indeed, at least from a filesystem and boot point of view, but it
>> will probably be more problematic for the init scripts.
>
> Just to be clear: I agree that we should only support mutually exclusive
> init systems, but NOT mutually exclusive init packages. In other words,
> BR2_INIT_{BUSYBOX,SYSV,SYSTEMD} should be mutually exclusive. However,
> IMO that doesn't mean that the unused binaries should be forcibly removed
> from the system. In the current situation, it is also possible to compile
> the init applet of busybox and at the same time install the sysvinit package
> (where the sysvinit package will remove busybox's symlink).
>
> The main reason to allow both packages in parallel is that making them
> mutually exclusive adds complexity, while it is difficult to be sure that
> it really enforces mutual exclusivity in all situations. There are many
> cases where two packages supply the same functionality (especially with
> busybox), and buildroot does little (and should do little) to enforce
> that only one of them is used.
>
> Also enforcing it gives little benefit. You would normally not select
> any init package explicitly, you'd only select a BR2_INIT_ option. If
> you do select an init package explicitly after all, there may be a good
> reason for it. (Of course, this does mean that init should be removed
> from the default busybox configs.)
>
> The second reason is that it could make sense to have both (especially
> during development). So why spend extra effort to disable something
> that could be useful?
Ok, it makes sense
>
>> From what I understood of it, if init scripts are presents, systemd will
>> check the name to see if it has a unit for this, and will prefer the
>> unit if it has one. But I'm not sure how it will behave with our way of
>> naming the init scripts.
>
> That's something else: buildroot should install only one set of init
> scripts, either sysv or systemd. If you really want both, you'll have
> to put it in the skeleton.
I agree, but you seem to say otherwise in your other mail from today. To
me, there is no need for us to add a fallback to sysv scripts. You will
be in one of the three cases :
- You use sysvinit or busybox and the package has a sysv script: Great
- You use systemd and the package has no systemd unit file: Send a patch
- You use systemd and the package has a systemd unit file: Great
As simple as that.
>>>> diff --git a/package/systemd/Config.in b/package/systemd/Config.in
>>>> index 09cedb9..33d5ccf 100644
>>>> --- a/package/systemd/Config.in
>>>> +++ b/package/systemd/Config.in
>>>> @@ -1,5 +1,6 @@
>>>> config BR2_PACKAGE_SYSTEMD
>>>> bool "systemd"
>>>> + depends on BR2_INIT_SYSTEMD
>>> Again, there is no reason why you can't have sysvinit and systemd in
>>> parallel (except for the symlinks). Also, if you really want them to
>>> be mutually exclusive, I'd prefer the more explicit
>>> depends on !BR2_PACKAGE_SYSVINIT
>>
>> Hmmm, you mean BR2_INIT_SYSV ?
>
> Well, actually: if you want them to be mutually exclusive, the systemd
> package (and the sysvinit package) have no place in the menuconfig, so
> instead it should be:
>
> config BR2_PACKAGE_SYSTEMD
> depends on BR2_INIT_SYSTEMD
>
> This will make sure it gets selected if and only if BR2_INIT_SYSTEMD is
> selected, and will hide it from the menuconfig.
Right.
Maxime
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2012-01-06 9:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-23 11:30 [Buildroot] [RFC] Add systemd to buildroot Maxime Ripard
2011-11-23 11:30 ` [Buildroot] [PATCH 1/3] Add the systemd package Maxime Ripard
2011-11-23 11:57 ` Baruch Siach
2011-11-23 13:53 ` Maxime Ripard
2011-12-20 7:05 ` Arnout Vandecappelle
2012-01-02 9:35 ` Maxime Ripard
2011-11-23 11:30 ` [Buildroot] [PATCH 2/3] Rework of the init system Maxime Ripard
2011-12-20 8:03 ` Arnout Vandecappelle
2012-01-02 9:52 ` Maxime Ripard
2012-01-02 14:52 ` Thomas Petazzoni
2012-01-06 7:13 ` Arnout Vandecappelle
2012-01-06 9:15 ` Maxime Ripard [this message]
2012-01-09 6:37 ` Arnout Vandecappelle
2011-11-23 11:30 ` [Buildroot] [PATCH 3/3] Migrate the packages to the new infra Maxime Ripard
2011-12-20 21:29 ` Arnout Vandecappelle
2012-01-02 10:02 ` Maxime Ripard
2012-01-06 6:52 ` Arnout Vandecappelle
2011-11-23 14:05 ` [Buildroot] [RFC] Add systemd to buildroot Maxime Ripard
2011-11-23 21:14 ` Belisko Marek
2011-11-23 21:35 ` Maxime Ripard
2011-12-20 21:14 ` Arnout Vandecappelle
2011-12-14 10:43 ` Maxime Ripard
2011-12-20 6:49 ` Arnout Vandecappelle
2012-01-02 9:58 ` Maxime Ripard
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=4F06BBC2.6050002@free-electrons.com \
--to=maxime.ripard@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox