public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: WANG Xuerui <xen0n@gentoo.org>
To: "Michał Górny" <mgorny@gentoo.org>,
	gentoo-dev@lists.gentoo.org, dist-kernel@gentoo.org
Subject: Re: [gentoo-dev] [PATCH 3/3] kernel-build.eclass: fix KERNEL_EFI_ZBOOT not being probed on partially supported arches
Date: Mon, 18 Dec 2023 00:02:43 +0800	[thread overview]
Message-ID: <86d43105-8d01-4133-966e-961ca6881754@gentoo.org> (raw)
In-Reply-To: <4c267eb9934d69f1a91b624977e1bbfd7e248e92.camel@gentoo.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 2367 bytes --]

On 12/17/23 21:11, Michał Górny wrote:
> On Sun, 2023-12-17 at 20:09 +0800, WANG Xuerui wrote:
>> The several partially-supported arches (those relying on
>> USE=savedconfig) directly return in src_prepare(), hence previously the
>> CONFIG_EFI_ZBOOT probing didn't have a chance to run when building for
>> those arches, leading to wrong kernel artifact path and failed
>> src_install().
>>
>> Move the probing to near the end of eclass src_configure(), so the flag
>> correctly reflects the reality in all circumstances.
>>
>> Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
>> ---
>>   eclass/kernel-build.eclass | 12 ++++++------
>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
>> index 6b692dc4f9a0..7a041a8aacdf 100644
>> --- a/eclass/kernel-build.eclass
>> +++ b/eclass/kernel-build.eclass
>> @@ -203,6 +203,12 @@ kernel-build_src_configure() {
>>   			.config)
>>   	fi
>>   
>> +	# If this is set by USE=secureboot or user config this will have an effect
>> +	# on the name of the output image. Set this variable to track this setting.
>> +	if grep -q "CONFIG_EFI_ZBOOT=y" .config; then
>> +		KERNEL_EFI_ZBOOT=1
>> +	fi
>> +
>>   	mkdir -p "${WORKDIR}"/modprep || die
>>   	mv .config "${WORKDIR}"/modprep/ || die
>>   	emake O="${WORKDIR}"/modprep "${MAKEARGS[@]}" olddefconfig
>> @@ -456,12 +462,6 @@ kernel-build_merge_configs() {
>>   
>>   	./scripts/kconfig/merge_config.sh -m -r \
>>   		.config "${merge_configs[@]}"  || die
>> -
>> -	# If this is set by USE=secureboot or user config this will have an effect
>> -	# on the name of the output image. Set this variable to track this setting.
>> -	if grep -q "CONFIG_EFI_ZBOOT=y" .config; then
>> -		KERNEL_EFI_ZBOOT=1
>> -	fi
>>   }
>>   
>>   fi
> This doesn't seem correct.  It won't work if KERNEL_EFI_ZBOOT is set by
> one of the merged configs.
But isn't the src_configure phase building upon the config already 
merged in src_prepare? The alternative would be keeping the 
kernel-build_merge_configs logic intact, but then it has to be 
duplicated for every early return branch in each ebuild's src_prepare, 
which I think is too excessive...

-- 
WANG Xuerui
xen0n@gentoo.org
Gentoo Linux developer
PGP: 7C52 19E3 26A0 7311 3EA3 8806 C01F 7214 BC93 1414


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 23337 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2023-12-17 16:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-17 12:09 [gentoo-dev] [PATCH 0/3] eclass changes for supporting dist kernel on loong WANG Xuerui
2023-12-17 12:09 ` [gentoo-dev] [PATCH 1/3] dist-kernel-utils.eclass: support loong in dist-kernel_get_image_path WANG Xuerui
2023-12-17 12:09 ` [gentoo-dev] [PATCH 2/3] kernel-install.eclass: support loong in kernel-install_get_qemu_arch WANG Xuerui
2023-12-17 12:09 ` [gentoo-dev] [PATCH 3/3] kernel-build.eclass: fix KERNEL_EFI_ZBOOT not being probed on partially supported arches WANG Xuerui
2023-12-17 13:11   ` Michał Górny
2023-12-17 16:02     ` WANG Xuerui [this message]
2023-12-17 16:08       ` Michał Górny

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=86d43105-8d01-4133-966e-961ca6881754@gentoo.org \
    --to=xen0n@gentoo.org \
    --cc=dist-kernel@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=mgorny@gentoo.org \
    /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