[2/2] archiver: Fix archive for linked kernel source

Submitted by Tom Hochstein on April 3, 2018, 1:51 p.m. | Patch ID: 149862

Details

Message ID 1522763475-16001-2-git-send-email-tom.hochstein@nxp.com
State New
Headers show

Commit Message

Tom Hochstein April 3, 2018, 1:51 p.m.
When archiving a kernel, if S is ${WORKDIR}/git, then
${WORKDIR}/git is in fact a soft link into work-shared,
and the archive contains just the soft link. Fix by
archiving the real directory.

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
---
 meta/classes/archiver.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index c107615..31c9b7e 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -277,6 +277,11 @@  def create_tarball(d, srcdir, suffix, ar_outdir):
     if (d.getVar('SRC_URI') == ""):
         return
 
+    # For the kernel archive, srcdir may just be a link to the
+    # work-shared location. Use os.path.realpath to make sure
+    # that we archive the actual directory and not just the link.
+    srcdir = os.path.realpath(srcdir)
+
     bb.utils.mkdirhier(ar_outdir)
     if suffix:
         filename = '%s-%s.tar.gz' % (d.getVar('PF'), suffix)