From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mfZOm-0004M9-2n for mharc-grub-devel@gnu.org; Tue, 26 Oct 2021 23:14:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfZOj-0004Ly-K7 for grub-devel@gnu.org; Tue, 26 Oct 2021 23:14:41 -0400 Received: from de-smtp-delivery-102.mimecast.com ([194.104.109.102]:26718) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfZOh-0006uy-12 for grub-devel@gnu.org; Tue, 26 Oct 2021 23:14:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1635304476; 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=sixG2vNjljdFogpIdjb+/MGtIPcc39nc4TRYhpe11/A=; b=RBdwa/OwSK/IITyt81XSdu8+VDTlGoS2vEkXzcEMB6MteVb3t5VxIUZdzzuocfDKZ28q/j vnNUpXlu/j9sFGvCLhV8Q/b9xl3Es30hovGY3dJjuNKMX5CxH8aBc+srrSLGXWzztZYlTu 2sByQ6bH1Cau5prQxi12TuC9vCuypnI= Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03lp2051.outbound.protection.outlook.com [104.47.10.51]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-31-IdL4XF0-PQ2hzQlruCX6bw-1; Wed, 27 Oct 2021 05:14:35 +0200 X-MC-Unique: IdL4XF0-PQ2hzQlruCX6bw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bqVO7Lg6cEjKQ/JqyGphDY6O+NoWPYmLSSkf/6uhM5FNsnofGggeJl7WDsuIcF/6rmIlBHi6C24Br6GETfQJ/QrQO69xtRNHqTlwyAm1VtmNNFbw6iyDfgfwj/PTOsZCrBAKZ4aHXF4nFixespWXke3PNBUtm1kfcHIP1JuoM2oF8xKnjtNsS9d/kXcWt/oovRsTzP6eKascTO2KhTHVPMkdQXVZ8c+I7+qNEzwScKorucT6e/zYXeDYeKFFZMePREePncVeBNDosBCdnx+aquCe16loxteImT8HYHu0ekBYXjz38E1qd7WLhXi0rQg4daXXDmjpM4uR0HPW0Bmxhw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sixG2vNjljdFogpIdjb+/MGtIPcc39nc4TRYhpe11/A=; b=MLq2GuGnfvhUFL1n8LYI8xOyMj5q+MU7mICIKD91X6peNAhk7c1/HxaD5t9Z8dRMg3jw1FbTDVucHouUgFPAwOoCqKWvZXWvZONC1E4IXlmpnULO1kOZByl1RzStbh8jIdy4W4Ph++odyD+02ujQ9oXY+hTVytpYlS6Eto7w5AEdFuoviAQFoQTimAQM1jBjaTYG+TJzg69cFMkAz1BHPpmwhA5csnHZrKy7AJGjZoFZsP5rMSwcq2ZS7dki4Fo+dLm0hlufMI9rZAERArOcRP9x748tn2heFlR1WCdotPJIggrRCktzSmgpi3CpwuIglyaqrcjCkdqP43jcYoOouQ== 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: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from DU2PR04MB8648.eurprd04.prod.outlook.com (2603:10a6:10:2df::21) by DU2PR04MB8693.eurprd04.prod.outlook.com (2603:10a6:10:2dc::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Wed, 27 Oct 2021 03:14:34 +0000 Received: from DU2PR04MB8648.eurprd04.prod.outlook.com ([fe80::7c78:3729:f82b:6802]) by DU2PR04MB8648.eurprd04.prod.outlook.com ([fe80::7c78:3729:f82b:6802%8]) with mapi id 15.20.4628.020; Wed, 27 Oct 2021 03:14:34 +0000 Date: Wed, 27 Oct 2021 11:14:28 +0800 From: Michael Chang To: The development of GNU GRUB Subject: Re: [PATCH] i386-pc: build btrfs zstd support into separate module Message-ID: <20211027031428.GA4215@mazu> References: <20210831071228.8282-1-mchang@suse.com> <20210901163822.5vq766pc2wdjveef@tomti.i.net-space.pl> <20210902054830.GA9354@mazu> <20210902121252.fa3heoxb6afza7tq@tomti.i.net-space.pl> <20210903012139.GA6661@mazu> <20210908193752.u4pkfbkommbjkazq@tomti.i.net-space.pl> <20210910092222.GA11439@mazu> <20211026125521.wtggtplqqjul34i2@tomti.i.net-space.pl> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211026125521.wtggtplqqjul34i2@tomti.i.net-space.pl> User-Agent: Mutt/1.10.1 (2018-07-13) X-ClientProxiedBy: HK0PR03CA0101.apcprd03.prod.outlook.com (2603:1096:203:b0::17) To DU2PR04MB8648.eurprd04.prod.outlook.com (2603:10a6:10:2df::21) MIME-Version: 1.0 Received: from localhost (2001:b011:30d0:3ecc:6600:6aff:fe77:a7be) by HK0PR03CA0101.apcprd03.prod.outlook.com (2603:1096:203:b0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.22 via Frontend Transport; Wed, 27 Oct 2021 03:14:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3084bc17-0a9f-4490-e117-08d998f7e6b6 X-MS-TrafficTypeDiagnostic: DU2PR04MB8693: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XIPQSNY64/7tB6riNL+d5CcPhcyaher4dNddEnnT1M3bjCDse7SFTcD6A7vP0gN6P6xEob7RjvCfRk3vtoQ66cErGsqjF0AUR0xDr8D/nyCMMSQKelVpXW8JBAbqPzPX70mx+RSybRcIH/EZeF+zFfbtpLB3fUxf5Ma4+GpgzjmtmsQ/TVEU2nQlLrlOV3D51aN0KJuXfoR3Mk/xRyVfsevQo3MiUyyMSvMvQ+Th8jmKJz8jPgRnP/IyBE1ryKERWzqX6HMXb42Alawyc6YrrumVWuJshMft28Y6g13M4kw4H7tzBG50nTDFTxA6XiOwkAhBbn4af1d25cmjfJCHlxvTUEQgVk7uiZEDCkLHiVBdTz0+QiPsG9ubG9DhF1OGzcf+CWYXUJQyGNKEcC3EFppF/QejfUlmF22OUpYXqZRqwZUReg1Z7PSrRY4LNwYy6dgced/LTHlMBPLjEoZfTSSvRFvI1H7E2RZilOrNU01xcjLSKLSRecMD6RymrDWvVev0L01V/8ypWrdGAhDAY43Z0QwGZejVkcKjhQPd0AY9/sLhusIKmFF4uBAbdz0MVF/k164aUrHOhzIYBK6QIeoeti8vRVlgDGVxjelpUJUTpxT85jAxNFKLD1rGZmaDVuuBGxIVSi7dwZJFfiqcVH3l+u9IfVzBP9yAVOyXJ+BXhzdfxuUiJkJBMUp+LyUuWixisOuu2CI1UoO0Q/s3fi/rdtvhTTrksj54fxMdw6RzzLOg43qIt9BOORHGB/ip0g4z4mDwilUidSyz8+MClg== 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:(7916004)(366004)(33656002)(9686003)(6496006)(316002)(186003)(6916009)(8936002)(6486002)(33716001)(83380400001)(8676002)(1076003)(966005)(86362001)(16799955002)(508600001)(38100700002)(6666004)(66556008)(66476007)(66946007)(5660300002)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?0ROUekYP6gvoTG/nZ1CN6vmK+WZvEM73+MOM+KQWCgFG/GnroWN/rlvu66Ao?= =?us-ascii?Q?wzyujuMjDahyTmBOsvTHjkyQ21ulobX6ywUO3U/ngu6JXC6hApMAwzgW/meN?= =?us-ascii?Q?I8cr+8qLZlFKctuV1cgDB6xNEh9NYpenSipGSLcd295MknrhGIyHQ9LmuGpY?= =?us-ascii?Q?DoPxTCrGHOZ5tNs4ZnXQLAoucB4j5DuN+kDWd7EuyrBfj9tT/P8QrgWf4zxU?= =?us-ascii?Q?LTgbFJfNbPP8Fm9jVjDUxl2FmA2Zz4a5IkjtJjs0wWw1V9qya4TcwZBr2GLp?= =?us-ascii?Q?vntPv/ZbLnOznCLb9Mw7MQ76lvUZ0CjsuQicPWZ1/D79KZ8qJr2ORe7MHP4m?= =?us-ascii?Q?yzTSyGC2hpGF/jrXARvy43IwnI8aA+CswKu5SEQ6w/zkMMZZbwC6wCR6SyZh?= =?us-ascii?Q?AIfK0J0p0c7Yada2aQnaX/N3KJn/1OGPKq50NUehYvexH4dwiSMBMC+gkExA?= =?us-ascii?Q?LAcHXUb8qq1HyKnbP6KhWBAvpNxVTv+zuSBkcX5cZ/jD9dJBNg3/U0cdD9wI?= =?us-ascii?Q?LGC+hcyHTvFP9CbL6MfbpTI1WMQbNGMW608lrpJPGe+MSfQpJll+F0UWzvM/?= =?us-ascii?Q?U+bOW761GsZSfRVDtA3+m5uWNybTqide0IWSF1ZX8K1LYO3h/sjMEzrzaNS1?= =?us-ascii?Q?coT1mmMiObDcBM2171cphrmGYRxHFxr240DwBizapTT+4emsuawuAdNYX5ky?= =?us-ascii?Q?HKwMqjURQxEkFisflgEoR3F8lZ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Jg?= =?us-ascii?Q?g8DOiXUN+m+HjyDwZ0/IZmA=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3084bc17-0a9f-4490-e117-08d998f7e6b6 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8648.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2021 03:14:34.5790 (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: XEYOtpivyyjqWs6UeHYYm/FHnXmRZ6WMd5MG2E8nOBt5YigRnOzCwVFyitQr4Tyn X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8693 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, 27 Oct 2021 03:14:41 -0000 On Tue, Oct 26, 2021 at 02:55:21PM +0200, Daniel Kiper wrote: > On Fri, Sep 10, 2021 at 05:22:22PM +0800, Michael Chang via Grub-devel wrote: > > On Wed, Sep 08, 2021 at 09:37:52PM +0200, Daniel Kiper wrote: > > > On Fri, Sep 03, 2021 at 09:21:39AM +0800, Michael Chang via Grub-devel wrote: > > > > On Thu, Sep 02, 2021 at 02:12:52PM +0200, Daniel Kiper wrote: > > > > > On Thu, Sep 02, 2021 at 01:48:30PM +0800, Michael Chang via Grub-devel wrote: > > > > > > On Wed, Sep 01, 2021 at 06:38:22PM +0200, Daniel Kiper wrote: > > > > > > > On Tue, Aug 31, 2021 at 03:12:28PM +0800, Michael Chang via Grub-devel wrote: > > > > [snip] > > > > > > just that I can't resist to fix problem from our users who opted to use > > > > "btrfs partition" which differs to "short mbr gap" with a lot more user > > > > base and sensible usecases. > > > > > > > > FWIW we want to address this problem, because mbr gap is adjustable via > > > > re-partitioning but btrfs bootloader area is not. > > > > > > Huh! The "btrfs partition" sounds like not resizable MBR gap! I am not > > > happy with it just at the beginning. Anyway, could you explain your use > > > case in more details including example commands and why core.img seems > > > landing in the "btrfs partition". I am especially curious about the > > > latter because I think the "btrfs partition" and things like that was > > > designed for something else, e.g., storing grubenv data. And why this > > > solution is i386 specific? > > > > Installing to btrfs partition is not something exotic to grub, it is > > actually a supported usecase by grub for a long time. Also zfs has > > similar design, see: > > > > c7ba4f698 Support BtrFS embedding. > > ba102053c Support ZFS embedding. > > > > To make it happen, you just have to point the btrfs device to > > grub-install and it will setup and embed image there. That worked quite > > nicely until the zstd support came into play. > > > > On current git head, the command fails with core.img is too large. > > > > # ./grub-install -d ./grub-core /dev/vda2 > > Installing for i386-pc platform. > > ./grub-install: warning: your core.img is unusually large. It won't fit in the embedding area. > > ./grub-install: error: filesystem `btrfs' doesn't support blocklists. > > > > With this patch, the embedding still works but warns the user zstd is > > disabled, also instructing them to use MBR if they need the zstd feature > > to work. > > > > # ./grub-install -d ./grub-core /dev/vda2 > > Installing for i386-pc platform. > > ./grub-install: warning: btrfs zstd compression is disabled, please change install device to disk. > > Installation finished. No error reported. > > > > It is very i386-pc centric, as it is often used by legacy mbr boot code > > with which active partition is chainloaded. Some people still thinks > > this is the right thing to do and feels more comfortable this way to > > manage their multiple distrubution booting, compared with os-prober. > > I do not like this solution because it is similar to all the patches > trying to solve small MBR problem. Though, after chatting with Btrfs > folks in Oracle, it seems to me there is better solution for this issue. > I think we should make the GRUB installer smarter. If it cannot put the > core image in first 64 KiB before primary superblock it should install > the core image behind the primary superblock, i.e. starting from > 64 KiB + 4 KiB but below 1 MiB. Please take a look at [1] which nicely > explains the Btrfs bootloader support. Does it make sense for you? Yes. The idea is brilliant and would be the sanest solution out there. I'll try to come up with a patch and discuss here. > > Daniel > > [1] https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs(5)#BOOTLOADER_SUPPORT Thanks for pointing this out. I am looking for it for a long time as I used to come across this paragraph but not being able to make it again. Thanks, Michael > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel