From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7376673206058352640 X-Forwarded-Encrypted: i=2; AJvYcCVr6A3D5AjZM01UakDs2xQAR/nrUZCNy5seobQFJaT4KlKzyD4Z4B5zCWab/xym3au/aqEhI2tflFvoTpi+IyxDkUCMHrAG7S0mcTE= X-Received: by 2002:a2e:904c:0:b0:2eb:eb0f:a822 with SMTP id 38308e7fff4ca-2ec0e5d0c7emr46466621fa.24.1718601920835; Sun, 16 Jun 2024 22:25:20 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:9791:0:b0:2ec:21cc:461e with SMTP id 38308e7fff4ca-2ec21cc4902ls5712401fa.2.-pod-prod-04-eu; Sun, 16 Jun 2024 22:25:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVBK4urVeBK4Fn4tqJpLhIDp/lArT1xcKfsaEhKfdrUZkbUy2YT2Ohisr+oHWC502OXElWRl46BbdvNgEHFuABaT0SwuLf/TwkNqt8= X-Google-Smtp-Source: AGHT+IGS0Kf8QPgepgN8rDzWjka2f59oG/YJlmV2Kcc6w2Kcv3LsYxe4WicM0jHaFST31YwAb2K8 X-Received: by 2002:a05:6512:3e25:b0:52c:aa0f:622d with SMTP id 2adb3069b0e04-52caa0f62ddmr6704770e87.30.1718601918361; Sun, 16 Jun 2024 22:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718601918; cv=none; d=google.com; s=arc-20160816; b=hpAY2SmAOVAQlgH3gXk1QCXIhvIlLvYIi0e84fiI4SwXsolfUYCkHBNDaO5t/VVn/e MpLg2y4iAVaGt6d+B//xsig6fay1Ln5+gOaoZmIETaltT42lxXbPMaENpdAeSrXZIxLE UQW21morP6kq8vWW2HECTJ6jatR9dc3x9TGXcrLXLotjHxAQJg0TNNZRh8N6bCUd7/OZ LV+Sb9DePsIsr1VpQ/6JvAlF6Ku9+9F/SxWOTMyLOVSUSgpdsSHkGBrJCU85xhLxF0N7 jld0+LoSBRTQQXQXn657zMyMHNLLfKkMbWWlkh2ZPVsUbm+/g1DbeBhrNWo/2/3lYd0z FxPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id; bh=IUffDH1hfDkj4U/LDMmTyre2qYE9O66bn4TOxyIgHPo=; fh=YwT1SHZnZymu6V3YPNGSt6GSJLMvkgq3LRIHcCQ77UQ=; b=eAd9FOHfIeSUm3yzmj7qxXHvGB/yB2+HvlDO8sRKE2S7PAknUGY8zTfYAufjNf1GGD HYTVpnP5uTW85HLmHXgJ66YXVc8pKsIODdbPTvNLY1jZJcd32QtjBorrBK181q6L9gs8 dzfkt8V7XirbLp0QA3NTrahCJvGzO84aB8g41QiAH27wPLAEPyS14G75Q5p/HH4Rt7XA R/y60ISvn5yOxRj6u2jjqjG68KjM6aVfnDSdCxog+iv+3ArutkjRRKCu4tTXUrOk59UZ Fvh8/lUWNUA9I6TgAsKtcK6X/cYfDhd+41kRaMPFcd1liBidpLLZvxcSc7JzvrnfgpUq wD2A==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 2adb3069b0e04-52ca2878979si180513e87.9.2024.06.16.22.25.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Jun 2024 22:25:18 -0700 (PDT) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from [127.0.0.1] (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 45H5PCiO013690 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jun 2024 07:25:16 +0200 Message-ID: Subject: Re: [PATCH v3] linux-custom: Speedup build of target specific linux-kbuild package From: Uladzimir Bely To: Stefan Koch , isar-users@googlegroups.com Date: Mon, 17 Jun 2024 08:25:12 +0300 In-Reply-To: <20240610154422.2013777-1-stefan-koch@siemens.com> References: <20240610154422.2013777-1-stefan-koch@siemens.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.2 (by Flathub.org) MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: R3a+wbdzbv5y On Mon, 2024-06-10 at 17:44 +0200, Stefan Koch wrote: > Avoids time expensive QEMU-emulated merging of kernel config by using > the existing kernel config for the target specific linux-kbuild. > The host specific linux-kbuild package > uses the existing kernel config, too. >=20 > Using DEPENDS instead of RDEPENDS ensures creation of > kernel (including config) before build of > target and host specific linux-kbuild packages. >=20 > Signed-off-by: Stefan Koch > --- > =C2=A0.../linux/files/debian/isar/configure.tmpl=C2=A0=C2=A0=C2=A0 | 22 += ++++++++++++++-- > -- > =C2=A0meta/recipes-kernel/linux/linux-custom.inc=C2=A0=C2=A0=C2=A0 | 11 += ++++++--- > =C2=A02 files changed, 26 insertions(+), 7 deletions(-) >=20 > diff --git a/meta/recipes- > kernel/linux/files/debian/isar/configure.tmpl b/meta/recipes- > kernel/linux/files/debian/isar/configure.tmpl > index 389c9a85..73f554ed 100644 > --- a/meta/recipes-kernel/linux/files/debian/isar/configure.tmpl > +++ b/meta/recipes-kernel/linux/files/debian/isar/configure.tmpl > @@ -10,10 +10,24 @@ do_configure() { > =C2=A0=C2=A0=C2=A0=C2=A0 # Trace what we do here > =C2=A0=C2=A0=C2=A0=C2=A0 set -x > =C2=A0 > -=C2=A0=C2=A0=C2=A0 # Process kernel config target and fragments > -=C2=A0=C2=A0=C2=A0 ${MAKE} O=3D${KERNEL_BUILD_DIR} ${KERNEL_CONFIG_TARGE= T} > -=C2=A0=C2=A0=C2=A0 ./scripts/kconfig/merge_config.sh -O ${KERNEL_BUILD_D= IR}/ \ > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ${KERNEL_BUILD_DIR}/.config $= {KERNEL_CONFIG_FRAGMENTS} > +=C2=A0=C2=A0=C2=A0 kernelconfig=3D"$(find /boot -maxdepth 1 -name "confi= g-${PV}*" - > print -quit)" > +=C2=A0=C2=A0=C2=A0 if echo "${DEB_BUILD_PROFILES}" | grep -q "kbuild" &&= \ > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ! echo "${DEB_BUILD_PROFILES}" | gr= ep -q "kernel" && \ > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [ -e "${kernelconfig}" ]; then > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # Prefer existing kernel conf= ig > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # So, very expensive QEMU-emu= lated merge_config.sh > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # can be skipped for target s= pecific linux-kbuild package > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # The host specific linux-kbu= ild package > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # uses the existing kernel co= nfig, too. > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mkdir -p ${KERNEL_BUILD_DIR} > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cp "${kernelconfig}" ${KERNEL= _BUILD_DIR}/.config > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ${MAKE} O=3D${KERNEL_BUILD_DI= R} olddefconfig > +=C2=A0=C2=A0=C2=A0 else > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # Process kernel config targe= t and fragments > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ${MAKE} O=3D${KERNEL_BUILD_DI= R} ${KERNEL_CONFIG_TARGET} > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ./scripts/kconfig/merge_confi= g.sh -O ${KERNEL_BUILD_DIR}/ \ > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ${KER= NEL_BUILD_DIR}/.config ${KERNEL_CONFIG_FRAGMENTS} > +=C2=A0=C2=A0=C2=A0 fi > =C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0 # Stop tracing > =C2=A0=C2=A0=C2=A0=C2=A0 set +x > diff --git a/meta/recipes-kernel/linux/linux-custom.inc > b/meta/recipes-kernel/linux/linux-custom.inc > index 647f09dd..6aa70fd3 100644 > --- a/meta/recipes-kernel/linux/linux-custom.inc > +++ b/meta/recipes-kernel/linux/linux-custom.inc > @@ -25,6 +25,7 @@ KBUILD_DEPENDS ?=3D "build-essential:native, \ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 flex, \ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 git, \ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 kmod, \ > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 linux-image- > ${KERNEL_NAME_PROVIDED}:${DISTRO_ARCH} , \ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rsync," > =C2=A0 > =C2=A0KERNEL_DEBIAN_DEPENDS ?=3D "initramfs-tools | linux-initramfs-tool,= \ > @@ -112,7 +113,7 @@ BUILD_PROFILES =3D "kernel kbuild" > =C2=A0BBCLASSEXTEND:append:cross-profile =3D " kbuildtarget" > =C2=A0 > =C2=A0# When cross-profile is active: > -# build only kernel with the default variant of the recipe > +# build only kernel (including config) with the default variant of > the recipe > =C2=A0BUILD_PROFILES:cross-profile =3D "kernel" > =C2=A0 > =C2=A0# -native: kbuild package for host > @@ -122,14 +123,18 @@ RECIPE_PROVIDES:class-native =3D " \ > =C2=A0=C2=A0=C2=A0=C2=A0 linux-kbuild-${KERNEL_NAME_PROVIDED}" > =C2=A0# Use pseudo target to pull in the base variant of the recipe. > =C2=A0# Will be auto-extended with -native by multiarch.bbclass. > -RDEPENDS:class-native +=3D "${BPN}-pseudo" > +# Using DEPENDS instead of RDEPENDS to ensure creation of kernel > including > +# pregenerated kernel config before host specific linux-kbuild > package build > +DEPENDS:class-native +=3D "${BPN}-pseudo" > =C2=A0 > =C2=A0# -kbuildtarget: kbuild package for target, enforcing non-cross- > build > =C2=A0BUILD_PROFILES:class-kbuildtarget =3D "kbuild" > =C2=A0RECIPE_PROVIDES:class-kbuildtarget =3D " \ > =C2=A0=C2=A0=C2=A0=C2=A0 linux-headers-${KERNEL_NAME_PROVIDED} \ > =C2=A0=C2=A0=C2=A0=C2=A0 linux-kbuild-${KERNEL_NAME_PROVIDED}" > -RDEPENDS:class-kbuildtarget =3D "${BPN}" > +# Using DEPENDS instead of RDEPENDS to ensure creation of kernel > including > +# pregenerated kernel config before target specific linux-kbuild > package build > +DEPENDS:class-kbuildtarget =3D "${BPN}" > =C2=A0ISAR_CROSS_COMPILE:class-kbuildtarget =3D "0" > =C2=A0 > =C2=A0# Make bitbake know we will be producing linux-image and linux- > headers packages Applied to next, thanks. --=20 Best regards, Uladzimir.