Openembedded Core Discussions
 help / color / mirror / Atom feed
* read only rootfs?
@ 2012-03-05 20:39 Cliff Brake
  2012-03-05 20:56 ` Otavio Salvador
  2012-03-06  8:13 ` Eric Bénard
  0 siblings, 2 replies; 6+ messages in thread
From: Cliff Brake @ 2012-03-05 20:39 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Hello,

What are the best practices for implementing a read-only rootfs built
with OE?  I've looked at a few things like poky-tiny.conf, but figured
I would ask.

To date, I've been cheating and implementing a tmpfs overlay on top a
RO rootfs using unionfs, but this is less than idea as you need to do
the package install process on every boot.  Others boot the first time
RW, and then switch to RO for subsequent boots.

Thanks,
Cliff

-- 
=================
http://bec-systems.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: read only rootfs?
  2012-03-05 20:39 read only rootfs? Cliff Brake
@ 2012-03-05 20:56 ` Otavio Salvador
  2012-03-05 21:47   ` Cliff Brake
  2012-03-06  8:13 ` Eric Bénard
  1 sibling, 1 reply; 6+ messages in thread
From: Otavio Salvador @ 2012-03-05 20:56 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, Mar 5, 2012 at 17:39, Cliff Brake <cliff.brake@gmail.com> wrote:
> What are the best practices for implementing a read-only rootfs built
> with OE?  I've looked at a few things like poky-tiny.conf, but figured
> I would ask.

You could the image feature for it; depending on the image complexity
it might just work or need few fixes for some postinsts to work in
offline mode.

-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: read only rootfs?
  2012-03-05 20:56 ` Otavio Salvador
@ 2012-03-05 21:47   ` Cliff Brake
  2012-03-05 21:50     ` Otavio Salvador
  0 siblings, 1 reply; 6+ messages in thread
From: Cliff Brake @ 2012-03-05 21:47 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, Mar 5, 2012 at 3:56 PM, Otavio Salvador <otavio@ossystems.com.br> wrote:
> On Mon, Mar 5, 2012 at 17:39, Cliff Brake <cliff.brake@gmail.com> wrote:
>> What are the best practices for implementing a read-only rootfs built
>> with OE?  I've looked at a few things like poky-tiny.conf, but figured
>> I would ask.
>
> You could the image feature for it; depending on the image complexity
> it might just work or need few fixes for some postinsts to work in
> offline mode.

Thanks for the idea -- just for the record, I assume you mean the following:

IMAGE_FEATURES  read-only-rootfs

Looking briefly at what this does, it appears its only a diagnostic
feature that tells you if there are postinst processes that need to
run?

Thanks,
Cliff

-- 
=================
http://bec-systems.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: read only rootfs?
  2012-03-05 21:47   ` Cliff Brake
@ 2012-03-05 21:50     ` Otavio Salvador
  0 siblings, 0 replies; 6+ messages in thread
From: Otavio Salvador @ 2012-03-05 21:50 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, Mar 5, 2012 at 18:47, Cliff Brake <cliff.brake@gmail.com> wrote:
> Looking briefly at what this does, it appears its only a diagnostic
> feature that tells you if there are postinst processes that need to
> run?

In fact it checks if there're postinsts that *needs* to be run
"online"; if it does not, then it can be run in read-only mode.

-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: read only rootfs?
  2012-03-05 20:39 read only rootfs? Cliff Brake
  2012-03-05 20:56 ` Otavio Salvador
@ 2012-03-06  8:13 ` Eric Bénard
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Bénard @ 2012-03-06  8:13 UTC (permalink / raw)
  To: Cliff Brake; +Cc: openembedded-core

Hi Cliff,

Le Mon, 5 Mar 2012 15:39:36 -0500,
Cliff Brake <cliff.brake@gmail.com> a écrit :
> What are the best practices for implementing a read-only rootfs built
> with OE?  I've looked at a few things like poky-tiny.conf, but figured
> I would ask.
> 
> To date, I've been cheating and implementing a tmpfs overlay on top a
> RO rootfs using unionfs, but this is less than idea as you need to do
> the package install process on every boot.  Others boot the first time
> RW, and then switch to RO for subsequent boots.
> 
I've just done a squashfs image (using angstrom and based on
systemd-image) which was designed to run from a USB stick on an
OMAP3 board (for production testing purpose).

I went this way :
- build an ext3 image and run it read write to check it works fine,
- flash again the same ext3 image and run it read only to check which
  init scripts fail,
- amend the corresponding recipes to create links to tmpfs for the files
  that the init or postinstall scripts are creating, the first recipe to
  amend is base-files that angstrom modifies to not have volatile var/*
  directories which is a big problem when running read only (or simply
  when running on a flash where erase/write cycles are counted),
  other problematic recipes are those which install files in /var/log
  for example,
- run the new ext3 image read only to validate all the scripts are
  fixed (I'm using ext3 as it's easy to turn it rw to check how to fix
  a problem on the target without loosing to much time)
- once the ext3 image works fine ro, build the squasfs image and it
  should run fine.

Eric
-- 
http://eukrea.com/en/news/104-2012



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: read only rootfs?
@ 2012-03-06  8:56 Hauser, Wolfgang (external)
  0 siblings, 0 replies; 6+ messages in thread
From: Hauser, Wolfgang (external) @ 2012-03-06  8:56 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Hello,

we run our system using a readonly rootfs.

The main issues is, to figure out which packages need writeable data, this data have to be linked and managed by volatiles.
- tmpfs in ram for /tmp /var/volatiles
- links in  volatiles for /var/lib/.. (bluez, dhcp, ...); /var/log ;/var/run
- links for all files that have to be writeable from the aplications which are used.

Next step is to modify the packages that need a runtime (first boot) configuration.

- amend (bbappend) or modify the recipes in your own OE layer to avoid runtime (first boot) configuration of packages, most of them are capable to do its configuration offline. (search for pkg_postinst pkg_preinst)
 
Finally we got a working readonly Image directly out of OE. We don't use filesystem overlays like unionfs.
We use ubifs for NAND, because squashfs isn't able to manage bad blocks of NAND.

The number of modified packages isn't that high, so it may be better to spent the work to figure out the volatiles instead of overlaying the filesystems and carry the overhead.

Our user data reside on a USB-Stick connected to the system.

Reagards
Wolfgang

-----Ursprüngliche Nachricht-----
Von: openembedded-core-bounces@lists.openembedded.org [mailto:openembedded-core-bounces@lists.openembedded.org] Im Auftrag von Cliff Brake
Gesendet: Montag, 5. März 2012 21:40
An: Patches and discussions about the oe-core layer
Betreff: [OE-core] read only rootfs?

Hello,

What are the best practices for implementing a read-only rootfs built
with OE?  I've looked at a few things like poky-tiny.conf, but figured
I would ask.

To date, I've been cheating and implementing a tmpfs overlay on top a
RO rootfs using unionfs, but this is less than idea as you need to do
the package install process on every boot.  Others boot the first time
RW, and then switch to RO for subsequent boots.

Thanks,
Cliff

-- 
=================
http://bec-systems.com

_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-06  9:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05 20:39 read only rootfs? Cliff Brake
2012-03-05 20:56 ` Otavio Salvador
2012-03-05 21:47   ` Cliff Brake
2012-03-05 21:50     ` Otavio Salvador
2012-03-06  8:13 ` Eric Bénard
  -- strict thread matches above, loose matches on Subject: below --
2012-03-06  8:56 Hauser, Wolfgang (external)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox