public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Stefan Koch <stefan-koch@siemens.com>, isar-users@googlegroups.com
Cc: christian.storm@siemens.com, michael.adler@siemens.com,
	simon.sudler@siemens.com, cedric.hombourger@siemens.com,
	felix.moessbauer@siemens.com, ubely@ilbers.de,
	adriaan.schmidt@siemens.com
Subject: Re: [PATCH v6 3/5] linux-custom: Provide target and host specific kernel kbuild packages
Date: Sun, 5 May 2024 19:16:12 +0200	[thread overview]
Message-ID: <3426b948-a279-4665-9dd8-bd33e3b40bf4@siemens.com> (raw)
In-Reply-To: <20240214101025.2123540-4-stefan-koch@siemens.com>

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_extra.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,, 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}
│ │  
│ │  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). 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

-- 
Siemens AG, Technology
Linux Expert Center


  reply	other threads:[~2024-05-05 17:16 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 [this message]
2024-05-06 10:07     ` Koch, Stefan
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=3426b948-a279-4665-9dd8-bd33e3b40bf4@siemens.com \
    --to=jan.kiszka@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=michael.adler@siemens.com \
    --cc=simon.sudler@siemens.com \
    --cc=stefan-koch@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