From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8NaBG507HWJS0QAAgWs5BA (envelope-from ) for ; Mon, 28 Feb 2022 22:16:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cFLyGJ07HWK8DgEA9RJhRA (envelope-from ) for ; Mon, 28 Feb 2022 22:16:13 +0100 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 B09E515D92 for ; Mon, 28 Feb 2022 22:16:12 +0100 (CET) Received: from localhost ([::1]:52332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOnNL-00009L-RN for larch@yhetil.org; Mon, 28 Feb 2022 16:16:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOnNC-000099-RW for bug-guix@gnu.org; Mon, 28 Feb 2022 16:16:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40985) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOnNC-0000OU-JF for bug-guix@gnu.org; Mon, 28 Feb 2022 16:16:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nOnNC-0005pU-7x for bug-guix@gnu.org; Mon, 28 Feb 2022 16:16:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#40998: Guix System's initrd doesn't honor rootflags Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 21:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Maxim Cournoyer Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164608293122365 (code B ref 40998); Mon, 28 Feb 2022 21:16:02 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 21:15:31 +0000 Received: from localhost ([127.0.0.1]:34882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOnMh-0005of-BL for submit@debbugs.gnu.org; Mon, 28 Feb 2022 16:15:31 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:45540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOnMc-0005oO-Uh for 40998@debbugs.gnu.org; Mon, 28 Feb 2022 16:15:30 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 45F8B2E6; Mon, 28 Feb 2022 22:15:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ugZ3dgvGmYTK; Mon, 28 Feb 2022 22:15:17 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 599F5BD; Mon, 28 Feb 2022 22:15:17 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87r1w3kbi0.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <20220219070155.1924-1-maxim.cournoyer@gmail.com> <87lexwuj27.fsf_-_@gnu.org> <87bkyqu5co.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 10 =?UTF-8?Q?Vent=C3=B4se?= an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 28 Feb 2022 22:15:17 +0100 In-Reply-To: <87bkyqu5co.fsf@gmail.com> (Maxim Cournoyer's message of "Mon, 28 Feb 2022 15:02:47 -0500") Message-ID: <87fso2bsm2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / X-Rspamd-Server: hera X-Rspamd-Queue-Id: 45F8B2E6 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 40998@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646082973; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=iFqRx6p0YMmltWGxe5VtVnNg0bnZpRpzKDLRdIaJ81g=; b=eXUEwq3jl1Wf9kF3dDX33qneXxOqDIZfPvAJoPG3RVsxLkH8ROsi/XoBrtMGQDqZq+7o8Y Cr3SJZo8DXb6IHFbjaS1K4Htrm/6ebQFlauVXYx50ihwszQz7hqZYr/w4Pgz9qh0emq6dB OYR05TbOyhgb6ImSNIVBBv4C7QFSVredMrXveKVThR6XOjShlIMk//XIubZaj9grT7Cgm+ hEm81Qd91znUs1XrIX3E+WMjz3b0U0jBPyUzw1JYIgAP0XY+BoUIcr4LrBFg74UugA8K3E njgvHSa0IuHJtTRTVl8D+nj6gZVEvLRqUVESDsdzaF3en+bgAXLD3EThAwu8qw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646082973; a=rsa-sha256; cv=none; b=jjUpRdI674HLPP1bL/BbG6XYtWLI05U6r7VjXVliO9QRemnP0aNr2ahfbHXTck7GwAw041 IEV73S5j9nL+0Q43IoXxdBrUBIdwFGf8WdKTwHce+0ew6TnmmGhUTLjNdWsDLHQXUkLWUc Bsu4AwCxLyFt+igYTVQEE62tw+jFIxIhaqT4Qe8FErcawmHRpkbnGYP53VfHAJBr9oEwKX UWJezn8WkKQ4qZGiTul7kj209+ScdFhcSPdvs+CuxlNmZQHzedJRq+vQvbkeZ0T0lVori7 yGy0/dn762sWoo7NQIeJmCf2wUmVT9K+fc+YNKsRtHGbbFqvw2M9QnUqYOL1kg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.69 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B09E515D92 X-Spam-Score: -3.69 X-Migadu-Scanner: scn1.migadu.com X-TUID: WSR5QE3LoIYQ Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: [...] >> There=E2=80=99s no need to have a =E2=80=98version=E2=80=99 field in liv= e >> records: have the =E2=80=98version=E2=80=99 field in the serialized form= at (the sexp) >> and make sure the deserializer correctly converts to the internal >> representation. >> >> Here, I think you can bump the version number in the serialized form, >> and have =E2=80=98read-boot-parameters=E2=80=99 automatically augment = =E2=80=98kernel-arguments=E2=80=99 >> when VERSION is 0 with =E2=80=9C--root=3DXYZ=E2=80=9D. > > I initially went that route, as this was the idea you'd given me > initially. However, 'read-boot-parameters' deals with serializing the > parameters file only; to add 'root', 'gnu.load' and 'gnu.system', the > operating-system object as well as the root device are needed. already has =E2=80=98root-device=E2=80=99, so that=E2=80= =99s fine. But you=E2=80=99re right that the system itself is a problem because that= =E2=80=99s self-referential=E2=80=94it=E2=80=99s the thing the =E2=80=9Cparameters=E2= =80=9D file is in. Hmm! We could add a substitution mechanism where a literal =E2=80=9C$SYSTEM=E2= =80=9D (say) in the =E2=80=98kernel-arguments=E2=80=99 of would be substi= tuted by the actual system store file name by =E2=80=98read-boot-parameters=E2=80=99, bu= t maybe that=E2=80=99s overkill. So long story short: keeping the =E2=80=98version=E2=80=99 field in sounds reasonable after all. :-) > The reason 'gnu.load' and 'gnu.system' aren't written to the > parameters file to start with is because they would cause the system > directory to no longer be content-addressable; this is explained in > the docstring of 'operating-system-boot-parameters-file': > > When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments such as '= root' > and 'gnu.load' to the returned file (since the returned file is then = usually > stored into the content-addressed "system" directory, it's usually no= t a > good idea to give it because the content hash would change by the con= tent hash > being stored into the "parameters" file). This comment originates in 40fad1c24ce60076e26f6dc8096e4716d31d90c3. I find it a bit misleading because nothing=E2=80=99s =E2=80=9Ccontent-address= ed=E2=80=9D, but I guess it refers to the same problem: that this is self-referential. (There=E2=80=99s only one use of #:system-kernel-arguments? #t. We can rem= ove that keyword parameter from =E2=80=98operating-system-boot-parameters-file= =E2=80=99 since it=E2=80=99s not used there.) >> Also, you could write the =E2=80=98match=E2=80=99 pattern like this: >> >> ('boot-parameters ('version (and version (or 0 1))) >> ('label label) =E2=80=A6) > > I think this patch's current form is preferable, as it means future > boot-parameters version bumps won't break older Guices (when > reconfiguring), as long as the version is an exact, non-negative integer > (e.g. when going from 1 to 2). That=E2=80=99s what we want to avoid: bumping the version number means that= the new format is not backwards-compatible, and that older Guix versions won=E2=80=99t be able to read it. That=E2=80=99s why I think =E2=80=98read= -boot-parameters=E2=80=99 needs to be explicit about the version(s) it expects. (A more complete example of this pattern is =E2=80=98sexp->manifest=E2=80=99.) Breaking backwards compatibility should be avoided when possible, but it=E2=80=99s not always possible. In =E2=80=98read-boot-parameters=E2=80= =99, =E2=80=98bootloader-name=E2=80=99, =E2=80=98bootloader-menu-entries=E2=80=99, =E2=80=98kernel=E2=80=99, etc. a= re handled somewhat weirdly to preserve backwards-compatibility; doing this allowed us to not bump the file format version. Thanks! Ludo=E2=80=99.