From patchwork Fri Jun 2 07:05:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dechesne X-Patchwork-Id: 100987 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp249520qge; Fri, 2 Jun 2017 00:06:11 -0700 (PDT) X-Received: by 10.84.239.23 with SMTP id w23mr99424032plk.73.1496387171657; Fri, 02 Jun 2017 00:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496387171; cv=none; d=google.com; s=arc-20160816; b=cheuidcdbkzb61YWIPw9xhbyCHiTzjAKVUjQS7RdKUfXZ7b0vb+a5Hr54WC60N4ETj BUVYEzLkYs6ANuWzX8bBiOTFaf6FqOigBp60dS8kI+yZZr4SUuJIYN4Jt5lfzXXOPZ8M /+2ugM66JdUMKN3ZBouUddRPDg3UBP3zwOQIc4Ewi81VfOPaFm0DIYJOkt25qvJqJcs3 j75k6YM6Blhn19LTPXeqE7Ji3pQJ+Q/S2v78ibVZ0yVvtW2nN7HT5vkzHvmT2ttgnJID 20K4AcpHs/+0ELC8J8EytzmWTa3SAQtM7//hYnz1PIn2N6lY1MboO2ABWO7pa6lv9+W1 YWhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=Ez96Q21HiTga2bJONm6IeX1XJ42/wjEOP5mmbCYaGZI=; b=LUCSPKgTD/w3LmKi0whPn52MFjXGsJUr3kI2RnUtrfv52BOEu3frSTJJ23hLxFbm9h nWrfY1ZWCKwvhlU67Dd5XvJ/oXulZ0X6T0yy1hGJ4MbOKQ5r0MhSAg1KT2Qq7/FBDKqg lyKzyktrtMfS9S3RAV2wp4fdIL/JKbWhGn3jAgoGxKcCfd9CnL3VfM1uhk70FefKM29C dyzDHqP4za3lxCZpXLb8xpa5IZ6lNLXWkNwUaLvOF1Ig+bEahBl1kfw1XndPmqsul3+3 WLlHCIgJVe+kX6jDCPJZA8Xqwpzpnn+T1y4hSh2Rf1HAKr/bmDsxxdHzbezefokiz8x9 +syQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id e131si3463792pgc.328.2017.06.02.00.06.11; Fri, 02 Jun 2017 00:06:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id BDAD877E7E; Fri, 2 Jun 2017 07:06:06 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-qt0-f181.google.com (mail-qt0-f181.google.com [209.85.216.181]) by mail.openembedded.org (Postfix) with ESMTP id 8E2C777E50 for ; Fri, 2 Jun 2017 07:06:03 +0000 (UTC) Received: by mail-qt0-f181.google.com with SMTP id c13so53251905qtc.1 for ; Fri, 02 Jun 2017 00:06:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=V4yQdTQudRPCIhP9+sMF9ybWaSIqlwhSxyka05xFFUs=; b=gXCKGFlFmbWa59/XKqmFXSS7vAMyf+udP4XlwKrerViE1synMD7XlYn6qL6lrP4Es+ O46b9P8K+w+faFgT1rV8jKBFaWeAwF77S1W31w3TwIijuzdqQnBg4lyaSKo5mY/6K010 q3IsoQR16z8wSy4Dia4xHW68ERu6y8oMtBu7k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=V4yQdTQudRPCIhP9+sMF9ybWaSIqlwhSxyka05xFFUs=; b=PMUbgAXo3fqu/2vxg5FqO75fOdfbE4RdrKuJjNseKSobm6+rYRWZxrslNMjSSI0EAm GFCiJrdyp+ZsJO63ZovC3gfEi2z3AiYGGRNr39dYwrKwnCXNlx4s263F24j2IF1B9CEY S4L3hvt4nyi2zvosXm/j6QpuWCJA7AuwxkpFsr67ZUmYf3QucKLs5yA8KOTokUROgZdx qxfbDx0svngiun35pL9zPszHszfRpXGm7+qsReAr3Pw0xdmYecLiIu8b8qtMh6GlMb39 88gKmvUWQNjDI1+sFSifGfXqCfyGM1+o5f9yiz47rRXz3PPf7ac6R0kiyy5bL4sn5K1K P1pQ== X-Gm-Message-State: AODbwcA0pi72vaDIR7EXFXt3VpL2qa+RQp15H6OAgzOeSHgr99CKDZCC XgKN8L0a7TXGL6PgVSLhsA== X-Received: by 10.237.53.205 with SMTP id d13mr6071935qte.46.1496387164961; Fri, 02 Jun 2017 00:06:04 -0700 (PDT) Received: from localhost.localdomain (static.8.26.4.46.clients.your-server.de. [46.4.26.8]) by smtp.gmail.com with ESMTPSA id h21sm12002365qke.52.2017.06.02.00.06.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Jun 2017 00:06:04 -0700 (PDT) From: Nicolas Dechesne To: openembedded-core@lists.openembedded.org Date: Fri, 2 Jun 2017 09:05:31 +0200 Message-Id: <20170602070531.22820-1-nicolas.dechesne@linaro.org> X-Mailer: git-send-email 2.11.0 Cc: Nicolas Dechesne Subject: [OE-core] [PATCH v3] kernel.bbclass: fix KERNEL_IMAGETYPE(S) for Image.gz X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org KERNEL_IMAGETYPES lists all the kernel images that we want to build. in cb17b6c2a7 (kernel.bbclass: support kernel image type of vmlinux.gz), some logic was added to support vmlinux.gz which is not a target built by kernel makefiles (only vmlinux). It is clear that the goal of this logic is only to support vmlinux.gz and not others compressed format (such as Image.gz) which are valid target for kernel makefiles. For Image.gz we should rely on the kernel makefiles and not do the compression in kernel class. This patch updates the logic used to filter out non supported kernel target from KERNEL_IMAGETYPES, and make vmlinux.gz a 'special case', instead of *.gz. If more special cases are needed in the future, we could add them in a similar way. This patch should be a no-op for anyone using vmlinux or vmlinux.gz, and on top of that it is fixing the build for Image.gz which was not working until now. Signed-off-by: Nicolas Dechesne --- meta/classes/kernel.bbclass | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core Tested-by: Kunihiko Hayashi diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 7a134d5c29..7670c7107a 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -32,7 +32,6 @@ KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION') KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}" python __anonymous () { - import re # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES type = d.getVar('KERNEL_IMAGETYPE') or "" @@ -44,7 +43,10 @@ python __anonymous () { types = (alttype + ' ' + types).strip() d.setVar('KERNEL_IMAGETYPES', types) - typeformake = re.sub(r'\.gz', '', types) + # some commonly used kernel images aren't generated by the kernel build system, such as vmlinux.gz + # typeformake lists only valid kernel make targets, and post processing can be done after the kernel + # is built (such as using gzip to compress vmlinux) + typeformake = types.replace('vmlinux.gz', 'vmlinux') d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake) for type in types.split(): @@ -268,14 +270,12 @@ kernel_do_compile() { fi for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do oe_runmake ${typeformake} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd - for type in ${KERNEL_IMAGETYPES} ; do - if test "${typeformake}.gz" = "${type}"; then - mkdir -p "${KERNEL_OUTPUT_DIR}" - gzip -9c < "${typeformake}" > "${KERNEL_OUTPUT_DIR}/${type}" - break; - fi - done done + # vmlinux.gz is not built by kernel + if (echo "${KERNEL_IMAGETYPES}" | grep -wq "vmlinux\.gz"); then + mkdir -p "${KERNEL_OUTPUT_DIR}" + gzip -9c < ${B}/vmlinux > "${KERNEL_OUTPUT_DIR}/vmlinux.gz" + fi } do_compile_kernelmodules() {