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

Fred Ollinger Fred.Ollinger at seescan.com
Wed May 25 08:55:21 PDT 2016


Bind mount can allow mount to be two places:

>From the mount manpage:

"       The bind mounts.
              Since Linux 2.4.0 it is possible to remount part of the file hierarchy somewhere else.  The call is:

                     mount --bind olddir newdir"

If you do this, then you have your files on tmpfs.

Frederick
________________________________________
From: yocto-bounces at yoctoproject.org <yocto-bounces at yoctoproject.org> on behalf of Martin Townsend <mtownsend1973 at gmail.com>
Sent: Wednesday, May 25, 2016 8:07 AM
To: yocto at yoctoproject.org
Subject: [yocto] mount bind /var/lib and package management

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.
--
_______________________________________________
yocto mailing list
yocto at yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto



More information about the yocto mailing list