[OE-core] [OE-Core][PATCH] systemd: Default to non-stateless images

Alex Kiernan alex.kiernan at gmail.com
Tue May 7 06:00:15 UTC 2019


On Mon, May 6, 2019 at 11:28 AM Peter Kjellerstedt
<peter.kjellerstedt at axis.com> wrote:
>
> > -----Original Message-----
> > From: openembedded-core-bounces at lists.openembedded.org <openembedded-
> > core-bounces at lists.openembedded.org> On Behalf Of Jonas Bonn
> > Sent: den 6 maj 2019 06:54
> > To: Alex Kiernan <alex.kiernan at gmail.com>; openembedded-
> > core at lists.openembedded.org
> > Subject: Re: [OE-core] [OE-Core][PATCH] systemd: Default to non-
> > stateless images
> >
> > Hi Alex,
> >
> > The below is fine and looks good.  The one thing that bothers me about
> > this is that "stateless" isn't really a property of the "distro",
> > rather
> > it's a property of the image/machine.  I suspect, in the same sense
> > that
> > we have readonly-rootfs, that we should probably have image features
> > "stateless-rootfs" (no /etc, no /var) and "volatile-rootfs" (no /var).
> >
> > Furthermore, if you want to boot with 'ro' on the command-line, I
> > really
> > think you need to build your image with the "readonly-rootfs" feature
> > set.  The default should be writable+persistent /etc as that's the
> > configuration used 99% of the time (currently).  "readonly-rootfs" does
> > a bit more than just creating machine-id but it's all relevant to the
> > 'ro' case where /etc isn't writable.
> >
> > Just for clarification:
> >
> > i)  volatile-rootfs:  means there's no point in prepopulating /var
> > because it's on a tmpfs and needs to be populated at boot time
>
> This doesn't really say anything about the state of the rootfs outside
> of /var, i.e., is it writable or read-only?
>
> > ii)  stateless-rootfs:  means there's no point in prepopulating neither
> > /etc nor /var because they are on a tmpfs and need to be populated at
> > boot time
>
> Same here.
>
> > iii)  readonly-rootfs:  means that /etc is really not writable so it's
> > important that: the systemd first-boot stuff needs to be done at build
> > time:  machine-id, unit files set up, all tmpfiles.d snippets that
> > touch /etc and /var need to be done in advance.
> >
> > /Jonas
>
> Maybe we need some more generic way of describing the intended
> structure of the image? E.g., what are the expected behavior of
> /etc, /var and the rest of the rootfs? For each they can typically
> be "read-only", "persistent" (writable and survives reboots) or
> "volatile" (writable, but doesn't survive a reboot).
>

That feels like a useful direction...

Certainly there's constraints in a systemd world as to what's
allowable (which is basically the three models: stateful, volatile and
stateless) - violate those and you end up with all kinds of things you
didn't expect happening (like a new journal being created everytime
you reboot with a new machine id until you run out of disk...)


--
Alex Kiernan


More information about the Openembedded-core mailing list