From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 8JMHC0TqRGYedwEAe85BDQ:P1 (envelope-from ) for ; Wed, 15 May 2024 19:00:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 8JMHC0TqRGYedwEAe85BDQ (envelope-from ) for ; Wed, 15 May 2024 19:00:52 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="mki3HVO/"; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715792452; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=O2Oyd1fKKlGac2Pyz/JWy50X2x2lIjqEtnTZf9A+DSo=; b=JTd1DwfDzM5i9UtdUmsV4WbnN1kUn6ljMOAtza/6mTCa8cgU1KhkTHc30Idgxyu8L8PXPV 6BmV/63GCIx1OyJ+YBYm8+LnRq0w62bYMIFksz+2wh4wOsHHHz37ajroWyrtyyBV88JO38 bAxnvdxJ/STRpq5v4pPxgyQERtBloZp1HnVX/38thAxz+ZcbT6srxkGW0UCHk3+IBRnunU AbBeB0NCBjbf7Yl8vmWkQGWUIWTWXUzJGKyndlyzxYuIh631q34EzJtezN+5rm31WwL+zJ Mu5Ok32V97Uyd1POSr7b7k/cSl3KaTXbQ01CAJelvvWagFiHej7dsTgef7em7A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715792452; a=rsa-sha256; cv=none; b=QrvvstvRy6tfoWnWI4sdmuzIiDtZjXKZPvUxxLXY9vW6+2bqYsSdSl1gYtvr/jglCq3U5E uzLarx92OHjQoFMmICyBEv1I4KsGMJoqlD+XnpYjRhfA4mnl16ja7ffQ8moUnuH+DirNqm HeT31wDYTmMuUBZCp6odpVJvVEpnMULFPoSd4vEw74+V4pPVrGbXiTk+eMacC7YUx/TaIP 5ppcgqJ1vQ1ToY/ptdy+jZ54WMNn4vsEIWba2FTORqFTUgmGfh/MWxYT6QYn0M1DQrKPI1 BxkEclJC3SZ+zzFdLvn7TbStr6iCnW1YU38sxic+CkH77V6YWq5Z6jRBoppjeg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="mki3HVO/"; 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" 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 E4456922A for ; Wed, 15 May 2024 19:00:51 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7HzH-0001ud-U5; Wed, 15 May 2024 13:00:19 -0400 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 1s7HzB-0001rG-Qu for guix-patches@gnu.org; Wed, 15 May 2024 13:00:13 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7HzB-0007I3-Ch; Wed, 15 May 2024 13:00:13 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7Hz4-0007CY-Mu; Wed, 15 May 2024 13:00:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70962] [PATCH 11/14] gnu: linux: Turn %default-extra-linux-options into a procedure. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: pelzflorian@pelzflorian.de, leo@famulari.name, ludo@gnu.org, matt@excalamus.com, me@tobias.gr, w@wmeyer.eu, guix-patches@gnu.org Resent-Date: Wed, 15 May 2024 17:00:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70962 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70962@debbugs.gnu.org Cc: Maxim Cournoyer , Florian Pelz , Leo Famulari , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Matthew Trzcinski , Tobias Geerinckx-Rice , Wilko Meyer X-Debbugs-Original-Xcc: Florian Pelz , Leo Famulari , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Matthew Trzcinski , Tobias Geerinckx-Rice , Wilko Meyer Received: via spool by 70962-submit@debbugs.gnu.org id=B70962.171579237227521 (code B ref 70962); Wed, 15 May 2024 17:00:06 +0000 Received: (at 70962) by debbugs.gnu.org; 15 May 2024 16:59:32 +0000 Received: from localhost ([127.0.0.1]:43173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7HyV-00079l-AX for submit@debbugs.gnu.org; Wed, 15 May 2024 12:59:32 -0400 Received: from mail-qv1-f49.google.com ([209.85.219.49]:45285) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7HyS-00078l-Sk for 70962@debbugs.gnu.org; Wed, 15 May 2024 12:59:29 -0400 Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-69b5a87505cso35186676d6.2 for <70962@debbugs.gnu.org>; Wed, 15 May 2024 09:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715792301; x=1716397101; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O2Oyd1fKKlGac2Pyz/JWy50X2x2lIjqEtnTZf9A+DSo=; b=mki3HVO/5vZQG3szEr2R9sgbouLDeQ0sAhgbTUfliwz2Dx1wTRFfIYt5Yx2FKt9iNr 5Ak+2ZT6cKsk5Vm7/Zan/naDMGqxZdQ7o0pcJLVREengzsNvlD74AdCPdyaRBUn621EV jqq+HJWSIHqFett29Kx0VJqBxzgaM0z6w/5ezm2fnW45Bw0BhxLCl/pIshUqCC+jPBs4 87tN6M5Ach8SFD4ATjBarOafj6vSjqkBZ8bj6n+LOSxUqke3msWXK8wpspY8EMIjwBIX P6WRMye/CdTXXKJfXGyw+0aOrvJsmk4XP8G70/h4hV2Pcv34RXrr1pPrxAQVs7q7Qszu JoMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715792301; x=1716397101; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O2Oyd1fKKlGac2Pyz/JWy50X2x2lIjqEtnTZf9A+DSo=; b=Cv3onfBcioE1PXDGnL148ZeK4qAi/0ZygGVgNG6YcTDMDCfX0nmp0tg3+qqBVE4ku0 liU4oR601pu0qWKn7Rg/RPC01eYQqK3kJ4jC1h1no+JupYiqkx2recIoOjKe/5Qfezyb QEu0oX3GDKU57I7R8F6+2l7X/gpXqEr30uH5bVkh6FqNN+/yNifFNVdK4Y8DTmlFb1pd a9KQkQ6CboqjCVlKxNPo1mAG4FMOFGVaFV43FbA7HTQDPT1gIVLwOQ+DEMe4YSP7HVOx Wx2g7abTqOZ4neioeAaJcC+bKUzdMraFrw39TZVCBdpOEeDiqZewa/zayLSAstgDAqtG YjWQ== X-Gm-Message-State: AOJu0Yzan5ehRroKvAAXkXKT2jrNflYLTC0pWEW8EFbCG19GTdRMaXgD W3fVQ6+lawI656/LsuvfQwagUyqKuRsxKKukZwj1h5/io3y7I3aq2ZpcvA== X-Google-Smtp-Source: AGHT+IEuVLOVuELNjV6OjerEHjcmJHP8/PzwP5GvWpWABt5N0lJdf5Q7Y8BK9dERE1GAOsi8vhsLpw== X-Received: by 2002:a05:6214:5884:b0:6a0:c950:451f with SMTP id 6a1803df08f44-6a16824d066mr224928306d6.56.1715792301215; Wed, 15 May 2024 09:58:21 -0700 (PDT) Received: from localhost.localdomain (dsl-205-233-125-107.b2b2c.ca. [205.233.125.107]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6a15f194871sm66068896d6.59.2024.05.15.09.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 09:58:20 -0700 (PDT) From: Maxim Cournoyer Date: Wed, 15 May 2024 12:57:21 -0400 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: <7cf609dcf83c85b6897c9fb9af46ce8a854a15c8.1715791830.git.maxim.cournoyer@gmail.com> References: <7cf609dcf83c85b6897c9fb9af46ce8a854a15c8.1715791830.git.maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 X-Migadu-Spam-Score: 1.23 X-Spam-Score: 1.23 X-Migadu-Queue-Id: E4456922A X-Migadu-Scanner: mx11.migadu.com X-TUID: RRN8GZhBTZsv This is to allow version-specific options to the list of defaults. * gnu/packages/linux.scm (%default-extra-linux-options): Transform to... (default-extra-linux-options): ... this procedure, which accepts a 'version' argument. (make-linux-libre, linux-libre-arm-generic, linux-libre-arm-generic-5.10) (linux-libre-arm-generic-5.4, linux-libre-arm64-generic) (linux-libre-arm64-generic-5.10, linux-libre-arm64-generic-5.4) (linux-libre-riscv64-generic, linux-libre-mips64el-fuloong2e) (linux-libre-with-bpf): Adjust accordingly. * doc/guix-cookbook.texi (Customizing the Kernel): Adjust accordingly. Change-Id: Ifd3be8b7ed8699bada224a938dbc84205366ff3d --- doc/guix-cookbook.texi | 17 +++++++++-------- gnu/packages/linux.scm | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi index 3bc63cba7a..6f23fe53ec 100644 --- a/doc/guix-cookbook.texi +++ b/doc/guix-cookbook.texi @@ -1681,7 +1681,7 @@ Customizing the Kernel ;; See kernel-config for an example. (configuration-file #f) (defconfig "defconfig") - (extra-options %default-extra-linux-options)) + (extra-options (default-extra-linux-options version))) ...) @end lisp @@ -1748,7 +1748,7 @@ Customizing the Kernel it: @lisp -(define %default-extra-linux-options +(define (default-extra-linux-options version) `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #true) ;; Modules required for initrd: @@ -1798,7 +1798,7 @@ Customizing the Kernel %file-systems %efi-support %emulation - (@@@@ (gnu packages linux) %default-extra-linux-options))) + ((@@@@ (gnu packages linux) default-extra-linux-options) version))) (define-public linux-libre-macbook41 ;; XXX: Access the internal 'make-linux-libre*' procedure, which is @@ -1812,11 +1812,12 @@ Customizing the Kernel #:extra-options %macbook41-config-options)) @end lisp -In the above example @code{%file-systems} is a collection of flags enabling -different file system support, @code{%efi-support} enables EFI support and -@code{%emulation} enables a x86_64-linux machine to act in 32-bit mode also. -@code{%default-extra-linux-options} are the ones quoted above, which had to be -added in since they were replaced in the @code{extra-options} keyword. +In the above example @code{%file-systems} is a collection of flags +enabling different file system support, @code{%efi-support} enables EFI +support and @code{%emulation} enables a x86_64-linux machine to act in +32-bit mode also. The @code{default-extra-linux-options} procedure is +the one defined above, which had to be used to avoid loosing the default +configuration options of the @code{extra-options} keyword. This all sounds like it should be doable, but how does one even know which modules are required for a particular system? Two places that can be helpful diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 4547ab525f..eaa9f66d74 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -825,7 +825,7 @@ (define* (kernel-config arch #:key variant) (config (search-auxiliary-file file))) (and config (local-file config)))) -(define %default-extra-linux-options +(define (default-extra-linux-options version) `(;; Make the kernel config available at /proc/config.gz ("CONFIG_IKCONFIG" . #t) ("CONFIG_IKCONFIG_PROC" . #t) @@ -938,7 +938,7 @@ (define* (make-linux-libre version gnu-revision hash-string supported-systems ;; for an example. (configuration-file #f) (defconfig "defconfig") - (extra-options %default-extra-linux-options) + (extra-options (default-extra-linux-options version)) (patches `(,%boot-logo-patch ,@(if (apply-infodoc-patch? version) @@ -964,7 +964,7 @@ (define* (make-linux-libre* version gnu-revision source supported-systems ;; See kernel-config for an example. (configuration-file #f) (defconfig "defconfig") - (extra-options %default-extra-linux-options)) + (extra-options (default-extra-linux-options version))) (package (name (if extra-version (string-append "linux-libre-" extra-version) @@ -1208,7 +1208,7 @@ (define-public linux-libre-arm-generic (append `(;; needed to fix the RTC on rockchip platforms ("CONFIG_RTC_DRV_RK808" . #t)) - %default-extra-linux-options))) + (default-extra-linux-options linux-libre-version)))) (define-public linux-libre-arm-generic-5.10 (make-linux-libre* linux-libre-5.10-version @@ -1221,7 +1221,7 @@ (define-public linux-libre-arm-generic-5.10 (append `(;; needed to fix the RTC on rockchip platforms ("CONFIG_RTC_DRV_RK808" . #t)) - %default-extra-linux-options))) + (default-extra-linux-options linux-libre-5.10-version)))) (define-public linux-libre-arm-generic-5.4 (make-linux-libre* linux-libre-5.4-version @@ -1234,7 +1234,7 @@ (define-public linux-libre-arm-generic-5.4 (append `(;; needed to fix the RTC on rockchip platforms ("CONFIG_RTC_DRV_RK808" . #t)) - %default-extra-linux-options))) + (default-extra-linux-options linux-libre-5.4-version)))) (define-public linux-libre-arm-generic-4.19 (make-linux-libre* linux-libre-4.19-version @@ -1286,7 +1286,7 @@ (define-public linux-libre-arm64-generic ("CONFIG_BATTERY_CW2015" . m) ("CONFIG_CHARGER_GPIO" . m) ("CONFIG_SND_SOC_ES8316" . m)) - %default-extra-linux-options))) + (default-extra-linux-options linux-libre-version)))) (define-public linux-libre-arm64-generic-5.10 (make-linux-libre* linux-libre-5.10-version @@ -1312,7 +1312,7 @@ (define-public linux-libre-arm64-generic-5.10 ("CONFIG_BATTERY_CW2015" . m) ("CONFIG_CHARGER_GPIO" . m) ("CONFIG_SND_SOC_ES8316" . m)) - %default-extra-linux-options))) + (default-extra-linux-options linux-libre-5.10-version)))) (define-public linux-libre-arm64-generic-5.4 (make-linux-libre* linux-libre-5.4-version @@ -1325,7 +1325,7 @@ (define-public linux-libre-arm64-generic-5.4 (append `(;; needed to fix the RTC on rockchip platforms ("CONFIG_RTC_DRV_RK808" . #t)) - %default-extra-linux-options))) + (default-extra-linux-options linux-libre-5.4-version)))) (define-public linux-libre-riscv64-generic (make-linux-libre* linux-libre-version @@ -1349,7 +1349,7 @@ (define-public linux-libre-riscv64-generic ("CONFIG_HW_RANDOM_VIRTIO" . m) ("CONFIG_VIRTIO_CONSOLE" . m) ("CONFIG_CRYPTO_XTS" . m)) - %default-extra-linux-options))) + (default-extra-linux-options linux-libre-version)))) (define-public linux-libre-mips64el-fuloong2e (make-linux-libre* linux-libre-version @@ -1361,7 +1361,7 @@ (define-public linux-libre-mips64el-fuloong2e #:extra-options (append `(("CONFIG_OVERLAY_FS" . m)) - %default-extra-linux-options))) + (default-extra-linux-options linux-libre-version)))) (define-public linux-libre-with-bpf (let ((base-linux-libre @@ -1375,7 +1375,7 @@ (define-public linux-libre-with-bpf #:configuration-file kernel-config #:extra-options (append %bpf-extra-linux-options - %default-extra-linux-options)))) + (default-extra-linux-options linux-libre-6.8-version))))) (package (inherit base-linux-libre) (inputs (modify-inputs (package-inputs base-linux-libre) -- 2.41.0