Subject: bug#54713: closed (Re: bug#54713: [PATCH] gnu: linux: Allow kconfig options to be strings)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 05 Apr 2022 18:20:02 +0000

Your bug report

#54713: [PATCH] gnu: linux: Allow kconfig options to be strings

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
54713: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=54713
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#54713: [PATCH] gnu: linux: Allow kconfig options to be strings
From: Ludovic Courtès <[email-masked]>
To: antlers <[email-masked]>
Cc: [email-masked]
Date: Tue, 05 Apr 2022 20:18:38 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

antlers <[email-masked]> skribis:

> * gnu/packages/linux.scm (config->string): add a clause handling strings
>
> Allows for the declarative configuration of kconfig options which accept
> strings, such as CONFIG_MODULE_SIG_KEY.
>
> I've enclosed the given string in quotes, but don't do any kind of
> escaping. See the kernel mailing list for the current state of escaped
> strings upstream:
>
> https://patchwork.kernel.org/project/linux-kbuild/patch/[email-masked]/
>
> Apologies to those with double-quotes or backslashes in their
> CONFIG_SYSTEM_*_KEYS.

Applied.

If needed, a cheap and often “good enough” way to escape strings is
‘object->string’:

  (display (object->string "foo\"bar\"baz"))
  => "foo\"bar\"baz"

Would that help here?

Thanks,
Ludo’.

Subject: [PATCH] gnu: linux: Allow kconfig options to be strings
From: antlers <[email-masked]>
To: [email-masked]
Cc: antlers <[email-masked]>
Date: Mon, 4 Apr 2022 11:26:09 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/linux.scm (config->string): add a clause handling strings

Allows for the declarative configuration of kconfig options which accept
strings, such as CONFIG_MODULE_SIG_KEY.

I've enclosed the given string in quotes, but don't do any kind of
escaping. See the kernel mailing list for the current state of escaped
strings upstream:

https://patchwork.kernel.org/project/linux-kbuild/patch/[email-masked]/

Apologies to those with double-quotes or backslashes in their
CONFIG_SYSTEM_*_KEYS.

Signed-off-by: antlers <[email-masked]>
---
 gnu/packages/linux.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index ec68f5c57e..9a81fc4a3d 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -767,7 +767,9 @@ (define (config->string options)
                       ((option . #t)
                        (string-append option "=y"))
                       ((option . #f)
-                       (string-append option "=n")))
+                       (string-append option "=n"))
+                      ((option . string)
+                       (string-append option "=\"" string "\"")))
                     options)
                "\n"))
 
-- 
2.34.0