From: Cedric Hombourger <Cedric_Hombourger@mentor.com>
To: <isar-users@googlegroups.com>
Cc: Cedric Hombourger <Cedric_Hombourger@mentor.com>
Subject: [PATCH v4 - misc fixes 5/6] linux-custom: honor KERNEL_FILE setting
Date: Fri, 8 Nov 2019 10:24:52 +0100 [thread overview]
Message-ID: <1573205093-1379-1-git-send-email-Cedric_Hombourger@mentor.com> (raw)
In-Reply-To: <1573205003-1335-1-git-send-email-Cedric_Hombourger@mentor.com>
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 <Cedric_Hombourger@mentor.com>
---
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
next prev parent reply other threads:[~2019-11-08 9:25 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 9:34 [PATCH 0/4] miscellaneous (minor) fixes Cedric Hombourger
2019-10-21 9:34 ` [PATCH 1/4] wic-img: do not leave temporary files behind Cedric Hombourger
2019-10-21 9:34 ` [PATCH 2/4] isar-bootstrap: wipe out previously created rootfs with --one-file-system Cedric Hombourger
2019-10-21 9:34 ` [PATCH 3/4] base-apt-helper: fixed a few typos found in comments Cedric Hombourger
2019-10-21 9:34 ` [PATCH 4/4] patch: suffix patch files copied to .applied_patches with "~" Cedric Hombourger
2019-10-21 11:26 ` Henning Schild
2019-10-21 11:36 ` Cedric Hombourger
2019-10-21 12:43 ` Henning Schild
2019-10-21 12:53 ` Cedric Hombourger
2019-10-21 15:08 ` [PATCH v2 0/5] miscellaneous (minor) fixes Cedric Hombourger
2019-10-21 15:08 ` [PATCH v2 1/5] wic-img: do not leave temporary files behind Cedric Hombourger
2019-10-21 15:08 ` [PATCH v2 2/5] isar-bootstrap: wipe out previously created rootfs with --one-file-system Cedric Hombourger
2019-10-21 15:08 ` [PATCH v2 3/5] base-apt-helper: fixed a few typos found in comments Cedric Hombourger
2019-10-21 15:08 ` [PATCH v2 4/5] patch: suffix patch files copied to .applied_patches with "~" Cedric Hombourger
2019-10-21 15:10 ` [PATCH v2 5/5] hello: add a sample patch to exercise patch.bbclass against dpkg recipes Cedric Hombourger
2019-10-25 17:15 ` [PATCH 4/4] patch: suffix patch files copied to .applied_patches with "~" Jan Kiszka
2019-10-25 17:58 ` Cedric Hombourger
2019-11-05 12:52 ` [PATCH v3 0/6] miscellaneous (minor) fixes Cedric Hombourger
2019-11-05 12:53 ` [PATCH v3 1/6] wic-img: do not leave temporary files behind Cedric Hombourger
2019-11-05 12:53 ` [PATCH v3 2/6] isar-bootstrap: wipe out previously created rootfs with --one-file-system Cedric Hombourger
2019-11-05 12:53 ` [PATCH v3 3/6] base-apt-helper: fixed a few typos found in comments Cedric Hombourger
2019-11-05 12:53 ` [PATCH v3 4/6] ci_build.sh: delay "set -x" for a clean --help output Cedric Hombourger
2019-11-05 12:53 ` [PATCH v3 5/6] linux-custom: honor KERNEL_FILE setting Cedric Hombourger
2019-11-05 12:53 ` [PATCH v3 6/6] bitbake.conf: set name of the qemu-static binary to use for mipsel Cedric Hombourger
2019-11-08 9:23 ` [PATCH v4 - misc fixes 0/6] miscellaneous (minor) fixes Cedric Hombourger
2019-11-08 9:23 ` [PATCH v4 - misc fixes 1/6] wic-img: do not leave temporary files behind Cedric Hombourger
2019-11-15 13:38 ` Jan Kiszka
2019-11-15 13:42 ` Cedric Hombourger
2019-11-15 17:00 ` [PATCH v5 0/6] miscellaneous (minor) fixes Cedric Hombourger
2019-11-15 17:00 ` [PATCH v5 1/6] wic-img: do not leave temporary files behind Cedric Hombourger
2019-11-15 17:00 ` [PATCH v5 2/6] isar-bootstrap: wipe out previously created rootfs with --one-file-system Cedric Hombourger
2019-11-15 17:00 ` [PATCH v5 3/6] base-apt-helper: fixed a few typos found in comments Cedric Hombourger
2019-11-15 17:00 ` [PATCH v5 4/6] ci_build.sh: delay "set -x" for a clean --help output Cedric Hombourger
2019-11-15 17:00 ` [PATCH v5 5/6] linux-custom: honor KERNEL_FILE setting Cedric Hombourger
2019-11-15 17:00 ` [PATCH v5 6/6] bitbake.conf: set name of the qemu-static binary to use for mipsel Cedric Hombourger
2019-11-20 12:39 ` [PATCH v5 0/6] miscellaneous (minor) fixes Baurzhan Ismagulov
2019-11-08 9:23 ` [PATCH v4 - misc fixes 2/6] isar-bootstrap: wipe out previously created rootfs with --one-file-system Cedric Hombourger
2019-11-08 9:23 ` [PATCH v4 - misc fixes 3/6] base-apt-helper: fixed a few typos found in comments Cedric Hombourger
2019-11-08 9:23 ` [PATCH v4 - misc fixes 4/6] ci_build.sh: delay "set -x" for a clean --help output Cedric Hombourger
2019-11-08 9:24 ` Cedric Hombourger [this message]
2019-11-08 9:24 ` [PATCH v4 - misc fixes 6/6] bitbake.conf: set name of the qemu-static binary to use for mipsel Cedric Hombourger
2019-11-12 19:20 ` [PATCH v4 - misc fixes 0/6] miscellaneous (minor) fixes chombourger
2019-11-14 17:01 ` Baurzhan Ismagulov
2019-11-15 16:59 ` chombourger
2019-11-19 16:56 ` Baurzhan Ismagulov
2019-11-15 13:34 ` chombourger
2019-11-15 13:39 ` Baurzhan Ismagulov
2019-11-15 13:39 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1573205093-1379-1-git-send-email-Cedric_Hombourger@mentor.com \
--to=cedric_hombourger@mentor.com \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox