From patchwork Sat Nov 12 13:59:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 7502 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 CB73B27BBEB; Sat, 12 Nov 2022 14:01: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=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_MSPIKE_H2,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 0EEC527BBE9 for ; Sat, 12 Nov 2022 14:01:28 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1otr4V-0006Zm-HZ; Sat, 12 Nov 2022 09:01:23 -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 1otr4C-0006TD-1I for guix-patches@gnu.org; Sat, 12 Nov 2022 09:01:05 -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 1otr4A-0007MG-8C for guix-patches@gnu.org; Sat, 12 Nov 2022 09:01:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1otr4A-0002l5-3Z for guix-patches@gnu.org; Sat, 12 Nov 2022 09:01:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59066] [PATCH v2] linux-initrd: raw-initrd: Add keyword argument #:pre-mount. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 12 Nov 2022 14:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59066 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: 59066@debbugs.gnu.org Received: via spool by 59066-submit@debbugs.gnu.org id=B59066.166826160610459 (code B ref 59066); Sat, 12 Nov 2022 14:01:02 +0000 Received: (at 59066) by debbugs.gnu.org; 12 Nov 2022 14:00:06 +0000 Received: from localhost ([127.0.0.1]:47588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otr3F-0002ib-TX for submit@debbugs.gnu.org; Sat, 12 Nov 2022 09:00:06 -0500 Received: from mail.boiledscript.com ([144.168.59.46]:47346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otr3E-0002hW-7K for 59066@debbugs.gnu.org; Sat, 12 Nov 2022 09:00:04 -0500 Date: Sat, 12 Nov 2022 21:59:26 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1668261597; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=FY3CIqH8L5jQrs1YCeloacAyRxA+7Hni+ld8pWsKpy8=; b=oYSElN5X4gx40Iux/G8V1NiKgtdnwHoYYYuXZIUumDrWlvqmI28ZQ2S1rM3gmjxrvk61gN Z1XxU8IOiEX6+C2qnuHZwakIOkVvgVTlPRitv3oQ74+ACXbuqNcQPXCv662caEAItIMZiC iniPBjkC6xKVSf/knyz8iXdxgGPOacVoUJgVc0BBdX2dkxeNCTlD/9AMN19w/I+0AYeB7A v9thGp4odpVz96RbIHTziMUxz7vlcEDEFxvYHMrpRM09Azwi5Orx5fu11lFgUJJjxj6/l5 pwTDZykTRFWRKcDiShrsUIIjGzfztBEr0KsFksKu7qgSJD9Hph2J80JQRERnrQ== Message-ID: In-Reply-To: <87wn81dvog.fsf@gnu.org> References: <87wn81dvog.fsf@gnu.org> MIME-Version: 1.0 X-Spamd-Bar: / Authentication-Results: mail.boiledscript.com; auth=pass smtp.mailfrom=hako@ultrarare.space 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: , Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches X-Patchwork-Original-From: Hilton Chain via Guix-patches via From: Hilton Chain 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 * gnu/system/linux-initrd.scm (raw-initrd): Add keyword argument #:pre-mount. Document it. * doc/guix.texi (initial RAM disk): Likewise. --- v1 -> v2: 1. Use gexp instead of a list. 2. Documentation. Haven't begun my SSH test yet :P doc/guix.texi | 8 +++++--- gnu/system/linux-initrd.scm | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) base-commit: 2757de2e2b271d87f6f72ba4161c2225fbdc9e78 -- 2.38.1 diff --git a/doc/guix.texi b/doc/guix.texi index 3f76184495..35eb128f6e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -37844,15 +37844,17 @@ here is how to use it and customize it further. @cindex initrd @cindex initial RAM disk @deffn {Scheme Procedure} raw-initrd @var{file-systems} @ - [#:linux-modules '()] [#:mapped-devices '()] @ - [#:keyboard-layout #f] @ - [#:helper-packages '()] [#:qemu-networking? #f] [#:volatile-root? #f] + [#:linux-modules '()] [#:pre-mount #t] [#:mapped-devices '()] @ + [#:keyboard-layout #f] [#:helper-packages '()] @ + [#:qemu-networking? #f] [#:volatile-root? #f] Return a derivation that builds a raw initrd. @var{file-systems} is a list of file systems to be mounted by the initrd, possibly in addition to the root file system specified on the kernel command line via @option{root}. @var{linux-modules} is a list of kernel modules to be loaded at boot time. @var{mapped-devices} is a list of device mappings to realize before @var{file-systems} are mounted (@pxref{Mapped Devices}). +@var{pre-mount} is a G-expression to evaluate before realizing +@var{mapped-devices}. @var{helper-packages} is a list of packages to be copied in the initrd. It may include @code{e2fsck/static} or other packages needed by the initrd to check diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 4c4c78e444..58e95a1312 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -172,6 +172,7 @@ (define* (raw-initrd file-systems #:key (linux linux-libre) (linux-modules '()) + (pre-mount #t) (mapped-devices '()) (keyboard-layout #f) (helper-packages '()) @@ -183,7 +184,8 @@ (define* (raw-initrd file-systems mounted by the initrd, possibly in addition to the root file system specified on the kernel command line via 'root'. LINUX-MODULES is a list of kernel modules to be loaded at boot time. MAPPED-DEVICES is a list of device -mappings to realize before FILE-SYSTEMS are mounted. +mappings to realize before FILE-SYSTEMS are mounted. PRE-MOUNT is a +G-expression to evaluate before realizing MAPPED-DEVICES. HELPER-PACKAGES is a list of packages to be copied in the initrd. It may include e2fsck/static or other packages needed by the initrd to check root partition. @@ -255,7 +257,8 @@ (define kodir (map spec->file-system '#$(map file-system->spec file-systems)) #:pre-mount (lambda () - (and #$@device-mapping-commands + (and #$pre-mount + #$@device-mapping-commands #$@file-system-scan-commands)) #:linux-modules '#$linux-modules #:linux-module-directory '#$kodir