From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1llpea-0007Qf-AW for mharc-grub-devel@gnu.org; Wed, 26 May 2021 05:16:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llpeY-0007Mv-SC for grub-devel@gnu.org; Wed, 26 May 2021 05:16:38 -0400 Received: from de-smtp-delivery-102.mimecast.com ([194.104.109.102]:23923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llpeW-0003mI-GT for grub-devel@gnu.org; Wed, 26 May 2021 05:16:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1622020592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zo/lRc/OIA6YFxgBXdDf0Q3LkjnxfXo8EnVw66wCfaU=; b=kHwZHMULGYnZKvZnLuol+/95F8OwJDXmsFqNRYPY2i+92lkK2WcuJglsVV62jIGeNcC3Rk FUNLBAm0FOg0Q9HjjVSqH4wtjj+CiBhVmvBovuDylU98CdxSqrpz7/22NcMN5tJavd/9OY aO2Xdi6Nwz/POfSI+u5YvnzJjYiXrtM= Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-am5eur03lp2051.outbound.protection.outlook.com [104.47.8.51]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-7-QnxfzIOoM16jcVRwpp-drg-1; Wed, 26 May 2021 11:16:30 +0200 X-MC-Unique: QnxfzIOoM16jcVRwpp-drg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z/i6HkMZ8/jPHXBAFpOOFHI2Fc2o7EHR1BoWBrSd0xIdFXKIRwY0f8SR+czYGltVLfrmRke36SY3brC+RGaqdo3xSLZhYvVNj6dt1OVfRDyvU5nMLccVezSpmSVPzAUWTqq4mmZzB0ZOjyEIaWsZgA2htoC2L3Z1CrNP5eEl1cl85LlgxhJ2V/BK6/4Plf4H4sXMaIdBgCobCe8BAFCqEiI7/6EKrOexTuXldM/uXkXU/ahFdGR2sI3FMVk+Ew0D/oq4LoE/bXb4P89Zc0F10uSrhOMbmE6igKqhMBhb2XL9GNH1wtnZ9XcRklIh5LQMoB/S2pTwcUXsVQESYDHBFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zo/lRc/OIA6YFxgBXdDf0Q3LkjnxfXo8EnVw66wCfaU=; b=AeWqUSSCUiaBbQRLLX26C8cTpGNvQAI29Rewgs1cgWgs76EOMDIa6EO0MbsZKc8KDNl6JmgYeU9mm74bBPXS1LjR8jk+42+xkisUfRUOuMCcQfAnd5s89nKDSckxPqWtb1llEgKFKB8eOz1uGfoKyt0RyE4KNzfXD5AJRijDRY1jWqKS7Ol4OK4JCjS6YsQeUUdXTZKSgeKXXv2KE58X3qWjdmy+/n9QlzdRzs6cBwmjjel3G73DLIWb2b4oN+bZ7UNNlwmbOYPK1TATihXTlW1DdwfzrLW5xAtYDckRUSgetimNAxiMIRAMkdciQ271eV3riAqb9vVed+gugyHuqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: gnu.org; dkim=none (message not signed) header.d=none;gnu.org; dmarc=none action=none header.from=suse.com; Received: from DU2PR04MB8648.eurprd04.prod.outlook.com (2603:10a6:10:2df::21) by DU2PR04MB8839.eurprd04.prod.outlook.com (2603:10a6:10:2e2::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.21; Wed, 26 May 2021 09:16:30 +0000 Received: from DU2PR04MB8648.eurprd04.prod.outlook.com ([fe80::ac9d:93ea:c7a:6033]) by DU2PR04MB8648.eurprd04.prod.outlook.com ([fe80::ac9d:93ea:c7a:6033%3]) with mapi id 15.20.4173.020; Wed, 26 May 2021 09:16:29 +0000 Date: Wed, 26 May 2021 17:16:21 +0800 From: Michael Chang To: The development of GNU GRUB Subject: Re: RFC: A partition for grubenv, etc. Message-ID: <20210526091621.GB3985@mercury> References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [36.226.124.96] X-ClientProxiedBy: HK2PR03CA0056.apcprd03.prod.outlook.com (2603:1096:202:17::26) To DU2PR04MB8648.eurprd04.prod.outlook.com (2603:10a6:10:2df::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mercury (36.226.124.96) by HK2PR03CA0056.apcprd03.prod.outlook.com (2603:1096:202:17::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.12 via Frontend Transport; Wed, 26 May 2021 09:16:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 269e5c96-a1b2-41f4-4903-08d92026f258 X-MS-TrafficTypeDiagnostic: DU2PR04MB8839: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wJ0OhW3aZR9C4DbP7bOUmbGyH6q1grpsgh0xlpwFgn6MEvrIigV/ugt0uw5D016kpQT0uEHkGkU1ElOr1h1xS802oaEwf1iUlGgxcheb0do3HWSUQncJOEj/cn2VdHZ/VTRczZjvMweyNuD7kG2mXeQ4GZ+o9/T3ltWg/59F5trqalZhNBXy8nPSw25JV8ko5iOpF2PRy6ax5c5oOeEmCo9N4NtgzrIGSqSsGvqXO3a5aq9GpxgvoK6dEf8zToc7lfqVDJwQaMGpZpogWypa7Lje3hVBkB9NWPqbeb43H4EJt49Moy2Tdvu4SM55hUDquuwUrJ6loT7XQ/ob2qmUORZqO4DbLaJqJmja27hpa0LtSEjTe7dxrwaeQZHEk9bD+82oQJIQMr1t86TCe2Z8C2E6V7js1BMEQA7sRhz4zWC7HafXgMVCZbfNqGSZ9k4ysRgOBdxyk81Kc0t+77cJcaCTgPKCK2g3TtQ7pzYyT3qvJj7HNrzqDncz/QnCy95vNrtGVCAOiEwkV5lZly1enmfmbZVc+oL6mPqFxIEhxIgyhg/n2A80hFB4Gm5Jl5S4w7I682WNNRmJBIkenO4J4S0TSVOZNmKjaMDya9mrD/Uwam0xnbpjDxVI1jRm/Q5YolA6jpooc3f2ayaUkCqZvb+px4tipvCu7iB8Pu14Fs6/+kcvWJqVcsFhCQogNmVuL9p0YomoeyXf5/k/xB6xa8KAlC30qZ2lIwidU++kg3aS1OIOSZbzcWd1ccTSDBzJoMqjboiEFAAwt5MaomWdcw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8648.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(136003)(396003)(346002)(366004)(39860400002)(66946007)(66476007)(66556008)(33656002)(5660300002)(478600001)(956004)(38100700002)(33716001)(966005)(2906002)(38350700002)(9576002)(6666004)(6916009)(316002)(86362001)(26005)(55016002)(83380400001)(9686003)(52116002)(1076003)(6496006)(8676002)(186003)(8936002)(16526019); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?JGhQR9rGImmraTUkytmUGmdeMg3BdBeEBvLQ2/yeEIghGocnOkf2Z/7UjlaB?= =?us-ascii?Q?VFnSvQHL2AbavSopThqkkIz+qwxqA8uKF90Nd4GO4aYsWhztR1RDE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flzWXFn7AwPjZHgvTk9/d2onPLB39wSADJdylxfnwQGrjaFEg/?= =?us-ascii?Q?+v4wI38IVuGtIg7oBdKKuJ4wv2mu2jcGs6FGRfetX1wEvpPlJiheyrrzM2bO?= =?us-ascii?Q?nA8hDfQi8JmMi39dpcXqlQgGxixEknds7hWJh7dHBNVQCnS8DBnFkPNzuu/P?= =?us-ascii?Q?ihBwVUy2MNppc5sQSSddp4YxMGwpuGgpuq7uuAAHEbCCu+QZxwDXzklHMXyi?= =?us-ascii?Q?Xggy/9rVtBifu7k507VbIFanVsCF0T9dzeXHE+RBkn6Dsr9AdK9uuHefpSlA?= =?us-ascii?Q?OC2BC5tU/zPd0yT6cJeORQdmwlicv7+WqbS09N2tLGw5bn6WtAznY9uWvjo1?= =?us-ascii?Q?T0+OeD67fPHY7CheJbiUGyeU?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 269e5c96-a1b2-41f4-4903-08d92026f258 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8648.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2021 09:16:29.8325 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Yp79gjKJC9uhMatwHK2wmw7EsuPc/UrfSTZpJPNsKNHDNCbc0NkQO3+mgl3WuPLO X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8839 Received-SPF: pass client-ip=194.104.109.102; envelope-from=mchang@suse.com; helo=de-smtp-delivery-102.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2021 09:16:39 -0000 On Tue, May 25, 2021 at 04:58:23PM -0600, Chris Murphy wrote: > Hi, > > It's not possible for GRUB pre-boot environment to write to grubenv > when it's on Btrfs, ZFS, LVM, mdadm raid, or LUKS. Also, at least XFS > upstream is super skeptical of anything except kernel code making any > kind of modification inside the file system region, and I suspect it's > the same concern with ext4 developers too. While there are file system > specific locations for bootloader usage, they're all different and > quite small. XFS has none. ext4 has 512 bytes. Btrfs has maybe 1 or 2 > MiB, ZFS (?), mdadm (?) and LVM (?). > > Proposal: A new partition type for MBR and GPT, functionally a > replacement for the BIOS Boot partition, but it would be a partition > owned by the bootloader for whatever it wants to use it for. It'd be > up to the bootloader to figure out how to segment it for bootloader > and environmental portions. We definitely need both MBR and GPT > partition types, it should be a partition exclusively reserved for the > bootloader. This effectively deprecates the use of the MBR gap, and > BIOS Boot partition types, and further it deprecates the use of file > systems (all of them, for consistency sake) for the use of grubenv. > > Variation: Keep BIOS Boot and repurpose it to include grubenv, while > also specifying an MBR type code for its equivalent. The grubenv should be treated as property per grub.cfg, not per image. This means that the grubenv partition may have to be divided into slots to store settings for each and every grub.cfg, and then additional data to record the change (add/removal) and identification - which sounds like to work out a filesystem. So the question is why not use filesystem writable by grub for the proposed grubenv partition ? For UEFI we already have one, the EFI System Partition. Thanks, Michael > > > Use case: For example, Fedora has a "hidden grub menu" feature where > by a variable in grubenv is reset (written to) by grub pre-boot. And > then a systemd unit changes that variable to indicate a successful > boot once some time and/or tests have been met. If grubenv indicates > successful boot, the next boot's grub menu is hidden. If it wasn't > successful the next boot's grub menu is displayed. It's only possible > to achieve this with some reliable bidirectional way of communicating > between the preboot and booted environments, which is the point of > grubenv, but it can't work much of the time due to the above > limitations. > > -- > Chris Murphy > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel