From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UC9HG/XUiGPC+AAAbAwnHQ (envelope-from ) for ; Thu, 01 Dec 2022 17:23:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +ABfG/XUiGMAcgEAauVa8A (envelope-from ) for ; Thu, 01 Dec 2022 17:23:17 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 086055826 for ; Thu, 1 Dec 2022 17:23:16 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0mL2-0000L1-Hp; Thu, 01 Dec 2022 11:23:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p0mL0-0000K1-O8 for guix-patches@gnu.org; Thu, 01 Dec 2022 11:23:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0mL0-0005Hz-Ck for guix-patches@gnu.org; Thu, 01 Dec 2022 11:23:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p0mL0-00038u-82 for guix-patches@gnu.org; Thu, 01 Dec 2022 11:23:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#48314] [PATCH] Install guix system on Raspberry Pi Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 01 Dec 2022 16:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48314 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Stefan Cc: Vagrant Cascadian , Danny Milosavljevic , Ludovic =?UTF-8?Q?Court=C3=A8s?= , phodina , 48314@debbugs.gnu.org Received: via spool by 48314-submit@debbugs.gnu.org id=B48314.166991177612057 (code B ref 48314); Thu, 01 Dec 2022 16:23:02 +0000 Received: (at 48314) by debbugs.gnu.org; 1 Dec 2022 16:22:56 +0000 Received: from localhost ([127.0.0.1]:40634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0mKp-00038P-T3 for submit@debbugs.gnu.org; Thu, 01 Dec 2022 11:22:56 -0500 Received: from mail-qt1-f178.google.com ([209.85.160.178]:37661) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0mKn-00038J-7c for 48314@debbugs.gnu.org; Thu, 01 Dec 2022 11:22:50 -0500 Received: by mail-qt1-f178.google.com with SMTP id l15so1354308qtv.4 for <48314@debbugs.gnu.org>; Thu, 01 Dec 2022 08:22:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=Meb1brOkqH1oNakSC7Tp5yDy2MM5N78GhTVXFVCJBJU=; b=ljWHLkiQx1VgGhl3VofawiBicuRRE5QmEHMOAhFlpYMFMKBi+Cu5kcARfzHD6ASONi Aun9vXiouFUW9m/6d4irnpejql831NUKLMr3U8MuHyQrZjVw5j53tW8QI2Ljq1Z9U7v+ N1CAmqa2RSX8IjTuL39B/ms49v52GbJiOc4WzuUDgO0IoRR2sbuojQH4SDTAvzQK2pco 1sx3HoA4r57SGnVhSTubR1ZrR0+cM6844V031Xkb5LWybe6xuLNjfanbTM3tnTqlcC1h gMv1ntVYYXDzv5agxlg44JlcpqjF140cquMh9MH5EqIMGc5S9nZl4hOtow2s8xlSgQVy l8ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Meb1brOkqH1oNakSC7Tp5yDy2MM5N78GhTVXFVCJBJU=; b=qdDrTSzpO3BRigT/zCYmzy3FFZINwQct4OXL7d1nJ0kdRMto9h1rtO3/PLYFXwDCe/ bx/Ej5Vz3X50RnnyxvSej1JQXssgNc8oWotGpc7lh1kpdUlpdyy69yT0g0HU3ePjFdVR iXuBPfnbIfLw9/YaCM0a3rDm8Ked9sPXzIp64bM5LYwtauCV0pPDcPmL/z5PUliuLJyo UhMP4jB9gt8lBLnpH5lOmjlpOwtyeTuaa8GcW7q/r2DN8JRhjhkH2Gz39V3kHo2Ly2Oo m/UlUgC6GJhZt/1CP/vKZyRwdiD0+o6Mdxu14iHWySPY9UPXb3GRiuFS7CXQWlsPHrDc 5TTQ== X-Gm-Message-State: ANoB5pmSaN7rKE0q9a3cRfAdLfMDu87kPjh5QJAaM+ZVMSUGZvWJf8Uz G+1x6xMwLwoPO2OCfjaUWCM= X-Google-Smtp-Source: AA0mqf5OjoaeluJ9Kr9RArBn7/kmjHmol5ELAdUo4Sxk96mDT0tvYyf4RQzlFBd8Sp7Rxly+15m4PA== X-Received: by 2002:ac8:5355:0:b0:3a5:4074:4753 with SMTP id d21-20020ac85355000000b003a540744753mr43786787qto.605.1669911763191; Thu, 01 Dec 2022 08:22:43 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id x9-20020ac81209000000b003a6934255dasm1102043qti.46.2022.12.01.08.22.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 08:22:42 -0800 (PST) From: Maxim Cournoyer References: <2IN6BsQe0_wSC9iwf7LHT5LUk7wXLVXytkDtcg7RIYByyYFTsuC9BZPR_wdv4eDMncsZfy17h7z9jIRRSC6kfV2odXkt0hp4Lilq5sGYdVo=@protonmail.com> <204332DD-AA02-4A31-9B48-FB3FAB9BD8F3@vodafonemail.de> Date: Thu, 01 Dec 2022 11:22:41 -0500 In-Reply-To: <204332DD-AA02-4A31-9B48-FB3FAB9BD8F3@vodafonemail.de> (Stefan's message of "Thu, 22 Sep 2022 18:18:59 +0200") Message-ID: <87ilivhz5a.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669911797; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Meb1brOkqH1oNakSC7Tp5yDy2MM5N78GhTVXFVCJBJU=; b=Cvk+8PO7SImnSrTysk1SHHy+gqPNPAWRW21Cp5LXfPNAd4Om8u+O0LpMx6RxL4KBByGFoV ypvGsvdRSct8+L9jimToCilB5Pug/PTuYp1X5Krxd1K9RbAKbWdgqr5rAJqnLvYlMz5Aa2 UYZsoKFIcdohH+FRMRT/r2n2z4KKR62TwmLWPbkvOWiR50HXjINIAkstmBgbEUMdIz/EyI h10wqzoDYw/UJjin+u/csCpFGEqBDYrpnt4nJHHa6h49aTQbLvPUoNlPdsmlVnxszdE3Ki qPpSfQ1b6fI9CsHsCAwtIHebhAMjsEcZmU1O68cvBSX7T/NakV1X9sbnoMWmAg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669911797; a=rsa-sha256; cv=none; b=eOtrrjzf3ASeWCaL8TaHqY/pDiupdTroqDCZenEFaJyC6YQnrZR3d9tlq60wlvuElWSchI rpA9BnrlxUcD82SkFrv+1ww9a+n/3VE5kjiLzRPkOLAwEbGk9iW3wAXlqyyhDmUMjvXsBQ WJ+SEAYXGQC1rC1/cIjRDret22m/oTk1sRYN7cx5o855oPPdd8CfFq+sVcmAZNHARFRVV+ 2DuNHRMhBMmDINiwKH/kpKuqDg6inDq5z7q8xhWHcn+f+1fGbCXVmSq7yWaLnl27O8Irsd /rV+QW85Kt2xyCHTLtpFN+81qtYi3sOCEneEm4QP/hk8WYgPOxgYGOpxDpQQ1A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=ljWHLkiQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.24 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=ljWHLkiQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 086055826 X-Spam-Score: 5.24 X-Migadu-Scanner: scn0.migadu.com X-TUID: 1vesf0+izpq3 Hi, Stefan writes: [...] > new file mode 100644 > index 0000000000..0cfaffe056 > --- /dev/null > +++ b/guix/build/kconfig.scm [...] > +(define-module (guix build kconfig) > + #:use-module (ice-9 rdelim) > + #:use-module (ice-9 regex) > + #:use-module (srfi srfi-1) > + #:use-module (srfi srfi-26) > + #:export (modify-defconfig > + verify-config)) > + > +;; Commentary: > +;; > +;; Builder-side code to modify configurations for the Kconfig build syst= em as > +;; used by Linux and U-Boot. > +;; > +;; Code: > + > +(define (config-string->pair config-string) > + "Parse a configuration string like \"CONFIG_EXAMPLE=3Dm\" into a key-v= alue pair. > +An error is thrown for invalid configurations. > + > +\"CONFIG_A=3Dy\" -> '(\"CONFIG_A\" . \"y\") > +\"CONFIG_B=3D\\\"\\\"\" -> '(\"CONFIG_B\" . \"\\\"\\\"\") > +\"CONFIG_C=3D\" -> '(\"CONFIG_C\" . \"\") > +\"# CONFIG_E is not set\" -> '(\"CONFIG_E\" . #f) > +\"CONFIG_D\" -> '(\"CONFIG_D\" . #f) > +\"# Any comment\" -> '(#f . \"# Any comment\") > +\"\" -> '(#f . \"\") > +\"# CONFIG_E=3Dy\" -> (error \"Invalid configuration\") > +\"CONFIG_E is not set\" -> (error \"Invalid configuration\") > +\"Anything else\" -> (error \"Invalid configuration\")" > + (define config-regexp > + (make-regexp > + ;; (match:substring (string-match "=3D(.*)" "=3D") 1) returns "", b= ut the > + ;; pattern "=3D(.+)?" makes it return #f instead. From a "CONFIG_A= =3D" we like > + ;; to get "", which later emits "CONFIG_A=3D" again. > + "^ *(#[\\t ]*)?(CONFIG_[a-zA-Z0-9_]+)([\\t ]*=3D[\\t ]*(.*)|([\\t ]= +is[\\t ]+not[\\t ]+set))?$")) > + > + (define config-comment-regexp > + (make-regexp "^([\\t ]*(#.*)?)$")) > + > + (let ((match (regexp-exec config-regexp (string-trim-right config-stri= ng)))) > + (if match > + (let* ((comment (match:substring match 1)) > + (key (match:substring match 2)) > + (unset (match:substring match 5)) > + (value (and (not comment) > + (not unset) > + (match:substring match 4)))) > + (if (eq? (not comment) (not unset)) > + ;; The key is uncommented and set or commented and unset. > + (cons key value) > + ;; The key is set or unset ambigiously. > + (error (format #f "Invalid configuration, did you mean \"~= a\"?" > + (pair->config-string (cons key #f))) > + config-string))) > + ;; This is not a valid or ambigious config-string, but mayby a c= omment. > + (if (regexp-exec config-comment-regexp config-string) > + ;; We keep valid comments. > + (cons #f config-string) > + (error "Invalid configuration" config-string))))) > + > +(define (pair->config-string pair) > + "Convert a PAIR back to a config-string." > + (let* ((key (first pair)) > + (value (cdr pair))) > + (if (string? key) > + (if (string? value) > + (string-append key "=3D" value) > + (string-append "# " key " is not set")) > + value))) > + > +(define (defconfig->alist defconfig) > + "Convert the content of a DEFCONFIG (or .config) file into an alist." > + (with-input-from-file defconfig > + (lambda () > + (let loop ((alist '()) > + (line (read-line))) > + (if (eof-object? line) > + ;; Building the alist is done, now check for duplicates. > + (let loop ((keys (map first (filter first alist))) ^ What is this filter used for here? EDIT: saw later, it's used to filter out comments. [...] > +(define (verify-config config defconfig) > + "Verify that the CONFIG file contains all configurations from the DEFC= ONFIG > +file and return #t in this case. Otherwise throw an error with the misma= tching > +keys and their values." > + (let* ((config-pairs (defconfig->alist config)) > + (defconfig-pairs (defconfig->alist defconfig)) > + (mismatching-pairs > + (remove (lambda (pair) > + ;; Remove all configurations, whose values are #f an= d whose > + ;; keys are not in config-pairs, as not in config-pa= irs > + ;; means unset, =E2=80=A6 > + (and (not (cdr pair)) > + (not (assoc-ref config-pairs (first pair))))) > + ;; =E2=80=A6 from the defconfig-pairs different to con= fig-pairs. So, it finds mismatched configurations that exist in both CONFIG and DEFCONFIG, but it doesn't error when there are configs that exist in DEFCONFIG but missing from CONFIG, right? Should it? > + (lset-difference equal? > + ;; Remove comments by filtering with = first. > + (filter first defconfig-pairs) > + config-pairs)))) > + (if (null? mismatching-pairs) > + #t > + (error (format #f > + "Mismatching configurations in ~a and ~a" > + config > + defconfig) > + (map (lambda (mismatching-pair) > + (let* ((key (first mismatching-pair)) > + (defconfig-value (cdr mismatching-pair)) > + (config-value (assoc-ref config-pairs key))) > + (cons key (list (list config-value defconfig-val= ue))))) > + mismatching-pairs))))) > > I've made the following mostly cosmetic changes: --8<---------------cut here---------------start------------->8--- 2 files changed, 43 insertions(+), 45 deletions(-) gnu/packages/bootloaders.scm | 18 +++++++++--------- guix/build/kconfig.scm | 70 ++++++++++++++++++++++++++++++++++-------= ----------------------------- modified gnu/packages/bootloaders.scm @@ -792,9 +792,9 @@ (define*-public (make-u-boot-package board triplet #:ke= y defconfig configs) "_" "-"))) (native-inputs `(,@(if (not (same-arch?)) - `(("cross-gcc" ,(cross-gcc triplet)) - ("cross-binutils" ,(cross-binutils triplet))) - `()) + `(("cross-gcc" ,(cross-gcc triplet)) + ("cross-binutils" ,(cross-binutils triplet))) + `()) ,@(package-native-inputs u-boot))) (arguments `(#:modules ((ice-9 ftw) @@ -808,8 +808,8 @@ (define*-public (make-u-boot-package board triplet #:ke= y defconfig configs) #:make-flags (list "HOSTCC=3Dgcc" ,@(if (not (same-arch?)) - `((string-append "CROSS_COMPILE=3D" ,triplet "-")) - '())) + `((string-append "CROSS_COMPILE=3D" ,triplet "-")) + '())) #:phases (modify-phases %standard-phases (replace 'configure @@ -828,7 +828,7 @@ (define*-public (make-u-boot-package board triplet #:ke= y defconfig configs) (apply invoke "make" `(,@make-flags ,config-name)) (verify-config ".config" config-file)) (begin - (display "Invalid board name. Valid board names are= :" + (display "invalid board name; valid board names are= :" (current-error-port)) (let ((suffix-len (string-length "_defconfig")) (entries (scandir "configs"))) @@ -839,7 +839,7 @@ (define*-public (make-u-boot-package board triplet #:ke= y defconfig configs) (string-drop-right file-name suffix-l= en)))) (sort entries string-ci<))) - (error "Invalid boardname ~s." ,board)))))) + (error "invalid boardname ~s" ,board)))))) (add-after 'configure 'disable-tools-libcrypto ;; Disable libcrypto due to GPL and OpenSSL license ;; incompatibilities @@ -881,8 +881,8 @@ (define-public u-boot-malta (define-public u-boot-am335x-boneblack (let ((base (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf" - ;; Patch out other device trees to build image small enough= to - ;; fit within typical partitioning schemes where the first + ;; Patch out other device trees to build an image small eno= ugh + ;; to fit within typical partitioning schemes where the fir= st ;; partition begins at sector 2048. #:configs '("CONFIG_OF_LIST=3D\"am335x-evm am335x-boneblack= \"")))) (package modified guix/build/kconfig.scm @@ -50,7 +50,8 @@ (define config-regexp ;; (match:substring (string-match "=3D(.*)" "=3D") 1) returns "", but= the ;; pattern "=3D(.+)?" makes it return #f instead. From a "CONFIG_A= =3D" we like ;; to get "", which later emits "CONFIG_A=3D" again. - "^ *(#[\\t ]*)?(CONFIG_[a-zA-Z0-9_]+)([\\t ]*=3D[\\t ]*(.*)|([\\t ]+i= s[\\t ]+not[\\t ]+set))?$")) + (string-append "^ *(#[\\t ]*)?(CONFIG_[a-zA-Z0-9_]+)([\\t ]*=3D" + "[\\t ]*(.*)|([\\t ]+is[\\t ]+not[\\t ]+set))?$"))) (define config-comment-regexp (make-regexp "^([\\t ]*(#.*)?)$")) @@ -67,13 +68,13 @@ (define config-comment-regexp ;; The key is uncommented and set or commented and unset. (cons key value) ;; The key is set or unset ambigiously. - (error (format #f "Invalid configuration, did you mean \"~a\= "?" + (error (format #f "invalid configuration, did you mean \"~a\= "?" (pair->config-string (cons key #f))) config-string))) - ;; This is not a valid or ambigious config-string, but mayby a com= ment. + ;; This is not a valid or ambigious config-string, but maybe a + ;; comment. (if (regexp-exec config-comment-regexp config-string) - ;; We keep valid comments. - (cons #f config-string) + (cons #f config-string) ;keep valid comments (error "Invalid configuration" config-string))))) (define (pair->config-string pair) @@ -94,6 +95,7 @@ (define (defconfig->alist defconfig) (line (read-line))) (if (eof-object? line) ;; Building the alist is done, now check for duplicates. + ;; Note: the filter invocation is used to remove comments. (let loop ((keys (map first (filter first alist))) (duplicates '())) (if (null? keys) @@ -102,11 +104,11 @@ (define (defconfig->alist defconfig) (if (null? duplicates) alist (error - (format #f "Duplicate configurations in ~a" defconf= ig) + (format #f "duplicate configurations in ~a" defconf= ig) duplicates)) ;; Continue the search for duplicates. (loop (cdr keys) - (if (member (first keys) (cdr keys) equal?) + (if (member (first keys) (cdr keys)) (cons (first keys) duplicates) duplicates)))) ;; Build the alist. @@ -127,13 +129,13 @@ (define (modify-defconfig defconfig configs) \"CONFIG_D=3Dm\" \"CONFIG_E=3D\" \"# CONFIG_G is not set\" - ;; For convinience this abbrevation can be used for not set configuratio= ns. + ;; For convenience this abbrevation can be used for not set configuratio= ns. \"CONFIG_F\") -Instead of a list, CONFGIS can be a string with one configuration per line= ." - (let* (;; Split the configs into a list of single configuations. - ;; To minimize mistakes, we support a string and a list of string= s, - ;; each with newlines to separate configurations. +Instead of a list, CONFIGS can be a string with one configuration per line= ." + (let* (;; Split the configs into a list of single configurations. Both a + ;; string and or a list of strings is supported, each with newlin= es + ;; to separate configurations. (config-pairs (map config-string->pair (append-map (cut string-split <> #\newline) (if (string? configs) @@ -141,45 +143,41 @@ (define (modify-defconfig defconfig configs) configs)))) ;; Generate a blocklist from all valid keys in config-pairs. (blocklist (delete #f (map first config-pairs))) - ;; Generate an alist from the defconifg without the keys in block= list. + ;; Generate an alist from the defconfig without the keys in block= list. (filtered-defconfig-pairs (remove (lambda (pair) (member (first pair) blocklis= t)) (defconfig->alist defconfig)))) (with-output-to-file defconfig (lambda () - (for-each - (lambda (pair) - (display (pair->config-string pair)) - (newline)) - (append filtered-defconfig-pairs config-pairs)))))) + (for-each (lambda (pair) + (display (pair->config-string pair)) + (newline)) + (append filtered-defconfig-pairs config-pairs)))))) (define (verify-config config defconfig) "Verify that the CONFIG file contains all configurations from the DEFCON= FIG -file and return #t in this case. Otherwise throw an error with the mismatc= hing -keys and their values." +file. When the verification fails, raise an error with the mismatching ke= ys +and their values." (let* ((config-pairs (defconfig->alist config)) (defconfig-pairs (defconfig->alist defconfig)) (mismatching-pairs (remove (lambda (pair) - ;; Remove all configurations, whose values are #f and = whose - ;; keys are not in config-pairs, as not in config-pairs - ;; means unset, =E2=80=A6 + ;; Remove all configurations, whose values are #f and + ;; whose keys are not in config-pairs, as not in + ;; config-pairs means unset, ... (and (not (cdr pair)) (not (assoc-ref config-pairs (first pair))))) - ;; =E2=80=A6 from the defconfig-pairs different to confi= g-pairs. + ;; ... from the defconfig-pairs different to config-pair= s. (lset-difference equal? ;; Remove comments by filtering with fi= rst. (filter first defconfig-pairs) config-pairs)))) - (if (null? mismatching-pairs) - #t - (error (format #f - "Mismatching configurations in ~a and ~a" - config - defconfig) - (map (lambda (mismatching-pair) - (let* ((key (first mismatching-pair)) - (defconfig-value (cdr mismatching-pair)) - (config-value (assoc-ref config-pairs key))) - (cons key (list (list config-value defconfig-value= ))))) - mismatching-pairs))))) + (unless (null? mismatching-pairs) + (error (format #f "Mismatching configurations in ~a and ~a" + config defconfig) + (map (lambda (mismatching-pair) + (let* ((key (first mismatching-pair)) + (defconfig-value (cdr mismatching-pair)) + (config-value (assoc-ref config-pairs key))) + (cons key (list (list config-value defconfig-value))= ))) + mismatching-pairs))))) --8<---------------cut here---------------end--------------->8--- And streamlined the commit messages as: --8<---------------cut here---------------start------------->8--- build: kconfig: Add new module to modify defconfig files. * guix/build/kconfig.scm: New file. * Makefile.am: Register it. * gnu/packages/bootloaders.scm (make-u-boot-package) (make-u-boot-sunxi64-package): Add DEFCONFIGS and CONFIGS arguments. (u-boot-am335x-boneblack, u-boot-pinebook) (u-boot-novena,u-boot-rockpro64-rk3399): Simplify packages by using the new keyword arguments. --8<---------------cut here---------------end--------------->8--- Explanations don't go in the GNU ChangeLog, they go ideally in comments in the code or *before* the GNU ChangeLog, if some rationale helps understanding the change, so you can keep things dry there. I'll push this change shortly. --=20 Thanks, Maxim