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>,
	"Schmidt, Adriaan" <adriaan.schmidt@siemens.com>,
	"cedric.hombourger@siemens.com" <cedric.hombourger@siemens.com>,
	"Adler, Michael" <michael.adler@siemens.com>,
	"MOESSBAUER, FELIX JONATHAN" <felix.moessbauer@siemens.com>,
	"ubely@ilbers.de" <ubely@ilbers.de>
Subject: Re: [PATCH v3 3/5] dpkg: Allow overriding build and host parameters for sbuild and schroot
Date: Wed, 16 Aug 2023 14:27:00 +0000	[thread overview]
Message-ID: <c7c90f1bc09314ac6eb2f25ddb10222c4badcc95.camel@siemens.com> (raw)
In-Reply-To: <26c37ebf-5470-4c29-9e7a-89278375811f@siemens.com>

On Wed, 2023-08-16 at 15:55 +0200, Jan Kiszka wrote:
> On 16.08.23 14:14, Koch, Stefan (DI PA DCP R&D 3) wrote:
> > This functionality is initially used for custom linux builds using
> > the
> > "-compat" and "-native" multiarch bitbake targets to run additional
> > target or host specific builds for kbuild scripts and tools.
> 
> But why does the kernel need these extra params? Why wouldn't it be
> enough to add arch-specific profile settings for that package so that
> linux-headers-mykernel-native will compile the kernel only for the
> native headers and tools?
> 

Given a image for a arm64 target cross-built on a amd64 host:



- "bitbake linux" generates with the kbuild-patches:
linux-headers_arm64.deb
linux-image_arm64.deb
linux-kbuild-cross_arm64.deb e. g. containing scripts/fixdep as amd64

=> move to -cross to indicate ARCH mismatch

*Without* the kbuild-patches there are only 
linux-headers_arm64.deb e. g. containing scripts/fixdep as amd64 (!!)
linux-image_arm64.deb

=> *Existing* limitation that ARCH does not match



- "bitbake linux-kbuild-compat" generates (forcing non-cross QEMU
build):
linux-kbuild_arm64.deb e. g. containing scripts/fixdep as arm64

=> scripts utilities can *not* compiled in a cross way
=> this enforces the SBUILD_DIR override to force non-cross QEMU

Maybe, unsetting ISAR_CROSS_COMPILE for the -compat target makes the
SBUILD_DIR override needless. It has to be ensured, that no cross-
compile is used.

What do you think?



- "bitbake linux-native" generates:
linux-kbuild_amd64.deb e. g. containing scripts/fixdep as amd64

=> Optional, only for completeness to have a package matching the
correct ARCH

> Same question for patch 2, in fact. I'm still missing the big
> picture.
> 
> Jan
> 
> > 
> > Signed-off-by: Stefan Koch <stefan-koch@siemens.com>
> > ---
> >  meta/classes/dpkg-base.bbclass | 19 ++++++++++++++++++-
> >  meta/classes/dpkg.bbclass      |  2 +-
> >  2 files changed, 19 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-
> > base.bbclass
> > index 7b02f378..eaeb0e8b 100644
> > --- a/meta/classes/dpkg-base.bbclass
> > +++ b/meta/classes/dpkg-base.bbclass
> > @@ -208,7 +208,7 @@ dpkg_runbuild() {
> >  
> >  def isar_deb_build_profiles(d):
> >      deb_build_profiles = d.getVar('DEB_BUILD_PROFILES')
> > -    if d.getVar('ISAR_CROSS_COMPILE') == "1":
> > +    if d.getVar('ISAR_CROSS_COMPILE') == "1" and
> > d.getVar('ISAR_SKIP_CROSS_PROFILE') != "1":
> >          deb_build_profiles += ' cross'
> >      return deb_build_profiles.strip()
> >  
> > @@ -223,6 +223,23 @@ def isar_export_build_settings(d):
> >      os.environ['DEB_BUILD_PROFILES'] = isar_deb_build_profiles(d)
> >  
> >  python do_dpkg_build() {
> > +    schroot_dir_override = d.getVar('SCHROOT_DIR_OVERRIDE', True)
> > +    sbuild_build_override = d.getVar('SBUILD_BUILD_OVERRIDE',
> > True)
> > +    sbuild_host_override = d.getVar('SBUILD_HOST_OVERRIDE', True)
> > +
> > +    if schroot_dir_override:
> > +        d.setVar('SCHROOT_DIR', schroot_dir_override)
> > +
> > +    if sbuild_build_override:
> > +        d.setVar('SBUILD_BUILD', sbuild_build_override)
> > +    else:
> > +        d.setVar('SBUILD_BUILD', d.getVar('BUILD_HOST_ARCH',
> > True))
> > +
> > +    if sbuild_host_override:
> > +        d.setVar('SBUILD_HOST', sbuild_host_override)
> > +    else:
> > +        d.setVar('SBUILD_HOST', d.getVar('PACKAGE_ARCH', True))
> > +
> >      bb.build.exec_func('schroot_create_configs', d)
> >      try:
> >          bb.build.exec_func("dpkg_runbuild", d)
> > diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
> > index c596adbf..7d659741 100644
> > --- a/meta/classes/dpkg.bbclass
> > +++ b/meta/classes/dpkg.bbclass
> > @@ -102,7 +102,7 @@ dpkg_runbuild() {
> >      DSC_FILE=$(find ${WORKDIR} -name "${DEB_SOURCE_NAME}*.dsc" -
> > print)
> >  
> >      sbuild -A -n -c ${SBUILD_CHROOT} --extra-
> > repository="${ISAR_APT_REPO}" \
> > -        --host=${PACKAGE_ARCH} --build=${BUILD_HOST_ARCH}
> > ${profiles} \
> > +        --host=${SBUILD_HOST} --build=${SBUILD_BUILD} ${profiles}
> > \
> >          --no-run-lintian --no-run-piuparts --no-run-autopkgtest --
> > resolve-alternatives \
> >          --bd-uninstallable-explainer=apt \
> >          --no-apt-update \
> 

-- 
Stefan Koch
Siemens AG
www.siemens.com

  reply	other threads:[~2023-08-16 14:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16 12:14 [PATCH v3 0/5] linux-custom: Split up binaries from kernel headers to kbuild packages Koch, Stefan
2023-08-16 12:14 ` [PATCH v3 1/5] linux-custom: Split up binaries from kernel headers to kbuild package Koch, Stefan
2023-08-16 12:14 ` [PATCH v3 2/5] sbuild: Support overriding configured schroot dir Koch, Stefan
2023-08-16 12:14 ` [PATCH v3 3/5] dpkg: Allow overriding build and host parameters for sbuild and schroot Koch, Stefan
2023-08-16 13:55   ` Jan Kiszka
2023-08-16 14:27     ` Koch, Stefan [this message]
2023-08-16 14:32       ` Jan Kiszka
2023-08-17 12:25         ` Koch, Stefan
2023-08-16 12:14 ` [PATCH v3 4/5] linux-custom: Provide host and target specific kernel kbuild packages Koch, Stefan
2023-08-16 12:14 ` [PATCH v3 5/5] docs: Update custom_kernel docs for split up of kernel scripts and tools Koch, Stefan
2023-08-16 13:46   ` Jan Kiszka
2023-08-16 14:25     ` Koch, Stefan
2023-08-16 14:27       ` Jan Kiszka
2023-08-18 11:03         ` 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=c7c90f1bc09314ac6eb2f25ddb10222c4badcc95.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