From patchwork Sun Aug 4 03:13:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lilah Tascheter X-Patchwork-Id: 66639 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 A4AC627BBEA; Sun, 4 Aug 2024 04:17:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, 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 E124527BBE2 for ; Sun, 4 Aug 2024 04:17:08 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1saRjg-0003k4-Sz; Sat, 03 Aug 2024 23:16:44 -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 1saRjf-0003ja-At for guix-patches@gnu.org; Sat, 03 Aug 2024 23:16:43 -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 1saRjf-0002Mc-1X for guix-patches@gnu.org; Sat, 03 Aug 2024 23:16:43 -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:References:In-Reply-To:Date:From:To:Subject; bh=nSh94YDMUPuaeE6kwLDSGjbptFIlIrKN0BZyuy3XTms=; b=Xn6/+W5VHiNXNVdbF9Gg1K9q8oB0ari+9UYIi+/FSVlppmNMo0Py+y6JP9OA/6X2FKVvY4AusJBumG8BGd4Q1zhaPXiemg15zFk0LNP6uvOfvrsYqn4piOTKqdVTpFimU3mOC4kKN16MDuGl25q+RepUJRxn7H3IXdBm287BF0f+535HfNBafWHXJzoZVpaKsFV1zmmBezNIeN4qxAcMjvPEtRgi6XybaBRAqsIHqlmaAMyFXisoIt9wwDXBuc2fM3+UW1QQHBMGlxtFEc6TRqTkSf+QCyvxfpncVyi5Q70upmSqwDiJIaPc5IN2WjpEhZuNnujQftvq035MQ64nSw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1saRjz-0007n9-Eg for guix-patches@gnu.org; Sat, 03 Aug 2024 23:17:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v3 03/12] Also move boot-parameters->menu-entry. Resent-From: Lilah Tascheter Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Aug 2024 03:17: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.172274137029641 (code B ref 69343); Sun, 04 Aug 2024 03:17:03 +0000 Received: (at 69343) by debbugs.gnu.org; 4 Aug 2024 03:16:10 +0000 Received: from localhost ([127.0.0.1]:54990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saRj8-0007i0-11 for submit@debbugs.gnu.org; Sat, 03 Aug 2024 23:16:10 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:51704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saRj5-0007h6-W4 for 69343@debbugs.gnu.org; Sat, 03 Aug 2024 23:16:08 -0400 DKIM-Signature: a=rsa-sha256; b=p+hUvS8Xu2XM3odq+GQkkzndbUH17xgCGlJVOjEf0LXKxCit1uHG7TiJP4BcnQzstOdLGdDyTHQFNGC5RakWfPki4FVginF0e85VIRipUrOHrDWHy4A08FOZWquEiqzZ9RtCVNIdyi5kGKTKRFusPlY75Ul4P7bUdEfWMu+FGn2GQ5cPpH4RJ9xms/WcJYKlfTExcRn2PASFhWuoQE/57SpT4WqATl7e0Iu8QgcK5FEJzjBkcCyuf4tb5WeF3NIxZf9UzFooPoQX9LDNplJCurwzqJhoEvUcJfcNR2fh8RfwGhh2dbBI8RrCvqm3kLcr2AWHd8bOMEJc7Ixqtr6Jtg==; s=purelymail2; d=lunabee.space; v=1; bh=jy/kU1dLT9HOtgJ0JkSUOAOHJKl09vrJf8Tl6mXh85Q=; h=Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=eHjt6bbt466xWrBtW0kTZOohgjmXG///hFzMdW4LfoS2/58/weiz69/Uar0vsDbdhpuaZPmxrrqYHoIu1mD/Hrj2ROwg4WtUeMqVKmmm32NAiwTxl5HtPInUniofs3+pw9GkDlkAXqzXXPpFVqrVbkK18PeyvZc0xQCXFHUeZopVa8IjsgWfEhnmwPjpYjZnnzXGRN90QCiAPkg/cCX6DwSz+Qvua+9y1dkdAZ+UtSiFihmYYREmkcqmVo8d3wk81+wtnbWU7/bqy354FaKZmgvvYISlBpTFjhWkZexDjVGjPGRokZyv4K1aGrJlpwUG5X9akd5y5YJguh4Re5GWjQ==; s=purelymail2; d=purelymail.com; v=1; bh=jy/kU1dLT9HOtgJ0JkSUOAOHJKl09vrJf8Tl6mXh85Q=; h=Feedback-ID:Received:From:To:Subject:Date; Feedback-ID: 8937:2070:null:purelymail X-Pm-Original-To: 69343@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -2124817350; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 04 Aug 2024 03:15:36 +0000 (UTC) Date: Sat, 3 Aug 2024 22:13:25 -0500 Message-ID: <9f0909b3323fd6dda448e7c9b36f9c46115dc778.1722741214.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 2e4b10e2fb..4a084b2ecf 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -151,8 +151,6 @@ (define-module (gnu system) hurd-default-essential-services - boot-parameters->menu-entry - local-host-aliases ;deprecated %root-account %setuid-programs @@ -314,32 +312,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 7bae9d2102..df27b8aea4 100644 --- a/gnu/system/boot.scm +++ b/gnu/system/boot.scm @@ -70,6 +70,8 @@ (define-module (gnu system boot) read-boot-parameters-file bootable-kernel-arguments + boot-parameters->menu-entry + ensure-not-/dev system-linux-image-file-name)) @@ -294,6 +296,28 @@ (define* (bootable-kernel-arguments system root-device version) #~(string-append (if #$version>0? "gnu.load=" "--load=") #$system "/boot"))))) +(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 @@ -314,5 +338,4 @@ (define* (system-linux-image-file-name #:optional ((string-prefix? "riscv64" target) "Image") (else "bzImage"))) - ;;; boot.scm ends here