[OE-core] read only rootfs?

Eric Bénard eric at eukrea.com
Tue Mar 6 08:13:58 UTC 2012


Hi Cliff,

Le Mon, 5 Mar 2012 15:39:36 -0500,
Cliff Brake <cliff.brake at 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




More information about the Openembedded-core mailing list