public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/1] linux-info.eclass: Add /proc/config.gz as a valid src of CONFIG_* settings
@ 2023-01-15 17:40 Mike Pagano
  2023-01-15 19:59 ` Oskari Pirhonen
  2023-01-15 20:16 ` Mike Gilbert
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Pagano @ 2023-01-15 17:40 UTC (permalink / raw
  To: gentoo-dev

In the event that the linux src tree does not have
a valid .config, check for /proc/config.gz

Bug: https://bugs.gentoo.org/890720

Signed-off-by: Mike Pagano <mpagano@gentoo.org>
---
  eclass/linux-info.eclass | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index 16ef69ebc..daedd758f 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -301,10 +301,18 @@ linux_config_qa_check() {
  # @FUNCTION: linux_config_src_exists
  # @RETURN: true or false
  # @DESCRIPTION:
-# It returns true if .config exists in a build directory otherwise false
+# Returns true if either .config exists in a build directory or
+# /proc/config.gz is found, otherwise returns false
  linux_config_src_exists() {
  	export _LINUX_CONFIG_EXISTS_DONE=1
-	use kernel_linux && [[ -n ${KV_OUT_DIR} && -s ${KV_OUT_DIR}/.config ]]
+	if use kernel_linux; then
+		if [[ -n ${KV_OUT_DIR} && -s ${KV_OUT_DIR}/.config ]]; then
+			return 0
+		elif linux_config_bin_exists; then
+			return 0
+		fi
+	fi
+	return 1
  }
  
  # @FUNCTION: linux_config_bin_exists
-- 
2.38.2


-- 
Mike Pagano
Gentoo Developer - Kernel Project
E-Mail     : mpagano@gentoo.org
GnuPG FP   : 52CC A0B0 F631 0B17 0142 F83F 92A6 DBEC 81F2 B137
Public Key : http://pgp.mit.edu/pks/lookup?search=0x92A6DBEC81F2B137&op=index


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [PATCH 1/1] linux-info.eclass: Add /proc/config.gz as a valid src of CONFIG_* settings
  2023-01-15 17:40 [gentoo-dev] [PATCH 1/1] linux-info.eclass: Add /proc/config.gz as a valid src of CONFIG_* settings Mike Pagano
@ 2023-01-15 19:59 ` Oskari Pirhonen
  2023-01-15 20:16 ` Mike Gilbert
  1 sibling, 0 replies; 4+ messages in thread
From: Oskari Pirhonen @ 2023-01-15 19:59 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

On Sun, Jan 15, 2023 at 12:40:12 -0500, Mike Pagano wrote:
> In the event that the linux src tree does not have
> a valid .config, check for /proc/config.gz
> 

What about checking /boot/config-[version] as a backup as well? Since
the standard `make install` for the kernel drops the config used to
build into there too.

- Oskari

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [PATCH 1/1] linux-info.eclass: Add /proc/config.gz as a valid src of CONFIG_* settings
  2023-01-15 17:40 [gentoo-dev] [PATCH 1/1] linux-info.eclass: Add /proc/config.gz as a valid src of CONFIG_* settings Mike Pagano
  2023-01-15 19:59 ` Oskari Pirhonen
@ 2023-01-15 20:16 ` Mike Gilbert
  2023-01-15 20:22   ` Mike Pagano
  1 sibling, 1 reply; 4+ messages in thread
From: Mike Gilbert @ 2023-01-15 20:16 UTC (permalink / raw
  To: gentoo-dev

On Sun, Jan 15, 2023 at 12:40 PM Mike Pagano <mpagano@gentoo.org> wrote:
>
> In the event that the linux src tree does not have
> a valid .config, check for /proc/config.gz
>
> Bug: https://bugs.gentoo.org/890720

I think this is the wrong place to "fix" bug 890720.

We already have a linux_config_exists function. This change would make
that function redundant and removes the ability to check for only a
valid .config in the kernel build directory.

I think the check_config_extra function should be updated to not call
require_configured_kernel.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [PATCH 1/1] linux-info.eclass: Add /proc/config.gz as a valid src of CONFIG_* settings
  2023-01-15 20:16 ` Mike Gilbert
@ 2023-01-15 20:22   ` Mike Pagano
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Pagano @ 2023-01-15 20:22 UTC (permalink / raw
  To: gentoo-dev

On 1/15/23 15:16, Mike Gilbert wrote:
> On Sun, Jan 15, 2023 at 12:40 PM Mike Pagano <mpagano@gentoo.org> wrote:
>>
>> In the event that the linux src tree does not have
>> a valid .config, check for /proc/config.gz
>>
>> Bug: https://bugs.gentoo.org/890720
> 
> I think this is the wrong place to "fix" bug 890720.
> 
> We already have a linux_config_exists function. This change would make
> that function redundant and removes the ability to check for only a
> valid .config in the kernel build directory.
> 
> I think the check_config_extra function should be updated to not call
> require_configured_kernel.
> 

Yeah, I guess that does make sense.  The CONFIGs are optional, why look for
any config file ?

-- 
Mike Pagano
Gentoo Developer - Kernel Project
E-Mail     : mpagano@gentoo.org
GnuPG FP   : 52CC A0B0 F631 0B17 0142 F83F 92A6 DBEC 81F2 B137
Public Key : http://pgp.mit.edu/pks/lookup?search=0x92A6DBEC81F2B137&op=index



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-15 20:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-15 17:40 [gentoo-dev] [PATCH 1/1] linux-info.eclass: Add /proc/config.gz as a valid src of CONFIG_* settings Mike Pagano
2023-01-15 19:59 ` Oskari Pirhonen
2023-01-15 20:16 ` Mike Gilbert
2023-01-15 20:22   ` Mike Pagano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox