public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Koch, Stefan" <stefan-koch@siemens.com>
To: "isar-users@googlegroups.com" <isar-users@googlegroups.com>,
	"Kiszka, Jan" <jan.kiszka@siemens.com>
Cc: "Sudler, Simon" <simon.sudler@siemens.com>,
	"Storm, Christian" <christian.storm@siemens.com>,
	"ubely@ilbers.de" <ubely@ilbers.de>,
	"cedric.hombourger@siemens.com" <cedric.hombourger@siemens.com>,
	"Adler, Michael" <michael.adler@siemens.com>,
	"MOESSBAUER, Felix" <felix.moessbauer@siemens.com>,
	"Schmidt, Adriaan" <adriaan.schmidt@siemens.com>
Subject: Re: [PATCH v6 3/5] linux-custom: Provide target and host specific kernel kbuild packages
Date: Mon, 6 May 2024 10:07:14 +0000	[thread overview]
Message-ID: <28ed81d9f1044b4eff6e6fd52a09ef46124a269e.camel@siemens.com> (raw)
In-Reply-To: <3426b948-a279-4665-9dd8-bd33e3b40bf4@siemens.com>

On Sun, 2024-05-05 at 19:16 +0200, Jan Kiszka wrote:
> On 14.02.24 11:10, Stefan Koch wrote:
> > When using a cross build this patch does introduce
> > target and host specific kernel kbuild packages that
> > ship the "scripts" and "tools" binaries.
> >
> > The "-kbuildtarget" and "-native" multiarch bitbake targets are
> > useable to run
> > additional target or host specific builds for kbuild scripts and
> > tools.
> >
> > Using the "-kbuildtarget" bitbake target enables the build of
> > a target specific kbuild package at cross builds.
> > So using "linux-kbuild" provides the package for the target
> > platform.
> >
> > Using the "-native" bitbake target enables the build of
> > a host specific kbuild package at cross builds.
> > When cross building using "linux-kbuild-native"
> > provides the package for the host platform.
> >
> > Only the "host" specific package is built automatically at cross
> > builds.
> >
> > This solves this from doc/custom_kernel.inc:
> > - The kernel headers package has not supported both native
> >   and cross compilation of kernel modules when itself was cross
> > built
> > - Future roadmap: Generate kernel headers package for both host
> >   and target when using a cross build
> >
> > Signed-off-by: Stefan Koch <stefan-koch@siemens.com>
>
> This causes the kernel source packages being built twice, and the
> result
> is not even identical:
>
> ├── linux-starfive_6.6-visionfive2+r0.tar
> │ ├── file list
> │ │ @@ -28357,15 +28357,15 @@
> │ │  -rw-r--r--   0        0        0     3843 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/crypto/xor.c
> │ │  -rw-r--r--   0        0        0    12021 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/crypto/xts.c
> │ │  -rw-r--r--   0        0        0     2445 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/crypto/xxhash_generic.c
> │ │  -rw-r--r--   0        0        0     5090 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/crypto/zstd.c
> │ │  drwxr-xr-x   0        0        0        0 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/
> │ │  -rw-r--r--   0        0        0      162 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/changelog
> │ │  -rw-r--r--   0        0        0        3 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/compat
> │ │ --rw-r--r--   0        0        0     2694 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/control
> │ │ +-rw-r--r--   0        0        0     2664 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/control
> │ │  drwxr-xr-x   0        0        0        0 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/fragments/
> │ │  -rw-r--r--   0        0        0      155 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/fragments/starfive2_e
> xtra.cfg
> │ │  drwxr-xr-x   0        0        0        0 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/isar/
> │ │  -rw-r--r--   0        0        0     1875 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/isar/build
> │ │  -rw-r--r--   0        0        0      355 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/isar/clean
> │ │  -rw-r--r--   0        0        0     1830 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/isar/common
> │ │  -rw-r--r--   0        0        0      587 2023-11-21
> 02:56:42.000000 linux-
> 9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/isar/configure
> │ ├── linux-9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/control
> │ │ @@ -12,15 +12,15 @@
> │ │  Description: starfive Linux kernel, version @KR@
> │ │   This package contains the Linux kernel, modules and
> corresponding other
> │ │   files, version: @KR@.
> │ │
> │ │  Package: linux-headers-starfive
> │ │  Build-Profiles: <kernel>
> │ │  Architecture: any
> │ │ -Depends: libc6,                                   libssl3,,
> linux-kbuild-starfive:amd64 | linux-kbuild-starfive, ${perl:Depends},
> ${shlib:Depends}
> │ │ +Depends: libc6,                                   libssl3,,
This comes from here:
meta/recipes-kernel/linux/linux-custom.inc:114-115

# Select correct kbuild package for isar cross-build
HEADERS_DEPENDS:cross-profile = ", linux-kbuild-
${KERNEL_NAME_PROVIDED}:${HOST_ARCH} | linux-kbuild-
${KERNEL_NAME_PROVIDED}"
> linux-kbuild-starfive, ${perl:Depends}, ${shlib:Depends}
> │ │  Description: starfive Linux kernel headers for @KR@
> │ │   This package provides kernel header files for @KR@ on riscv64
> │ │   .
> │ │   This is useful for people who need to build external modules
> │ │
> │ │  Package: linux-libc-dev
> │ │  Build-Profiles: <!nolibcdev kernel>
> │ ├── linux-9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/linux-
> image-starfive.postinst
> │ │ @@ -2,15 +2,15 @@
> │ │  # based on
> https://salsa.debian.org/kernel-team/linux/blob/479cb120ecb2b3f2c4d929a7b57860248d6f79bd/debian/templates/image.postinst.in
> │ │  # SPDX-License-Identifier: GPL-2.0-only
> │ │
> │ │  # Tell initramfs builder whether it's wanted
> │ │  export INITRD=Yes
> │ │
> │ │  version=@KR@
> │ │ -image_path=/boot/vmlinux-${version}
> │ │ +image_path=/boot/vmlinuz-${version}
This comes from here:
meta/recipes-kernel/linux/files/debian/isar/install.tmpl:25-29

case "${ARCH}" in
    mips|powerpc|riscv|arm64) kimage_path="boot/vmlinux-${krel}"    ;;
                          um) kimage_path="usr/bin/vmlinux-${krel}" ;;
                           *) kimage_path="boot/vmlinuz-${krel}"    ;;
esac
> │ │
> │ │  if [ "$1" != configure ]; then
> │ │      exit 0
> │ │  fi
> │ │
> │ │  depmod $version
> │ ├── linux-9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/linux-
> image-starfive.postrm
> │ │ @@ -2,15 +2,15 @@
> │ │  # based on
> https://salsa.debian.org/kernel-team/linux/blob/479cb120ecb2b3f2c4d929a7b57860248d6f79bd/debian/templates/image.postrm.in
> │ │  # SPDX-License-Identifier: GPL-2.0-only
> │ │
> │ │  # Tell initramfs builder whether it's wanted
> │ │  export INITRD=Yes
> │ │
> │ │  version=@KR@
> │ │ -image_path=/boot/vmlinux-${version}
> │ │ +image_path=/boot/vmlinuz-${version}
> │ │
> │ │  rm -f /lib/modules/$version/.fresh-install
> │ │
> │ │  if [ "$1" != upgrade ] && command -v linux-update-symlinks
> >/dev/null; then
> │ │      linux-update-symlinks remove $version $image_path
> │ │  fi
> │ ├── linux-9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/linux-
> image-starfive.preinst
> │ │ @@ -2,15 +2,15 @@
> │ │  # based on
> https://salsa.debian.org/kernel-team/linux/blob/479cb120ecb2b3f2c4d929a7b57860248d6f79bd/debian/templates/image.preinst.in
> │ │  # SPDX-License-Identifier: GPL-2.0-only
> │ │
> │ │  # Tell initramfs builder whether it's wanted
> │ │  export INITRD=Yes
> │ │
> │ │  version=@KR@
> │ │ -image_path=/boot/vmlinux-${version}
> │ │ +image_path=/boot/vmlinuz-${version}
> │ │
> │ │  if [ "$1" = abort-upgrade ]; then
> │ │      exit 0
> │ │  fi
> │ │
> │ │  if [ "$1" = install ]; then
> │ │      # Create a flag file for postinst
> │ ├── linux-9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4/debian/linux-
> image-starfive.prerm
> │ │ @@ -2,15 +2,15 @@
> │ │  # based on
> https://salsa.debian.org/kernel-team/linux/blob/479cb120ecb2b3f2c4d929a7b57860248d6f79bd/debian/templates/image.prerm.in
> │ │  # SPDX-License-Identifier: GPL-2.0-only
> │ │
> │ │  # Tell initramfs builder whether it's wanted
> │ │  export INITRD=Yes
> │ │
> │ │  version=@KR@
> │ │ -image_path=/boot/vmlinux-${version}
> │ │ +image_path=/boot/vmlinuz-${version}
> │ │
> │ │  if [ "$1" != remove ]; then
> │ │      exit 0
> │ │  fi
> │ │
> │ │  linux-check-removal $version
>
>
> Running the source build twice is not just a problem of the kernel
> recipe (the delta surely is and should be understood as well).
See beyond for hints about the delta
> But the
> kernel package is fairly large, so this at least wastes time. And if
> anyone would actually pull the sources from isar-apt during the
> build,
> we had an ugly race.
>
> I have an (apparantely) working patch here that builds the sources
> only
> in the base package. Will share later.
>
> Jan
>

--
Stefan Koch
Siemens AG
http://www.siemens.com/

  reply	other threads:[~2024-05-06 10:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14 10:10 [PATCH v6 0/5] linux-custom: Split up binaries from kernel headers to kbuild package Stefan Koch
2024-02-14 10:10 ` [PATCH v6 1/5] linux-custom: Set PROVIDES variable using bitbake overrides Stefan Koch
2024-02-14 10:10 ` [PATCH v6 2/5] linux-custom: Split up binaries from kernel headers to kbuild package Stefan Koch
2024-02-14 10:10 ` [PATCH v6 3/5] linux-custom: Provide target and host specific kernel kbuild packages Stefan Koch
2024-05-05 17:16   ` Jan Kiszka
2024-05-06 10:07     ` Koch, Stefan [this message]
2024-05-06 10:46       ` Jan Kiszka
2024-05-06  6:22   ` Jan Kiszka
2024-07-04  6:12   ` Anton Mikanovich
2024-07-04 12:44     ` 'Koch, Stefan' via isar-users
2024-07-04 13:02       ` 'cedric.hombourger@siemens.com' via isar-users
2024-07-04 13:19         ` 'Koch, Stefan' via isar-users
2024-02-14 10:10 ` [PATCH v6 4/5] linux-module: Support emulated module build with cross-compiled kernel Stefan Koch
2024-02-14 10:10 ` [PATCH v6 5/5] docs: Update custom_kernel docs for split up of kernel scripts and tools Stefan Koch
2024-02-16  7:42 ` [PATCH v6 0/5] linux-custom: Split up binaries from kernel headers to kbuild package MOESSBAUER, Felix
2024-04-15 12:47 ` Uladzimir Bely
2024-04-17  9:29   ` Koch, Stefan
2024-04-23 19:22 ` Uladzimir Bely
2024-04-30 13:10   ` Koch, Stefan

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=28ed81d9f1044b4eff6e6fd52a09ef46124a269e.camel@siemens.com \
    --to=stefan-koch@siemens.com \
    --cc=adriaan.schmidt@siemens.com \
    --cc=cedric.hombourger@siemens.com \
    --cc=christian.storm@siemens.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=michael.adler@siemens.com \
    --cc=simon.sudler@siemens.com \
    --cc=ubely@ilbers.de \
    /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