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 YMVzG7QqHWKIewAAgWs5BA (envelope-from ) for ; Mon, 28 Feb 2022 21:04:04 +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 yIXuGLQqHWJBWwAA9RJhRA (envelope-from ) for ; Mon, 28 Feb 2022 21:04:04 +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 331B413BD8 for ; Mon, 28 Feb 2022 21:04:04 +0100 (CET) Received: from localhost ([::1]:36244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOmFX-0008Sx-2c for larch@yhetil.org; Mon, 28 Feb 2022 15:04:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOmEZ-0007bI-63 for bug-guix@gnu.org; Mon, 28 Feb 2022 15:03:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOmEY-0006mE-9U for bug-guix@gnu.org; Mon, 28 Feb 2022 15:03:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nOmEY-00040k-6R for bug-guix@gnu.org; Mon, 28 Feb 2022 15:03:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#40998: Guix System's initrd doesn't honor rootflags Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 20:03: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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164607857615400 (code B ref 40998); Mon, 28 Feb 2022 20:03:02 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 20:02:56 +0000 Received: from localhost ([127.0.0.1]:34847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOmES-00040K-0Q for submit@debbugs.gnu.org; Mon, 28 Feb 2022 15:02:56 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:36732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOmEQ-000407-F2 for 40998@debbugs.gnu.org; Mon, 28 Feb 2022 15:02:54 -0500 Received: by mail-qv1-f50.google.com with SMTP id w7so14487242qvr.3 for <40998@debbugs.gnu.org>; Mon, 28 Feb 2022 12:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=ajFrTYLisSdNNxrytyHgyEVt8xQSUsJQcg40We5D53k=; b=AIuyl4Iw9NUhN7HSTjKHJPSvcGLGLOExRdeQ1hCqYcWhsrCKWX/iTBxYySlg0fCmM/ PihpBtJCNqRjNRarw3cVARGOocHmQUcTj4cOrIuxxfZH92cv85w/Mzkp1fcaj+DnUr3A Owir1zCTWdCJY/5DeTfCiZTWDSBpArGG/qu6H+jzW7hpHkY0la21aRmCSuxI2Kgl4Sor 9ZPBLqnwPdRDfVC2C9C+bqhkfQV6w/pifkUe41dR7rAmdaj7KcVS1BWLJJag+fyjxDa1 40s6lr6iRAEIqlrV1epRNzQkH2eUViZr+REcpYZFpBA7Kj3Dko3S7tctsL18QJjxmodX dYNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=ajFrTYLisSdNNxrytyHgyEVt8xQSUsJQcg40We5D53k=; b=AlBdY4FJMiiosGkcDS4Tlh/sNDwTcd352DEI77mmH/NJ6GeckmnBGLwdrO33OKNp7d T8Crzqt9B1LfunNHETCmRi4wpcnn6qQU3EJzSeH+2wFIx9DyuJ9eRqYpscWeMSMPgRXG vnbVr0b/++MYhurXxsX/A+ysp0f06OdxYecx2QSc37r0NCwB6Cxpb3OlAN+K7eog1ohp pSAkr+HidGI+ih3jL5dT/W74sVRNJd2zLiLFdEObG54HQTWVZkl9xYwEsghHoyQ/XaQt ApfgimUznwfD04t6z3PdwA3TNmQvE4rZTTrPEnLAH+J1H6fBQAJWlFzMzI3abbGUbjXW dt6g== X-Gm-Message-State: AOAM5327AQePmUNGGvgtHsqgV5lV7aA4JgA+xILEb6ldrod+BmWHX1EI hTIzQy1gG9ZsXh480wBI3qZLIo2Z+3g= X-Google-Smtp-Source: ABdhPJxM7+Cfi4m8tgAFM+nOBkKKv2mUr+5f2vbOuQMX+Ip0FfRwiTqdAEcGK9dMtJCy4/vJ8YKn7A== X-Received: by 2002:a05:622a:1704:b0:2de:625:5e41 with SMTP id h4-20020a05622a170400b002de06255e41mr17723187qtk.452.1646078568644; Mon, 28 Feb 2022 12:02:48 -0800 (PST) Received: from hurd (dsl-141-227.b2b2c.ca. [66.158.141.227]) by smtp.gmail.com with ESMTPSA id x19-20020ae9e913000000b00648e98be8casm5447777qkf.13.2022.02.28.12.02.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:02:48 -0800 (PST) From: Maxim Cournoyer 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> Date: Mon, 28 Feb 2022 15:02:47 -0500 In-Reply-To: <87lexwuj27.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sun, 27 Feb 2022 21:54:24 +0100") Message-ID: <87bkyqu5co.fsf@gmail.com> 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-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=1646078644; 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:dkim-signature; bh=ajFrTYLisSdNNxrytyHgyEVt8xQSUsJQcg40We5D53k=; b=Ptna8CyBYE/p3mBXr3BqA6Ak0sC8Ho+T3NV4TYgFh8sW+CM1JAxxXmlKnmoqaGpPjFAL7r RnZfgjrPfRJlvRVmp5ZJDEwgUD4omWvFjWMAkLhC5PcjTc5xolRDG8ko3D6d9sRkVCdbgv n49X9bs38zA7c2F+dxMU7LIQeH1wsDn8wOzgzaPqaT/7BtFAebD7u7eA1ir9Vdu1ygDCuy 0Bba9pcFrABrL10USaL/6eoAStFbNn0xiRF7JslYtUUD8BBxm5bkGNcFJ5DgtoFCR+8dMw Bi1jL2DUf2C9Hc+Sj8EhptT/M4JusE1/+2vlHcCkUmudERz3hImed4DrJitLXQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646078644; a=rsa-sha256; cv=none; b=tXl3sVlm23rzGWfP/VOsISggcHLA52WZAQReDxoXZY/1zXctPqVxNCCM5G9QW5cmvb3YgK YV0PWSORcDboidPrY1c89xqKEP42btc0Z8zjQic+w7a4w1tToW9UNLJOfZLUBTqAOcSTZM QyqE6ku3y6bbq8OolU7jQIuB4C+qrKoxdtbb63FnJ0VG/7Wwx9wxZ04RWxnB+FhJ1NrGpX kvQALoUUNT70j19wuGTSdCtwFRWJnBw64oJ99D6THgwfcpA0UqXD1b6GOXsO8vo4ObU8bF eA/c+64KoSxxzF6xPJmEdYRxUgN6bMKaNlkcRMVFH0Hw5hniQBC5F6leUw9shA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=AIuyl4Iw; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: 5.81 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=AIuyl4Iw; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: 331B413BD8 X-Spam-Score: 5.81 X-Migadu-Scanner: scn1.migadu.com X-TUID: +OhpkfHFRpuD Hi Ludovic! Ludovic Court=C3=A8s writes: > Hi! > > Maxim Cournoyer skribis: > >> This version field exposes the (already present) version information of = a boot >> parameters file. >> >> * gnu/system.scm (%boot-parameters-version): New variable. >> ()[version]: New field. >> (read-boot-parameters): Use it. >> (operating-system-boot-parameters-file): Likewise. >> * tests/boot-parameters.scm (test-read-boot-parameters): Use >> %boot-parameters-version as the default version value in the template. > > [...] > >> (define-record-type* >> boot-parameters make-boot-parameters boot-parameters? >> (label boot-parameters-label) >> @@ -322,7 +326,9 @@ (define-record-type* >> (kernel boot-parameters-kernel) >> (kernel-arguments boot-parameters-kernel-arguments) >> (initrd boot-parameters-initrd) >> - (multiboot-modules boot-parameters-multiboot-modules)) >> + (multiboot-modules boot-parameters-multiboot-modules) >> + (version boot-parameters-version ;positive integer >> + (default %boot-parameters-version))) > > [...] > >> (match (read port) >> - (('boot-parameters ('version 0) >> + (('boot-parameters ('version (? version? version)) >> ('label label) ('root-device root) >> ('kernel kernel) >> rest ...) >> (boot-parameters >> + (version version) >> (label label) >> (root-device (device-sexp->device root)) > > There=E2=80=99s no need to have a =E2=80=98version=E2=80=99 field in live= > records: have the =E2=80=98version=E2=80=99 field in the serialized forma= t (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. 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 'ro= ot' and 'gnu.load' to the returned file (since the returned file is then us= ually stored into the content-addressed "system" directory, it's usually not a good idea to give it because the content hash would change by the conte= nt hash being stored into the "parameters" file). So, unless we were to pack 'read-boot-parameters' with unrelated duties and a 'system-kernel-arguments?' argument, it seems unavoidable to expose the 'version' metadata. > (It might be that you can even do that without bumping the version > number. Bumping is clearer but the downside is that an older Guix will > abort when attempting to read =E2=80=98parameters=E2=80=99. This could h= appen if you > roll back to an earlier generation and try to run =E2=80=98guix system > reconfigure=E2=80=99 or similar from 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). Let me know what you think! Thank you, Maxim