From patchwork Fri Mar 8 08:11:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lilah Tascheter X-Patchwork-Id: 61515 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 CCDA827BBE2; Fri, 8 Mar 2024 08:26:17 +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=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no 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 D189F27BBE9 for ; Fri, 8 Mar 2024 08:26:16 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riVXz-0003xe-Lz; Fri, 08 Mar 2024 03:25:43 -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 1riVXr-0003tz-EJ for guix-patches@gnu.org; Fri, 08 Mar 2024 03:25:36 -0500 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 1riVXn-00017f-JD for guix-patches@gnu.org; Fri, 08 Mar 2024 03:25:33 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1riVYJ-0002da-7v for guix-patches@gnu.org; Fri, 08 Mar 2024 03:26:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v2 03/12] Also move boot-parameters->menu-entry. Resent-From: Lilah Tascheter Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Mar 2024 08:26:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69343 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69343@debbugs.gnu.org Cc: Felix Lechner Received: via spool by 69343-submit@debbugs.gnu.org id=B69343.17098863169856 (code B ref 69343); Fri, 08 Mar 2024 08:26:03 +0000 Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:16 +0000 Received: from localhost ([127.0.0.1]:56372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riVXX-0002Yp-MH for submit@debbugs.gnu.org; Fri, 08 Mar 2024 03:25:16 -0500 Received: from sendmail.purelymail.com ([34.202.193.197]:44420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riVXR-0002Xh-Pf for 69343@debbugs.gnu.org; Fri, 08 Mar 2024 03:25:12 -0500 DKIM-Signature: a=rsa-sha256; b=NYjvTWOoNOHhobAvEz2lexrd02AD9HC6rlcjEnVLFvkkOHYsCL+RX1YU3bfvgIAoCgPTGB7WUF/gYr8K3F44C3yRJKSH873Gw1ZvVpGwc1iU0bIhd3xNPBfNX/U/3tG1jW9tq+oaCWgVm522fgXPqnVWCI9qo78supkvdU1GATnjNcfFigK6StSDQIjbKXO2POcN+Q5w4feAVTcgIK/kXqA0OingClJy56YGYPW+FlcKXwx5vqlliU+upajFOVS1dEENuwCr/3wggxaWGwvkIQMoDEp26ihV8zocWsDrnSxhG8pqSz9gIyKMt08HCCI5moqqtpJMhxkBzRlOM1iUNA==; s=purelymail2; d=lunabee.space; v=1; bh=/VJhDQboy/jow/7qyOsO5u1Zdw4fsR4EolZBMKglkVY=; h=Received:From:To:Subject; DKIM-Signature: a=rsa-sha256; b=IdIhwC0pornuvEjfXN/L3xm+Dx18ygeWnHXFLnABey5XTPsL6+DlMIMyEk2BKvxasB1e/Uhiuwd4G4CJMQE5BQnU/R8kPpHAF3HitSaBlmsaGHlC06qsfdStWEIalvnrjSQ2fTQSlwybPsLNBF9f+16PsbwIsndWRQ8Cj9fWaPRrk/3SuRwNvZz/8JbOm3ScJgvbxqtVsLu2+QelyjojicXXneAnfyrcVqadnsS11qXzvtxOBjgpEzfBIx7Vt+8hcgK8SyykDeCZJS7O43DyU9SYT5FLm3Y6h/hMdH97JDhg+aF1TXR8/8PUYdvld401ZqNpNyeWXv6n3RtX6l1HCw==; s=purelymail2; d=purelymail.com; v=1; bh=/VJhDQboy/jow/7qyOsO5u1Zdw4fsR4EolZBMKglkVY=; h=Feedback-ID:Received:From:To:Subject; Feedback-ID: 8937:2070:null:purelymail X-Pm-Original-To: 69343@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 08 Mar 2024 08:24:18 +0000 (UTC) Date: Fri, 8 Mar 2024 02:11:59 -0600 Message-ID: <3ea3ac3e5c436726d19ea4df603f88d0bc861c2e.1709885528.git.lilah@lunabee.space> In-Reply-To: References: MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail 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: , X-Patchwork-Original-From: Lilah Tascheter via Guix-patches From: Lilah Tascheter Reply-To: Lilah Tascheter 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: Felix Lechner * gnu/system.scm (boot-parameters->menu-entry): Move to... * gnu/system/boot.scm (boot-parameters->menu-entry): ...here. Change-Id: I794198e074b6d3012526a3056599ee3db1f1cdba --- gnu/system.scm | 28 ---------------------------- gnu/system/boot.scm | 25 ++++++++++++++++++++++++- 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index 048f9090e0..11f8e06cc0 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -149,8 +149,6 @@ (define-module (gnu system) hurd-default-essential-services - boot-parameters->menu-entry - local-host-aliases ;deprecated %root-account %setuid-programs @@ -303,32 +301,6 @@ (define* (operating-system-kernel-arguments (append (bootable-kernel-arguments os root-device version) (operating-system-user-kernel-arguments os))) - -;;; -;;; Boot parameters -;;; - -(define (boot-parameters->menu-entry conf) - "Return a instance given CONF, a instance." - (let* ((kernel (boot-parameters-kernel conf)) - (multiboot-modules (boot-parameters-multiboot-modules conf)) - (multiboot? (pair? multiboot-modules))) - (menu-entry - (label (boot-parameters-label conf)) - (device (boot-parameters-store-device conf)) - (device-mount-point (boot-parameters-store-mount-point conf)) - (linux (and (not multiboot?) kernel)) - (linux-arguments (if (not multiboot?) - (boot-parameters-kernel-arguments conf) - '())) - (initrd (boot-parameters-initrd conf)) - (multiboot-kernel (and multiboot? kernel)) - (multiboot-arguments (if multiboot? - (boot-parameters-kernel-arguments conf) - '())) - (multiboot-modules (if multiboot? - (boot-parameters-multiboot-modules conf) - '()))))) ;;; diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm index 3f227ab801..a3b9cce7d2 100644 --- a/gnu/system/boot.scm +++ b/gnu/system/boot.scm @@ -69,6 +69,8 @@ (define-module (gnu system boot) read-boot-parameters read-boot-parameters-file + boot-parameters->menu-entry + ensure-not-/dev system-linux-image-file-name)) @@ -272,6 +274,28 @@ (define (read-boot-parameters-file system) (kernel-arguments (append (bootable-kernel-arguments system root version) (boot-parameters-kernel-arguments params)))))) +(define (boot-parameters->menu-entry conf) + "Return a instance given CONF, a instance." + (let* ((kernel (boot-parameters-kernel conf)) + (multiboot-modules (boot-parameters-multiboot-modules conf)) + (multiboot? (pair? multiboot-modules))) + (menu-entry + (label (boot-parameters-label conf)) + (device (boot-parameters-store-device conf)) + (device-mount-point (boot-parameters-store-mount-point conf)) + (linux (and (not multiboot?) kernel)) + (linux-arguments (if (not multiboot?) + (boot-parameters-kernel-arguments conf) + '())) + (initrd (boot-parameters-initrd conf)) + (multiboot-kernel (and multiboot? kernel)) + (multiboot-arguments (if multiboot? + (boot-parameters-kernel-arguments conf) + '())) + (multiboot-modules (if multiboot? + (boot-parameters-multiboot-modules conf) + '()))))) + (define (ensure-not-/dev device) "If DEVICE starts with a slash, return #f. This is meant to filter out Linux device names such as /dev/sda, and to preserve GRUB device names and @@ -292,5 +316,4 @@ (define* (system-linux-image-file-name #:optional ((string-prefix? "riscv64" target) "Image") (else "bzImage"))) - ;;; boot.scm ends here