* [Buildroot] Has anybody got systemd to work?
@ 2012-06-18 2:45 Dmitry Golubovsky
2012-06-18 7:15 ` Attila Kinali
0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Golubovsky @ 2012-06-18 2:45 UTC (permalink / raw)
To: buildroot
Hi,
I am trying to boot a root FS built with systemd acting as init.
Looks like it fails in src/mount-setup.c, function
mount-group-controllers, ca. line 193.
I get an error message
Failed to parse /proc/cgroups.
as a result of
if (fscanf(f, "%ms %*i %*i %i", &controller, &enabled) != 2)
failing to parse /proc/cgroups.
I changed %ms to %s and added explicit malloc right before (only in
that file, mount-setup.c). I was able to get a bit further, but failed
on another instance of fscanf with %ms (anf there seem to be more
files with %ms
Is %ms format (pre-malloc a value buffer) or %as format supported in
uClibc in principle, or can it be enabled via specific configutration,
or expected in future versions?
I use uClibc 0.9.33
Has anybody seen this?
Thanks.
--
Dmitry Golubovsky
Anywhere on the Web
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] Has anybody got systemd to work?
2012-06-18 2:45 [Buildroot] Has anybody got systemd to work? Dmitry Golubovsky
@ 2012-06-18 7:15 ` Attila Kinali
2012-06-18 12:46 ` Dmitry Golubovsky
0 siblings, 1 reply; 10+ messages in thread
From: Attila Kinali @ 2012-06-18 7:15 UTC (permalink / raw)
To: buildroot
On Sun, 17 Jun 2012 22:45:20 -0400
Dmitry Golubovsky <golubovsky@gmail.com> wrote:
>
> I am trying to boot a root FS built with systemd acting as init.
Out of curiosity: Is there any reason why you'd want to use
systemd in an embedded system? What does it provide that a normal init
cannot?
Attila Kinali
--
It is upon moral qualities that a society is ultimately founded. All
the prosperity and technological sophistication in the world is of no
use without that foundation.
-- Miss Matheson, The Diamond Age, Neil Stephenson
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] Has anybody got systemd to work?
2012-06-18 7:15 ` Attila Kinali
@ 2012-06-18 12:46 ` Dmitry Golubovsky
2012-06-18 12:53 ` Maxime Ripard
0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Golubovsky @ 2012-06-18 12:46 UTC (permalink / raw)
To: buildroot
Attila,
On Mon, Jun 18, 2012 at 3:15 AM, Attila Kinali <attila@kinali.ch> wrote:
>> I am trying to boot a root FS built with systemd acting as init.
>
> Out of curiosity: Is there any reason why you'd want to use
> systemd in an embedded system? What does it provide that a normal init
> cannot?
I am not targeting an embedded system; rather portable to desktop
range (laptops, small desktops, and those new pocket-size boxes that
can be hooked to a TV/monitor and worked with - I need to build a
compact initial root FS).
Systemd provides asynchronous dependency-based booting (something I
liked in Android init), and some level of containerization (LXC would
be too much for my purpose, but I'd rather use systemd than some
clumsy shell scripts which I tried to achieve the same with).
I use Buildroot because it is a mature toolkit being many years in
active use, with convenient menu configuration.
OTOH I see other developers suggesting more systemd patches (like one
by Maxime Ripard [1] that showed up in the list recently)
Maxime: do you use an alternative toolchain with systemd?
Per my postings some time ago where I suggested adding PAM
capabilities to systemd: I was able to compile systemd with PAM but
was unable to test it because of the parsing problem I ran into (see
the OP).
Thanks.
[1] http://lists.busybox.net/pipermail/buildroot/2012-June/054903.html
--
Dmitry Golubovsky
Anywhere on the Web
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] Has anybody got systemd to work?
2012-06-18 12:46 ` Dmitry Golubovsky
@ 2012-06-18 12:53 ` Maxime Ripard
2012-06-18 12:58 ` Maxime Ripard
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Maxime Ripard @ 2012-06-18 12:53 UTC (permalink / raw)
To: buildroot
Hi Dmitry,
I was just replying to your previous mail.
Le 18/06/2012 14:46, Dmitry Golubovsky a ?crit :
> Maxime: do you use an alternative toolchain with systemd?
After a bit of testing, it seems indeed that the bug is uclibc-only, and
didn't encountered it as I do most of my testing using glibc.
Anyway, if it is only the %ms thing that is breaking systemd on uclibc,
it shouldn't be such a big problem. Quickly grepping the systemd source
code returns 17 occurences of such case, so a patch is definitely doable.
I won't have much time, do you mind doing so and sending us the patch so
that it could get included ?
Maxime
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] Has anybody got systemd to work?
2012-06-18 12:53 ` Maxime Ripard
@ 2012-06-18 12:58 ` Maxime Ripard
2012-06-18 13:02 ` Dmitry Golubovsky
2012-06-18 13:21 ` Attila Kinali
2 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2012-06-18 12:58 UTC (permalink / raw)
To: buildroot
Le 18/06/2012 14:53, Maxime Ripard a ?crit :
> Hi Dmitry,
>
> I was just replying to your previous mail.
>
> Le 18/06/2012 14:46, Dmitry Golubovsky a ?crit :
>> Maxime: do you use an alternative toolchain with systemd?
>
> After a bit of testing, it seems indeed that the bug is uclibc-only, and
> didn't encountered it as I do most of my testing using glibc.
>
> Anyway, if it is only the %ms thing that is breaking systemd on uclibc,
> it shouldn't be such a big problem. Quickly grepping the systemd source
> code returns 17 occurences of such case, so a patch is definitely doable.
>
> I won't have much time, do you mind doing so and sending us the patch so
> that it could get included ?
Also, it seems that the %m modifier support has been merged 3 weeks ago
in uclibc:
http://git.uclibc.org/uClibc/commit/libc/stdio/_scanf.c?id=8cfb43de636faa401634340d1a18404844f9ba5a
Looks like we will definitely need a patch :)
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] Has anybody got systemd to work?
2012-06-18 12:53 ` Maxime Ripard
2012-06-18 12:58 ` Maxime Ripard
@ 2012-06-18 13:02 ` Dmitry Golubovsky
2012-06-18 13:21 ` Attila Kinali
2 siblings, 0 replies; 10+ messages in thread
From: Dmitry Golubovsky @ 2012-06-18 13:02 UTC (permalink / raw)
To: buildroot
Maxime,
On Mon, Jun 18, 2012 at 8:53 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Anyway, if it is only the %ms thing that is breaking systemd on uclibc,
This has been found so far ;)
> it shouldn't be such a big problem. Quickly grepping the systemd source
> code returns 17 occurences of such case, so a patch is definitely doable.
Yes, I got the same.
> I won't have much time, do you mind doing so and sending us the patch so
> that it could get included ?
Yes, I am going to work on this, and will provide the patch once I have it.
I cannot promise exactly when ;)
Thanks.
--
Dmitry Golubovsky
Anywhere on the Web
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] Has anybody got systemd to work?
2012-06-18 12:53 ` Maxime Ripard
2012-06-18 12:58 ` Maxime Ripard
2012-06-18 13:02 ` Dmitry Golubovsky
@ 2012-06-18 13:21 ` Attila Kinali
2012-06-18 13:32 ` Dmitry Golubovsky
2 siblings, 1 reply; 10+ messages in thread
From: Attila Kinali @ 2012-06-18 13:21 UTC (permalink / raw)
To: buildroot
On Mon, 18 Jun 2012 14:53:54 +0200
Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
> Le 18/06/2012 14:46, Dmitry Golubovsky a ?crit :
> > Maxime: do you use an alternative toolchain with systemd?
>
> After a bit of testing, it seems indeed that the bug is uclibc-only, and
> didn't encountered it as I do most of my testing using glibc.
Actually no: The bug is in systemd.
The m modifier is a gnu extension of the scanf format and is not
in the C99 standard. Because systemd silently assume that you are building
in a gnu environment (ie with glibc gcc etc) it fails at this point.
Attila Kinali
--
Why does it take years to find the answers to
the questions one should have asked long ago?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] Has anybody got systemd to work?
2012-06-18 13:21 ` Attila Kinali
@ 2012-06-18 13:32 ` Dmitry Golubovsky
2012-06-18 18:59 ` Dmitry Golubovsky
0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Golubovsky @ 2012-06-18 13:32 UTC (permalink / raw)
To: buildroot
Hi,
On Mon, Jun 18, 2012 at 9:21 AM, Attila Kinali <attila@kinali.ch> wrote:
> Actually no: The bug is in systemd.
> The m modifier is a gnu extension of the scanf format and is not
> in the C99 standard. Because systemd silently assume that you are building
> in a gnu environment (ie with glibc gcc etc) it fails at this point.
From the portability standpoint, it is..
They likely did not provide testing and fallback for %ms support in
their autoconf scripts.
I'll try to look into their source tree as well to see if this has
been addressed there, and maybe will try to propose a fix for
upstream, however local patching might be a faster solution
(unfortunately).
Thanks.
--
Dmitry Golubovsky
Anywhere on the Web
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] Has anybody got systemd to work?
2012-06-18 13:32 ` Dmitry Golubovsky
@ 2012-06-18 18:59 ` Dmitry Golubovsky
2012-06-18 19:43 ` Thomas Petazzoni
0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Golubovsky @ 2012-06-18 18:59 UTC (permalink / raw)
To: buildroot
Hi,
On Mon, Jun 18, 2012 at 9:32 AM, Dmitry Golubovsky <golubovsky@gmail.com> wrote:
>
> I'll try to look into their source tree as well to see if this has
> been addressed there, and maybe will try to propose a fix for
> upstream, however local patching might be a faster solution
> (unfortunately).
From the quick look at the repo [1] it seems like after v44 they
completely reorganized the sources (and integrated udev): the
offending file mount-setup.c is now in src/core (but %ms is still
there).
Why was version 44 selected for Buildroot rather than any later
version - just to avoid conflict with already included udev?
Thanks.
[1] http://cgit.freedesktop.org/systemd/systemd/tree/src?id=v185 (v185
is the last recorded tag)
--
Dmitry Golubovsky
Anywhere on the Web
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] Has anybody got systemd to work?
2012-06-18 18:59 ` Dmitry Golubovsky
@ 2012-06-18 19:43 ` Thomas Petazzoni
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2012-06-18 19:43 UTC (permalink / raw)
To: buildroot
Le Mon, 18 Jun 2012 14:59:36 -0400,
Dmitry Golubovsky <golubovsky@gmail.com> a ?crit :
> Why was version 44 selected for Buildroot rather than any later
> version - just to avoid conflict with already included udev?
I guess just because Maxime started the work of packaging systemd into
Buildroot a while ago, and at the time, version 44 was the latest one.
It would of course be good to bump to the newest version.
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-06-18 19:43 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-18 2:45 [Buildroot] Has anybody got systemd to work? Dmitry Golubovsky
2012-06-18 7:15 ` Attila Kinali
2012-06-18 12:46 ` Dmitry Golubovsky
2012-06-18 12:53 ` Maxime Ripard
2012-06-18 12:58 ` Maxime Ripard
2012-06-18 13:02 ` Dmitry Golubovsky
2012-06-18 13:21 ` Attila Kinali
2012-06-18 13:32 ` Dmitry Golubovsky
2012-06-18 18:59 ` Dmitry Golubovsky
2012-06-18 19:43 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox