From patchwork Thu Jul 11 11:11:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Kjaergaard X-Patchwork-Id: 258411 X-Patchwork-Delegate: esben@haabendal.dk Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hugin.dotsrc.org (hugin.dotsrc.org [IPv6:2001:878:346::102]) by ozlabs.org (Postfix) with ESMTP id 7A37E2C00A1 for ; Thu, 11 Jul 2013 21:11:18 +1000 (EST) Received: from hugin.dotsrc.org (localhost [127.0.0.1]) by hugin.dotsrc.org (Postfix) with ESMTP id 7A76F3FBD9 for ; Thu, 11 Jul 2013 13:11:15 +0200 (CEST) X-Original-To: dev@oe-lite.org Delivered-To: dev@oe-lite.org Received: from mail02.prevas.se (mail02.prevas.se [62.95.78.10]) by hugin.dotsrc.org (Postfix) with ESMTPS id BDB1B3FBD9 for ; Thu, 11 Jul 2013 13:11:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=prevas.dk; i=@prevas.dk; l=1642; q=dns/txt; s=ironport2; t=1373541073; x=1405077073; h=from:to:cc:subject:date:message-id:mime-version; bh=RnrWWyk5BlgjutwkKAUJljOHqqLAGFXDbDvTXbwSZYU=; b=Ahus9do+baRIEmS7CcWRfgVWjlYOKhslxrtgg3Jd4tkoeYkmVMz0kJnJ 6WlmReEMrRRCOesN4PrcJUI6Y+hix8GUsPvXCXToKvNYsWD32lhBFyd0m PCVMTNJqaoAFh+m5ezixwdLTzVKAr7ppW7ta/bEdhSLbXcDcagGM73Iri A=; X-IronPort-AV: E=Sophos;i="4.87,1043,1363129200"; d="scan'208";a="3025207" Received: from vmprevas3.prevas.se (HELO smtp.prevas.se) ([172.16.8.103]) by ironport2.prevas.se with ESMTP/TLS/AES128-SHA; 11 Jul 2013 13:11:13 +0200 Received: from arh116.prevas.se (172.16.11.7) by smtp.prevas.se (172.16.8.105) with Microsoft SMTP Server (TLS) id 14.2.342.3; Thu, 11 Jul 2013 13:11:12 +0200 From: To: Subject: [PATCH] classes/sdk-image: fixup ELF_SOWRAP. Date: Thu, 11 Jul 2013 13:11:10 +0200 Message-ID: <1373541070-26288-1-git-send-email-jabk@prevas.dk> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Originating-IP: [172.16.11.7] X-BeenThere: dev@oe-lite.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: OE-lite development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dev-bounces@oe-lite.org Errors-To: dev-bounces@oe-lite.org From: Jacob Kjaergaard ELF_SOWRAP was intended to fixup dynamically linked binaries. However it also did so for statically linked files. This patch avoids the latter behaviour. --- classes/sdk-image.oeclass | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/classes/sdk-image.oeclass b/classes/sdk-image.oeclass index 3b32454..8d52da0 100644 --- a/classes/sdk-image.oeclass +++ b/classes/sdk-image.oeclass @@ -31,6 +31,11 @@ def image_preprocess_elf_sowrap(d): filetype = filemagic.file(path) return bool(host_elf_re.match(filetype)) + def is_static(path): + filetype = filemagic.file(path) + static_re = re.compile(".*statically.*") + return bool(static_re.match(filetype)) + def sowrap_dir(dir, recursive=False): if not os.path.exists(dir): return True @@ -49,6 +54,8 @@ def image_preprocess_elf_sowrap(d): print "ERROR: file already exists:", os.path.join(dir, path) ok = False continue + if is_elf(path) and is_static(path): + continue os.rename(path, dotpath) with open(path, "w") as wrapper: dirparts = len(os.path.dirname(path).split('/')) @@ -67,8 +74,9 @@ def image_preprocess_elf_sowrap(d): dir = dir.strip("/") rc = sowrap_dir(dir, recursive) if not rc: + filemagic.close() return rc - + filemagic.close() return image_preprocess_linux_netfilter_headers () {