From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6HfrIrYEw16PUAAA0tVLHw (envelope-from ) for ; Mon, 18 May 2020 21:57:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id sNbSHrYEw14fBQAA1q6Kng (envelope-from ) for ; Mon, 18 May 2020 21:57:10 +0000 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 617E39400F4 for ; Mon, 18 May 2020 21:57:09 +0000 (UTC) Received: from localhost ([::1]:38518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jankw-0006w2-No for larch@yhetil.org; Mon, 18 May 2020 17:57:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jankt-0006vm-Js for guix-patches@gnu.org; Mon, 18 May 2020 17:57:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1janks-0005xT-KW for guix-patches@gnu.org; Mon, 18 May 2020 17:57:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1janks-00027Z-ID for guix-patches@gnu.org; Mon, 18 May 2020 17:57:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#37305] [PATCH v3] Allow booting from a Btrfs subvolume Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 18 May 2020 21:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37305 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: Pierre Neidhardt , 37305@debbugs.gnu.org Received: via spool by 37305-submit@debbugs.gnu.org id=B37305.15898389618067 (code B ref 37305); Mon, 18 May 2020 21:57:02 +0000 Received: (at 37305) by debbugs.gnu.org; 18 May 2020 21:56:01 +0000 Received: from localhost ([127.0.0.1]:48481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1janjt-00025z-36 for submit@debbugs.gnu.org; Mon, 18 May 2020 17:56:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1janjs-00025k-63 for 37305@debbugs.gnu.org; Mon, 18 May 2020 17:56:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37755) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1janjm-0005rp-5x; Mon, 18 May 2020 17:55:54 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=50968 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1janjl-0006Hs-AA; Mon, 18 May 2020 17:55:53 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <875zg2xtsb.fsf@gmail.com> <87lfoxbn2e.fsf@gnu.org> <87v9n1pts1.fsf@raisin.i-did-not-set--mail-host-address--so-tickle-me> <87o8qmheqm.fsf@ambrevar.xyz> <874ksebkup.fsf_-_@gmail.com> Date: Mon, 18 May 2020 23:55:50 +0200 In-Reply-To: <874ksebkup.fsf_-_@gmail.com> (Maxim Cournoyer's message of "Sun, 17 May 2020 12:13:34 -0400") Message-ID: <87y2pohpqx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) 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" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: LEp6h3VNi2yQ Hi Maxim, Sorry for dropping the ball for sooo long. Maxim Cournoyer skribis: >>>From b03a574ad565b34bbe8a7d3d0322591850984dc6 Mon Sep 17 00:00:00 2001 > From: Maxim Cournoyer > Date: Tue, 11 Feb 2020 14:00:06 -0500 > Subject: [PATCH 2/4] linux-boot: Refactor boot-system. > > The --root option can now be omitted, and inferred from the root file sys= tem > declaration instead. > > * gnu/build/file-systems.scm (canonicalize-device-spec): Extend to suppor= t NFS > directly, and... > * gnu/build/linux-boot.scm (boot-system): ...remove NFS special casing fr= om > here. Remove nested definitions for root-fs-type, root-fs-flags and > root-fs-options, and bind those inside the let* instead. Make "--root" t= ake > precedence over the device field string representation of the root file > system. > * doc/guix.texi (Initial RAM Disk): Document that "--root" can be left [...] > +++ b/gnu/build/linux-boot.scm > @@ -498,25 +498,13 @@ upon error." > (define (root-mount-point? fs) > (string=3D? (file-system-mount-point fs) "/")) >=20=20 > - (define root-fs-type > - (or (any (lambda (fs) > - (and (root-mount-point? fs) > - (file-system-type fs))) > - mounts) > - "ext4")) > - > - (define root-fs-flags > - (mount-flags->bit-mask (or (any (lambda (fs) > - (and (root-mount-point? fs) > - (file-system-flags fs))) > - mounts) > - '()))) > - > - (define root-fs-options > - (any (lambda (fs) > - (and (root-mount-point? fs) > - (file-system-options fs))) > - mounts)) [...] > + (root-fs (find root-mount-point? mounts)) > + (root-fs-type (or (and=3D> root-fs file-system-type) > + "ext4")) > + (root-fs-device (and=3D> root-fs file-system-device)) > + (root-fs-flags (mount-flags->bit-mask > + (or (and=3D> root-fs file-system-flags) > + '()))) > + (root-options (if root-fs > + (file-system-options root-fs) > + #f)) I would tend to keep these as defines to make the =E2=80=98let*=E2=80=99 le= ss intimidating, but it=E2=80=99s a detail. > + ;; XXX: Importing (guix utils) and using &fix-hint causes the > + ;; following error when booting the init RAM disk: "ERROR: In > + ;; procedure dynamic-func:\nIn procedure dynamic-pointer: Symbol= not > + ;; found: strverscmp", so we just embed the hint in the message. I think it should just be =E2=80=9CFIXME: Use &fix-hint once it no longer p= ulls in (guix utils).=E2=80=9D >>>From 082934db68964890ebd2a2118fb44d66911844d3 Mon Sep 17 00:00:00 2001 > From: Maxim Cournoyer > Date: Sun, 14 Jul 2019 20:50:23 +0900 > Subject: [PATCH 4/4] bootloader: grub: Allow booting from a Btrfs subvolu= me. > > * gnu/bootloader/grub.scm (strip-mount-point): Remove procedure. > (normalize-file): Add procedure. > (grub-configuration-file): New BTRFS-SUBVOLUME-FILE-NAME parameter. When > defined, prepend its value to the kernel and initrd file names, using the > NORMALIZE-FILE procedure. Adjust the call to EYE-CANDY to pass the > BTRFS-SUBVOLUME-FILE-NAME argument. Normalize the KEYMAP file as well. > (eye-candy): Add a BTRFS-SUBVOLUME-FILE-NAME parameter, and use it, along= with > the NORMALIZE-FILE procedure, to normalize the FONT-FILE and IMAGE nested > variables. Adjust doc. > * gnu/bootloader/depthcharge.scm (depthcharge-configuration-file): Adapt. > * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Likewise. > * gnu/system/file-systems.scm (btrfs-subvolume?) > (btrfs-store-subvolume-file-name): New procedures. > * gnu/system.scm (operating-system-bootcfg): Specify the Btrfs > subvolume file name the store resides on to the > `operating-system-bootcfg' procedure, using the new > BTRFS-SUBVOLUME-FILE-NAME argument. > * doc/guix.texi (File Systems): Add a Btrfs subsection to document the us= e of > subvolumes. > * gnu/tests/install.scm: Add test "btrfs-root-on-subvolume-os". Please list the entities added to =E2=80=98install.scm=E2=80=99. > (define* (eye-candy config store-device store-mount-point > + btrfs-store-subvolume-file-name > #:key system port) I think =E2=80=98btrfs-store-subvolume-file-name=E2=80=99 should be a keywo= rd argument. > (define* (grub-configuration-file config entries > #:key > (system (%current-system)) > - (old-entries '())) > + (old-entries '()) > + btrfs-subvolume-file-name) I wonder if we should just call it =E2=80=98store-directory-prefix=E2=80=99= or similar since, after all, it=E2=80=99s just about prepending a prefix, which could perhaps be useful for file systems other than Btrfs. Thoughts? Anyway, that=E2=80=99s great work, so I=E2=80=99ll be happy to finally see = it committed in the coming days! Ludo=E2=80=99.