[yocto] mount bind /var/lib and package management

Martin Townsend mtownsend1973 at gmail.com
Wed May 25 08:07:37 PDT 2016


Hi,

When using a read only rootfs it mount --binds /var/lib into
/var/volatile/lib which lives in tmpfs and makes sense.  The problem
is that I use dpkg but I'm assuming other package management tools use
/var/lib as their admin dir.

Wouldn't this break package updates as the dpkg database files etc
will then be updated in tmpfs so a power cycle would means the changes
are lost? Or am I missing something?

I tried to mount bind all directories except dpkg which I managed to
get working but other systemd services failed as they expected
/var/lib to be writeable (the service that creates /var/lib/machines).
I suppose I could alter this to remount / rw first but gave up at this
point.

The next thing I tried was to use a new admindir for dpkg, ie
/lib/dpkg which I have working but I had to hack a lot of files
changing /var/lib to /lib including files for apt-get native.  I'm not
confident that I've got them all.

Is there another solution I haven't thought of?

Thanks in advance,
Martin.



More information about the yocto mailing list