From patchwork Sun Mar 16 23:21:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Adam <>" X-Patchwork-Id: 40272 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 131F027BBEA; Sun, 16 Mar 2025 23:22:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,FROM_NO_USER,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CBA0F27BBE2 for ; Sun, 16 Mar 2025 23:22:26 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttxJ2-0006jm-Iy; Sun, 16 Mar 2025 19:22:08 -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 1ttxIz-0006jR-2A for guix-patches@gnu.org; Sun, 16 Mar 2025 19:22:05 -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 1ttxIy-00011L-Ne for guix-patches@gnu.org; Sun, 16 Mar 2025 19:22:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=Rjo3bQF70Gh6Rp8rPzA/Hlo1lAAnYLvx08okQxoIbGo=; b=oWPHyIH080M6RVuznS/AdcB/UxA5P+vxL85NRxkDQYpbiRRldw0ORiEpRHKd8XUSKCMJowdqqfJQotmWGNQxMtoUD8k414xQMDYOlS4DFs+UQsM9LvO7hOEfAvWvc+zlYr5ghNrMpxyWX6oQct6xzZMiKwsqL+I06J06HjiTw2epd+e9yg8fBgP8lr6rKA86WRhKZJuugw03JPVtgzyBFWsO7C/NTkquDhgrtidc4yIH4kxJ0ObA0zxMG0w5d7EreDVxlyAG6efthN5gR/NkqScnw7u+OqFULoYHrK+td8iolHtxUpXLkJu/SBHDMIlPHQc9aZljvrE291s7fBO/rg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttxIy-0006t8-5W for guix-patches@gnu.org; Sun, 16 Mar 2025 19:22:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77061] [PATCH] update doc/guix-cookbook.texi Update instructions for building a custom kernel. Resent-From: "Adam <>" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 16 Mar 2025 23:22:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77061 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77061@debbugs.gnu.org Cc: Adam Quandour X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.174216731826409 (code B ref -1); Sun, 16 Mar 2025 23:22:03 +0000 Received: (at submit) by debbugs.gnu.org; 16 Mar 2025 23:21:58 +0000 Received: from localhost ([127.0.0.1]:51226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttxIq-0006rb-3L for submit@debbugs.gnu.org; Sun, 16 Mar 2025 19:21:57 -0400 Received: from lists.gnu.org ([2001:470:142::17]:59500) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttxIl-0006pm-MC for submit@debbugs.gnu.org; Sun, 16 Mar 2025 19:21:53 -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 1ttxIg-0006i7-7Y for guix-patches@gnu.org; Sun, 16 Mar 2025 19:21:46 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ttxIe-000109-Eg for guix-patches@gnu.org; Sun, 16 Mar 2025 19:21:45 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-54995620c02so536918e87.0 for ; Sun, 16 Mar 2025 16:21:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742167301; x=1742772101; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Rjo3bQF70Gh6Rp8rPzA/Hlo1lAAnYLvx08okQxoIbGo=; b=FE8c+YAdYoX4MybbEumYFeYdJAROtNlX1NTYsYJY0xg3PyaRm73mRFgoIDxFN3PHkg VbnHZxx2r7bBtaSFWrgrImKqnQM41EBN4kvnrmqgECWGvbrr4lDyPeYHpWj8js7pwqVL DTMLwsJ0Tc1LYjRkOQ7g63aLQxKi0TQQC3b2QstRZwA8AucwwKyhMctCaRXQyYDP2E5Y esZNdvpvIZQQiqyFAaazm0++V5cxstDuI65bMF+badT26HPdG7Fil9/zJm+ph10h0j6E feHhW4R8G587s6aYNvXXJ7wSqPAoaSU7bSgK1l6jQji4BeMTe+XIaNhe8SkOJfgIyRPH 8L8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742167301; x=1742772101; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Rjo3bQF70Gh6Rp8rPzA/Hlo1lAAnYLvx08okQxoIbGo=; b=dITuGe3HoGVhhnMwRoqOaeuhCDxlr03JnE1xzEYGa11ihVVfdLU5ZRzY1r23g1tRGP LAA7/zffBdtyVMpQ5xTsVD4qsc7xoyS58AFKBhMZ5ODCk/wuKMlkZYzb+ckpiA4QHi4b DfU3VgymHnWnuC+uVk6NAZlUnFj6vAJiKFOOtRY+OsBBBKAQTjbuEIwdTef5k4h/BSW8 C1JMvtPxJrZV928n5gujyvnBy1G9jgBLjHkm4zZJtBEGIxjTijfyij4Orae96BfRZIfN nISsFYn13B/n5kss3ZzDiAXxYmbp5Y0s9dZ/owVGWktOIWMlvo0S21V4Nh/JoluE7ZV2 2Bng== X-Gm-Message-State: AOJu0YwuEqrii07pZJQlm6UDQhj82AA2xUmN2cSZZ2DqCBNN1VR+UI4U QYIN4MOrGLf476B6xcTx9erEneZ+j3h6cXr1BBACT6hoceva7bR7/Pwp1Sdm X-Gm-Gg: ASbGnctwU3cgufw8H9O19+PbTCpE06eldKvfyyj93ha0u04nwaEgYceK00PUX4rdXDb RtezXK7O5H2o6f+0s6ya79yMyP8C+vXUsPeAFqNfaCZv5drxO16L9pDcko4x+3PBm4Yr3ppaT7d O4ZwEvzAh5ZStQFIFlitO7BLoHCdXZUX4QIUG32/bZ47SrY/gKs4yv5EZwZRAQrt9JgltK651s0 6U2Np2jlWFSvsjrT635QJx9DZCvcA3VXrti7AObHyFF3y3Gl3hno8pBwoLstLFrXYaOQMyVIAnH U64h+0J5Kwt1HPz1yKQRJnMdQgkEW0/VDMFi750= X-Google-Smtp-Source: AGHT+IEEb8HdH3DP3Yf+vyv/GTQ968khxcWQrs/9LazSnIiwYfPY4lteHvmF6nBlyZn7vv3YN2xPYA== X-Received: by 2002:a05:6512:b9e:b0:549:8faf:e21b with SMTP id 2adb3069b0e04-549c38e177emr1840088e87.5.1742167300988; Sun, 16 Mar 2025 16:21:40 -0700 (PDT) Received: from localhost.localdomain ([2a00:1370:8182:fe96:1ce8:a846:2e2d:3fa]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-549ce032a56sm329042e87.78.2025.03.16.16.21.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Mar 2025 16:21:39 -0700 (PDT) From: "Adam <>" X-Google-Original-From: Adam <> Date: Sun, 16 Mar 2025 16:21:23 -0700 Message-ID: <20250316232123.318-1-user@home> X-Mailer: git-send-email 2.48.1.windows.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=adam.quandour@gmail.com; helo=mail-lf1-x134.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FROM_NO_USER=0.798, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Adam Quandour --- doc/guix-cookbook.texi | 46 ++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi index d9b98a2..51e30d1 100644 --- a/doc/guix-cookbook.texi +++ b/doc/guix-cookbook.texi @@ -1722,43 +1722,27 @@ this, it is not actually easy to include a custom kernel configuration from the definition, but don't worry, there are other ways to work with what we do have. There are two ways to create a kernel with a custom kernel configuration. The -first is to provide a standard @file{.config} file during the build process by -including an actual @file{.config} file as a native input to our custom -kernel. The following is a snippet from the custom @code{'configure} phase of -the @code{make-linux-libre} package definition: +first is to provide a standard @file{defconfig} to @code{customize-linux} +procedure. To produce such file you need to obtain Linux source code, create a +@file{.config} file (using @code{make menuconfig} command, for example) or +provide one you already have. After that you will need to run +@code{make savedefconfig} command within the kernel source tree - this will +produce the @file{defconfig} file which we can be used to build a custom kernel. -@lisp -(let ((build (assoc-ref %standard-phases 'build)) - (config (assoc-ref (or native-inputs inputs) "kconfig"))) - - ;; Use a custom kernel configuration file or a default - ;; configuration file. - (if config - (begin - (copy-file config ".config") - (chmod ".config" #o666)) - (invoke "make" ,defconfig))) -@end lisp - -Below is a sample kernel package. The @code{linux-libre} package is nothing -special and can be inherited from and have its fields overridden like any -other package: +Below is a sample kernel package. @lisp -(define-public linux-libre/E2140 +(define-public my-linux-libre (package - (inherit linux-libre) - (native-inputs - `(("kconfig" ,(local-file "E2140.config")) - ,@@(alist-delete "kconfig" - (package-native-inputs linux-libre)))))) + (inherit (customize-linux + #:linux linux-libre + #:defconfig + (local-file "defconfig"))))) @end lisp -In the same directory as the file defining @code{linux-libre-E2140} is a file -named @file{E2140.config}, which is an actual kernel configuration file. The -@code{defconfig} keyword of @code{make-linux-libre} is left blank here, so the -only kernel configuration in the package is the one which was included in the -@code{native-inputs} field. +In the same directory as the file defining @code{my-linux-libre} is a file +named @file{defconfig}. This way you way you can provide kernel options +you want to have in the result kernel. The second way to create a custom kernel is to pass a new value to the @code{extra-options} keyword of the @code{make-linux-libre} procedure. The