From: Darren Hart <dvhart@linux.intel.com>
To: Tim Bird <tim.bird@am.sony.com>
Cc: "yocto@yoctoproject.org" <yocto@yoctoproject.org>
Subject: Re: RFC: poky-tiny: init procedure
Date: Fri, 15 Jun 2012 16:21:30 -0700 [thread overview]
Message-ID: <4FDBC37A.6060902@linux.intel.com> (raw)
In-Reply-To: <4FDBA4B8.8000703@am.sony.com>
On 06/15/2012 02:10 PM, Tim Bird wrote:
> On 06/14/2012 12:11 AM, Tomas Frydrych wrote:
>> A system that runs nothing but a shell is really not useful for anything
>> all, everyone using it will be adding some sort of services, so the
>> question of how the extending works (or does not work), needs to be in
>> the forefront of the design. My main reservation is that you are
>> suggesting to break one of the basic premisses behind the whole
>> ecosystem, namely that if I add a package that provides a service to an
>> image, I get that service running; 'fix by documentation' is never a fix.
>
> I didn't address this in my other response, and I
> think it's a valid observation. I agree that
> everyone will want to add something to the init,
> and that 'fix by documentation' is, in general, a
> poor solution.
>
> I don't have any good solution here (one that scales,
> or is likely to be adopted widely.) You don't really
> need documentation, if you have the few lines of shell
> script that are necessary to start a service in minimal
> mode. The standard init scripts handle lots of interactions
> with other services and runtime conditions. This is why
> they are bloated (and the abstractions in them are
> almost incomprehensible to read.)
>
> At Sony we've tried various things - like automatically
> stripping init scripts of uncalled branches, removing
> conditionals that don't apply, etc. We've also looked
> at automatically converting init scripts to C code, to
> speed up execution. You still end up with gobs of code
> that doesn't apply to your situation getting executed
> at boot time, an overly-complicated test scenario, and a
> certain fragility in the overall init system.
>
> One of our early efforts, getting busybox
> to not fork commands in init scripts that it had as
> builtins, proved to be a significant feature that is still
> valuable today to improve boot time.
>
> What we have settled on as a generic solution is basically
> what I described in response to Darren's initial post.
> You have a list of the short shell snippets required to start
> commonly-used services in /etc/rc.local. These
> are commented out by default, but a developer or product
> team can uncomment them to enable the associated services.
> This keeps everything in one place and provides developers
> the commands needed to start things. Customization to
> handle interactions or special cases can proceed from
> there. It's not ideal, in that a developer may have to
> re-create or rediscover some configuration, setting, or
> start sequence to handle a more complicated usage scenario.
> But in order to hit our targets for size or boot time, it
> has been helpful to do things this way. The developer is
> forced to manually enable each service, and the start
> sequence, commands and command parameters are obvious
> from the script. (This is rarely true of init scripts).
>
Does this mean you just don't worry about respawning services? If
the.... I dunno... ambient-light-sensor-daemon crashes, is the user
expected to just reboot the device?
> If anyone has good ideas or other experience for
> the init sequence for highly customized,
> resource-constrained products, I'd like to hear about
> them.
So Systemd does great things for deterministic boot with clearly defined
dependencies between services which also allows for as much parallelism
as possible (maybe that doesn't matter for your devices). I haven't
looked at how big systemd is what how much it would bloat my kernel to
support it. Have you?
As I understand it, it brings in things like udev and basically starts
to make my system look like a desktop/server. systemd-tiny ftw!
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
next prev parent reply other threads:[~2012-06-15 23:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-14 0:33 RFC: poky-tiny: init procedure Darren Hart
2012-06-14 1:09 ` Tim Bird
2012-06-14 1:20 ` Darren Hart
2012-06-14 2:55 ` Darren Hart
2012-06-14 7:11 ` Tomas Frydrych
2012-06-14 21:09 ` Darren Hart
2012-06-15 6:31 ` Tomas Frydrych
2012-06-15 7:05 ` Thomas Petazzoni
2012-06-15 23:04 ` Darren Hart
2012-06-15 19:49 ` Tim Bird
2012-06-15 21:26 ` Tomas Frydrych
2012-06-15 23:15 ` Darren Hart
2012-06-16 8:53 ` Tomas Frydrych
2012-06-15 21:10 ` Tim Bird
2012-06-15 23:21 ` Darren Hart [this message]
2012-06-18 11:50 ` Richard Purdie
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=4FDBC37A.6060902@linux.intel.com \
--to=dvhart@linux.intel.com \
--cc=tim.bird@am.sony.com \
--cc=yocto@yoctoproject.org \
/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.