[yocto] systemd, dpkg and read-only-rootfs

Martin Townsend mtownsend1973 at gmail.com
Tue Mar 8 06:10:19 PST 2016


Hi,

I'm using the Jethro branch to build a system that uses dpkg for a package
installer and systemd for the init manager.  Recently I took the plunge and
added read-only-rootfs and have found a few "features" that I thought I
would share.

1) dpkg-configure service fails.
This service looks like it's a first time boot action that runs dpkg
--configure -a which I assume is to finish all half installed packages that
needed to be finished on the real target because it couldn't be installed
during do_rootfs.  This actually succeeds as none of my packages are half
configured, otherwise this would fail.  The problem lies when it tries to
disable itself, it looks like systemctl disable call tries to update
symlink in /etc/systemd.  I have tried remounting rw then disabling and
then remount ro which I'm hoping will work, if not I will remove as I have
a first boot script for factory builds and will move to there.

2) There are a bunch of configuration files in /usr/lib/tmpfiles.d that
clash with files/directories that have already been created by Yocto which
only throws warnings but the files/directories that it tries to create in a
read-only rootfs cause the systemd-tmpfiles-setup.service to fail.  I've
patched the files in the systemd source directory to work around this, just
testing now.

3) It looks like Yocto mount binds /var/lib into tmpfs (/var/volatile/lib),
base-files recipe.  Now the dpkg database files are in this directory so
I'm guessing this will stop me from doing upgrades.  We don't use apt-get
but implement our own package manager so I was hoping to stop all services
remount rootfs as rw, perform upgrade, remount rootfs as ro.
Not sure what to do about this one, I could try and move dpkg database
files to somewhere else, might throw up other problems.  Or mount bind all
directories in /var/lib except dpkg?? Thoughts appreciated.

Best Regards,
Martin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20160308/e55feb3c/attachment.html>


More information about the yocto mailing list