[PATCH v2 0/3] linux-kernel cross fixes and cleanups

0 views
Skip to first unread message

Jan Kiszka

unread,
9:33 AM (3 hours ago) 9:33 AM
to isar-users, Tobias Schaffner, Felix Moessbauer, Anton Mikanovich, Stefan Koch
Changes in v2:
- fix regression of patch 1, keeping :cross-pkgs
- add patch 2 to improve :cross-pkgs naming

Jan

Jan Kiszka (3):
linux-kernel: Fix building of linux-libc-dev-*-cross packages
linux-kernel: Rename cross-pkgs override to cross-profile-native
linux-kernel: Fix recipe provides for linux-libc-dev targets

meta/classes-recipe/linux-kernel.bbclass | 29 +++++++++++++-----------
1 file changed, 16 insertions(+), 13 deletions(-)

--
2.51.0

Jan Kiszka

unread,
9:33 AM (3 hours ago) 9:33 AM
to isar-users, Tobias Schaffner, Felix Moessbauer, Anton Mikanovich, Stefan Koch
From: Jan Kiszka <jan.k...@siemens.com>

This should make the meaning of the override clearer.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---
meta/classes-recipe/linux-kernel.bbclass | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/meta/classes-recipe/linux-kernel.bbclass b/meta/classes-recipe/linux-kernel.bbclass
index e129527e..c8e6773f 100644
--- a/meta/classes-recipe/linux-kernel.bbclass
+++ b/meta/classes-recipe/linux-kernel.bbclass
@@ -110,12 +110,11 @@ KERNEL_NAME_PROVIDED ?= "${@ d.getVar('BPN').partition('linux-')[2]}"
# Determine cross-profile override
python() {
if d.getVar("DISTRO_ARCH") != d.getVar("HOST_ARCH") and bb.utils.to_boolean(d.getVar("ISAR_CROSS_COMPILE")):
- if "class-native" not in d.getVar("OVERRIDES").split(":"):
- # cross compiling
- d.appendVar("OVERRIDES", ":cross-profile")
- else:
+ if "class-native" in d.getVar("OVERRIDES").split(":"):
# generating -cross packages (in HOST_ARCH) from a -native variant
- d.appendVar("OVERRIDES", ":cross-pkgs")
+ d.appendVar("OVERRIDES", ":cross-profile-native")
+ else:
+ d.appendVar("OVERRIDES", ":cross-profile")
}

# Default profiles and provides
@@ -129,9 +128,9 @@ BBCLASSEXTEND:append:cross-profile = " kbuildtarget"
# with the default variant of the recipe
BUILD_PROFILES:cross-profile = "pkg.${BPN}.kernel pkg.${BPN}.cross"

-# -native: kbuild package for host
+# -native: kbuild package for host, in cross variant if needed
BUILD_PROFILES:class-native = "pkg.${BPN}.kbuild"
-BUILD_PROFILES:append:cross-pkgs = " pkg.${BPN}.cross"
+BUILD_PROFILES:append:cross-profile-native = " pkg.${BPN}.cross"
RECIPE_PROVIDES:class-native = " \
linux-headers-${KERNEL_NAME_PROVIDED} \
linux-kbuild-${KERNEL_NAME_PROVIDED}"
--
2.51.0

Jan Kiszka

unread,
9:33 AM (3 hours ago) 9:33 AM
to isar-users, Tobias Schaffner, Felix Moessbauer, Anton Mikanovich, Stefan Koch
From: Jan Kiszka <jan.k...@siemens.com>

Avoid the the kbuildtarget also provides linux-libc-dev*. Furthermore,
only provide the cross variant when it is actually built.

While at it, drop the unused :nolibcdev override to avoid confusion.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---
meta/classes-recipe/linux-kernel.bbclass | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/classes-recipe/linux-kernel.bbclass b/meta/classes-recipe/linux-kernel.bbclass
index c8e6773f..6e383408 100644
--- a/meta/classes-recipe/linux-kernel.bbclass
+++ b/meta/classes-recipe/linux-kernel.bbclass
@@ -145,6 +145,9 @@ BUILD_PROFILES:class-kbuildtarget = "pkg.${BPN}.kbuild"
RECIPE_PROVIDES:class-kbuildtarget = " \
linux-headers-${KERNEL_NAME_PROVIDED} \
linux-kbuild-${KERNEL_NAME_PROVIDED}"
+RECIPE_PROVIDES:remove:class-kbuildtarget = " \
+ linux-libc-dev \
+ linux-libc-dev-${DISTRO_ARCH}-cross"
# Using DEPENDS instead of RDEPENDS to ensure creation of kernel including
# pregenerated kernel config before target specific linux-kbuild package build
DEPENDS:class-kbuildtarget = "${BPN}"
@@ -161,12 +164,12 @@ RECIPE_PROVIDES = " \
"

# Provide linux-libc-dev packages unless nolibcdev profile used
-OVERRIDES:append = ":${@ bb.utils.contains('DEB_BUILD_PROFILES', 'pkg.{}.nolibcdev'.format(d.getVar('BPN')), 'nolibcdev', 'libcdev', d)}"
+OVERRIDES:append = ":${@ bb.utils.contains('DEB_BUILD_PROFILES', 'pkg.{}.nolibcdev'.format(d.getVar('BPN')), '', 'libcdev', d)}"

RECIPE_PROVIDES:append:libcdev = " \
- linux-libc-dev \
- linux-libc-dev-${DISTRO_ARCH}-cross \
-"
+ linux-libc-dev"
+RECIPE_PROVIDES:append:libcdev:cross-profile = " \
+ linux-libc-dev-${DISTRO_ARCH}-cross"

# When cross-profile is active:
# kbuild package is provided by -native or -kbuildtarget variant. Also headers
--
2.51.0

Jan Kiszka

unread,
9:33 AM (3 hours ago) 9:33 AM
to isar-users, Tobias Schaffner, Felix Moessbauer, Anton Mikanovich, Stefan Koch
From: Jan Kiszka <jan.k...@siemens.com>

The cross variant of linux-libc-dev is always built along with the
kernel, just like the native variant. Ensure this by additionally
enabling pkg.${BPN}.cross when :cross-profile is active.

Fixes: afba99fe6aeb ("linux-custom: fix name collision on cross profile")
Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---
meta/classes-recipe/linux-kernel.bbclass | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes-recipe/linux-kernel.bbclass b/meta/classes-recipe/linux-kernel.bbclass
index 8f38a617..e129527e 100644
--- a/meta/classes-recipe/linux-kernel.bbclass
+++ b/meta/classes-recipe/linux-kernel.bbclass
@@ -125,8 +125,9 @@ BUILD_PROFILES = "pkg.${BPN}.kernel pkg.${BPN}.kbuild"
BBCLASSEXTEND:append:cross-profile = " kbuildtarget"

# When cross-profile is active:
-# build only kernel (including config) with the default variant of the recipe
-BUILD_PROFILES:cross-profile = "pkg.${BPN}.kernel"
+# Build kernel (including config) cross packages (linux-libc-dev-*-cross)
+# with the default variant of the recipe
+BUILD_PROFILES:cross-profile = "pkg.${BPN}.kernel pkg.${BPN}.cross"

# -native: kbuild package for host
BUILD_PROFILES:class-native = "pkg.${BPN}.kbuild"
--
2.51.0

Reply all
Reply to author
Forward
0 new messages