From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6750187537661165568 X-Received: by 2002:a19:6108:: with SMTP id v8mr5711157lfb.160.1573205107574; Fri, 08 Nov 2019 01:25:07 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:4349:: with SMTP id m9ls1587142lfj.8.gmail; Fri, 08 Nov 2019 01:25:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwfzf9EowamhHkSkoB5AUyRk6NxlVO10/CEPJPEps+TKTGA5RCEsMbeZtpfhtgRWyaHYNeD X-Received: by 2002:a19:8889:: with SMTP id k131mr5877472lfd.113.1573205107254; Fri, 08 Nov 2019 01:25:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573205107; cv=none; d=google.com; s=arc-20160816; b=bjMlAwaASfBL20NhYYH7+kIN9v7Ap7li5m7LIpavqFev88doVnZcdXYRdUzlkknF6b txaZT5z5yCcikiwm5aycn1Hswl5DORM/GxDuF1eST+gT9+7FxBzefoJuqxVOnV4ZbNlm LklhGbUxcs5FyRi3xcB4XHRCnPDpetiOMAA6BPWsMGvFxVDteRUekZqSAaTngtahlcyY Wv4UgFMLNafWndwuFbdHFAu/SG180YOePYDIMb1mi2a9qaddz5xgZBahipenpb9UQ2/8 yvkiUvvb3qIxafFlzcckkHxu1Dm4L3lR2zjZkUhB0avEV2paJB8BD9NkWedGEIPbDQ36 eBYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:ironport-sdr:ironport-sdr; bh=IFVPKYc+qyw4nGCFO95Ue3hVWvCgb2NukZA6oWJw3m0=; b=NTQYTsTJzHdCyPjO+ieS8pp+pM0+98BYAG2Em3ro60+GEOKA2YuStJfIb6Q+c/GO44 wICJZiZuo9gtUwMwXV+P/9i5O32AEXz0LofGn4CMSoabN5Mbq5KToE1/mxL/4m4lS/+I wppBd7IpCLcj5p83yg89bkNJgmRUYIzyoKGCvDsN2UeXyRB/1hF5w2+H3ylidx+EQeLQ n5ZwqC9MNY5qQYuGzAQaQgXXMJUJSgzuqeVrNnsReJUERXhQVrQOl7b6x7sJ/70HuLJI 2ybxUgfCOGhTet/VKrDhdqOkXEJcpxrYJNWRjeJQKkk5oeKxQENir8pj3pAR+mKD+qY0 HOrA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com. [68.232.137.180]) by gmr-mx.google.com with ESMTPS id x23si372711lfq.0.2019.11.08.01.25.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Nov 2019 01:25:07 -0800 (PST) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.137.180 as permitted sender) client-ip=68.232.137.180; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com IronPort-SDR: VaQdhzw96xWJv8BqRIbXsXLLiOIYukVlc35ZAfmWvp7glEpF3M3OJfbmdj8ug7YGFzPJIrOLhS LiD79uNrp3ZZ7xlF93gJIRbXz8oXY/8lhool5brHNlFiaE/d9eMwBnXMlap5WTomEEn/hgvtuD w8Tc+DXW3VAKuoSpIPeO3ZHX79CcF0MQm3mHl7oBrbwP5TL9Op6qSYGNVKhnNQelOSfMrfS88Z kneb2oZfaGAj5G+JJHX2jpFv2Ug1AQHJMeDWCUkhnmvNqV5v+Ct0TEZstFzhPgOFfeY+UexS2b yQQ= X-IronPort-AV: E=Sophos;i="5.68,280,1569312000"; d="scan'208";a="42992674" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 08 Nov 2019 01:25:05 -0800 IronPort-SDR: juvm0UxPkIWPNAJLjc57WBYzuHNBv3t/bInoBCiaWWrkh7J/wIdu0tlW9eax+QW1FKvqAHni9H Omd2OXPhZHBU4SCXRuqObvAJHJjGxK/J8y1BqdjfoyKOySkpbA4oAfJhpK1/pbIFEm31FWsLZx q2hV6MDryl3SpKEHyGpviiPw5UABYbO0PVACUQZscGGDo5GFvPUobT6d2T9xVpe0b52xTYcOnk NspuII103TltQQCEhwFw9Ln2rhlB4ktDXjaZVc3AqgdA+A118Fg/JYw00k7ubEKNgHYwKNQvA7 gFI= From: Cedric Hombourger To: CC: Cedric Hombourger Subject: [PATCH v4 - misc fixes 5/6] linux-custom: honor KERNEL_FILE setting Date: Fri, 8 Nov 2019 10:24:52 +0100 Message-ID: <1573205093-1379-1-git-send-email-Cedric_Hombourger@mentor.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573205003-1335-1-git-send-email-Cedric_Hombourger@mentor.com> References: <1573205003-1335-1-git-send-email-Cedric_Hombourger@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Cedric_Hombourger@mentor.com X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-TUID: 6hPtTyLM6ALM vmlinuz was hard-coded in the postinst script generated by the build-kernel.sh script. This really needs to be ${KERNEL_FILE} to support architectures where a vmlinux file is used instead (mipsel in particular). Rename the "vmlinuz" local variable to kernel_file so that it is clear it is derived from KERNEL_FILE. As we now have multiple recipes using KERNEL_FILE (image and kernel recipes), its default setting (vmlinuz) was moved to bitbake.conf (defaults to vmlinuz for all architectures but mipsel where it is set to vmlinux) Signed-off-by: Cedric Hombourger --- meta-isar/conf/machine/qemumipsel.conf | 2 -- meta/classes/image.bbclass | 1 - meta/conf/bitbake.conf | 2 ++ meta/recipes-kernel/linux/files/build-kernel.sh | 10 +++++----- meta/recipes-kernel/linux/linux-custom.inc | 1 + 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/meta-isar/conf/machine/qemumipsel.conf b/meta-isar/conf/machine/qemumipsel.conf index 6ca0777..18191fc 100644 --- a/meta-isar/conf/machine/qemumipsel.conf +++ b/meta-isar/conf/machine/qemumipsel.conf @@ -1,8 +1,6 @@ # This software is a part of ISAR. # Copyright (C) 2019 Mentor Graphics, a Siemens business -KERNEL_FILE ?= "vmlinux" - MACHINE_SERIAL ?= "ttyS0" BAUDRATE_TTY ?= "115200" diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 8384b71..7690bc5 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -16,7 +16,6 @@ IMAGE_INSTALL += "${@ ("linux-image-" + d.getVar("KERNEL_NAME", True)) if d.getV IMAGE_FULLNAME = "${PN}-${DISTRO}-${MACHINE}" # These variables are used by wic and start_vm -KERNEL_FILE ?= "vmlinuz" KERNEL_IMAGE ?= "${IMAGE_FULLNAME}-${KERNEL_FILE}" INITRD_IMAGE ?= "${IMAGE_FULLNAME}-initrd.img" diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 1f20c98..e45284c 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -56,6 +56,8 @@ BUILDCHROOT_HOST_DIR = "${DEPLOY_DIR_BUILDCHROOT}-host/${HOST_DISTRO}-${HOST_ARC BUILDCHROOT_TARGET_DIR = "${DEPLOY_DIR_BUILDCHROOT}-target/${DISTRO}-${DISTRO_ARCH}" SDKCHROOT_DIR = "${DEPLOY_DIR_SDKCHROOT}/${DISTRO}-${DISTRO_ARCH}" CACHE = "${TMPDIR}/cache" +KERNEL_FILE ?= "vmlinuz" +KERNEL_FILE_mipsel ?= "vmlinux" OVERRIDES = "${DISTRO_ARCH}:${MACHINE}:${DISTRO}:forcevariable" FILESOVERRIDES = "${DISTRO_ARCH}:${MACHINE}" diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh b/meta/recipes-kernel/linux/files/build-kernel.sh index 7b651af..b46cefa 100644 --- a/meta/recipes-kernel/linux/files/build-kernel.sh +++ b/meta/recipes-kernel/linux/files/build-kernel.sh @@ -90,7 +90,7 @@ if [ -f /lib/modules/${PV}/.fresh-install ]; then\\ else\\ change=upgrade\\ fi\\ -linux-update-symlinks \$change ${PV} /boot/vmlinuz-${PV}\\ +linux-update-symlinks \$change ${PV} /boot/${KERNEL_FILE}-${PV}\\ rm -f /lib/modules/${PV}/.fresh-install" # Add Debian-like link removal to postrm @@ -100,14 +100,14 @@ sed -i "${REPACK_LINUX_IMAGE_DIR}/DEBIAN/postrm" \ rm -f /lib/modules/${PV}/.fresh-install\\ \\ if [ \"\$1\" != upgrade ] && command -v linux-update-symlinks >/dev/null; then\\ - linux-update-symlinks remove ${PV} /boot/vmlinuz-${PV}\\ + linux-update-symlinks remove ${PV} /boot/${KERNEL_FILE}-${PV}\\ fi" # Make sure arm64 kernels are decompressed if [ "$target_arch" = "arm64" ]; then - vmlinuz="${REPACK_LINUX_IMAGE_DIR}/boot/vmlinuz-${PV}" - mv "$vmlinuz" "$vmlinuz.gz" - gunzip "$vmlinuz.gz" + kernel_file="${REPACK_LINUX_IMAGE_DIR}/boot/${KERNEL_FILE}-${PV}" + mv "${kernel_file}" "${kernel_file}.gz" + gunzip "${kernel_file}.gz" fi dpkg-gencontrol -crepack/debian/control \ diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc index dc2af1a..b597e25 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -72,6 +72,7 @@ dpkg_runbuild() { export KBUILD_DEPENDS="${KBUILD_DEPENDS}" export KERNEL_DEBIAN_DEPENDS="${KERNEL_DEBIAN_DEPENDS}" + export KERNEL_FILE="${KERNEL_FILE}" export KERNEL_HEADERS_DEBIAN_DEPENDS="${KERNEL_HEADERS_DEBIAN_DEPENDS}" sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} ${PP}/build-kernel.sh ${PP}/${PPS} ${DISTRO_ARCH} -- 2.20.1