]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstate: Ensure installation directory is empty before execution
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 22 Mar 2017 10:02:51 +0000 (10:02 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 22 Mar 2017 10:12:10 +0000 (10:12 +0000)
When you enable the systemd DISTRO_FEATURE, opkg-native contains systemd units
which have a relocation fixme list. When systemd isn't in DISTRO_FEATURES, there
are no fixmes required. Unfortunately as sstate isn't cleaning up its installation
directory before use, if you install the systemd version, then install the
non-systemd version from sstate, it would leave behind the fixme file from the
systemd version and breakage results as it would try and fixup files which don't
exist.

The solution is to ensure the unpack/install directory is clean before use. It
does raise other questions about opkg-native, systemd and DISTRO_FEATURES but there
is an underlying sstate issue here too which would cause missing file failures.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sstate.bbclass

index a78092679768677a080887c786282f0c3d156cfb..af588548c2ef85d966787df7ae1432e1744bdba6 100644 (file)
@@ -313,6 +313,11 @@ def sstate_installpkg(ss, d):
         if not signer.verify(sstatepkg + '.sig'):
             bb.warn("Cannot verify signature on sstate package %s" % sstatepkg)
 
+    # Empty sstateinst directory, ensure its clean
+    if os.path.exists(sstateinst):
+        oe.path.remove(sstateinst)
+    bb.utils.mkdirhier(sstateinst)
+
     sstateinst = d.getVar("SSTATE_INSTDIR")
     d.setVar('SSTATE_FIXMEDIR', ss['fixmedir'])