From patchwork Wed Sep 13 19:38:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dechesne X-Patchwork-Id: 112491 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1318705qgf; Wed, 13 Sep 2017 12:38:57 -0700 (PDT) X-Received: by 10.107.157.15 with SMTP id g15mr30113576ioe.182.1505331537217; Wed, 13 Sep 2017 12:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505331537; cv=none; d=google.com; s=arc-20160816; b=Y7Whz6QhUaBqMFesPVAyKK4CFdzPyLbHsUZH4OD5cEbl3GyzgEkGdi3ilVO04/JF1j ng8QLHCr6VsMUvRQllgeYsO6AcMw6yFG6iIIrrXpTZAb8GT1z3AET9gw19Q9+tLkybGF 21IyEU1gj27StFqJz9gz2H78VvootZ5+DhvkYj7kIcM0mBzVdso8cIaxzk75vkbZmPVi UH78IF7yeWO9eq/s3LAU8rCcEZrzAZ/wRyGg7gPWOME/DKzAwWR8/BiUctPEO54KcIp/ 1m5iNFwiU7tCXa2j+oUX9AR0PlpJSNEMgIpZyVo0UAwnTGSk5mpD0+WW9b2NS5OOIPTv H0qQ== 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=L7dra74lA4mOIj57mOITM/mq5nIFd8MnBhAILTEc88s=; b=EFd1ex/1JwE0KpAGfmKYUA/abyuDEHqYyFCLT6fIJ0UTP6UYAAKDN5IQrEI80CsTUI 7hy5RkczwU1wuN5k4pvtvxqkcPpgQAgH8tBrW7fG8g9bw+aVlHp9ah1678aXEqnuvpMe Dm784Cgj/2wf/luvABVArtQN3n4vd/zEubi4ehFls1/TJ1kFVzb9K+8fjAJcMYjGc72P YBCAlUSG653up7lYG0Zb01hgUT2aJ9MV/yHh36W1Rqpx8Kdpl9LdGtWEzaBVxhY3I8U/ QxQIc8VZht2MvKHdPi/6Jtnd24kATN56E0/pt7xjyXvVJFNErLZ2DM7uVSpMVOQVgLfz Bknw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kSX4xeQF; 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 d62si710693itb.11.2017.09.13.12.38.56; Wed, 13 Sep 2017 12:38:57 -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 header.s=google header.b=kSX4xeQF; 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 312F37864D; Wed, 13 Sep 2017 19:38:53 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) by mail.openembedded.org (Postfix) with ESMTP id E62BA785F0 for ; Wed, 13 Sep 2017 19:38:51 +0000 (UTC) Received: by mail-it0-f46.google.com with SMTP id c195so5913380itb.1 for ; Wed, 13 Sep 2017 12:38:53 -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=t8Aif+WaB7YmIHYGaAnl5SmrVboAsXZ7g90Soapen30=; b=kSX4xeQFnSue81o6fC+nUrsTYTiqN8vFvqwKiHjerpf1JB4VthWUbMJJNKrn83vzFh zQfRRPlLwKtr1FXoDbMuF+jYYMgaXoBKF5GyVJJVyZ4gBCy2B5RUuzks3IoF8/5coMP1 nvsSdcAiKkBo4AW0BMhSQbWFYZimo/mX6WR4Q= 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=t8Aif+WaB7YmIHYGaAnl5SmrVboAsXZ7g90Soapen30=; b=ilCnLb1kK21/SPR8ChIQzu5XvP3dOhUgsLqIrQvXt4ZkN+4e4Mq8fIJxse70hxeWNt q+HD3QBYwBcsKJYC+AM3fIReTABmfSjmDMrzId4vcINuN924F1V3MQjd4sK+Pi+tqLdI 4DWk0hBH0Ris6hBlXnm5Cb7P0EWzcBWzbAoEMvuhdfrk2QiKbLs71LjUDBxjInIkMnVz 6Kq2ljCNZ0OBqaH0EdOhzw2bKi5dljMPC2oLt7mW5EcDN7Y68ZpXxYNV/gOH8+JGYjJ7 FSFRIdGPE3a5f3Q+4JG2H6Q1LUUGhtDd+rMaEjU3WajnxyIm9N53hCijDDgpW7PMHief boWQ== X-Gm-Message-State: AHPjjUj3OTCJckNY+JVxQ5xTMj/xpkl5JOJbkibyJ0QZhLhzRLj0F3JC 3Uj1leHnHqvjQ0PjBO2jbcEjFw== X-Google-Smtp-Source: AOwi7QDyZ0EwU2TEh1kYsezDpBPwm6WKsOnqVSpu6w/qefvb50qnGr/cyLKsvU5r9OHA/St7fVKg1g== X-Received: by 10.36.112.147 with SMTP id f141mr6005738itc.80.1505331532965; Wed, 13 Sep 2017 12:38:52 -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 d189sm1212841itg.32.2017.09.13.12.38.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Sep 2017 12:38:52 -0700 (PDT) From: Nicolas Dechesne To: akuster808@gmail.com, openembedded-core@lists.openembedded.org Date: Wed, 13 Sep 2017 21:38:20 +0200 Message-Id: <20170913193820.11923-1-nicolas.dechesne@linaro.org> X-Mailer: git-send-email 2.11.0 Cc: Nicolas Dechesne Subject: [OE-core] [morty][PATCH] 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 Signed-off-by: Richard Purdie (cherry picked from commit cfc0c897656fe67e81a6a5dcd936dff785529f41) 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 diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index eefe574a60..f8318b83a1 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -28,7 +28,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', True) or "" @@ -40,7 +39,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(): @@ -262,14 +264,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() {