From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mLTGp-0001Zk-GJ for mharc-grub-devel@gnu.org; Wed, 01 Sep 2021 12:39:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLTGo-0001T0-3H for grub-devel@gnu.org; Wed, 01 Sep 2021 12:39:26 -0400 Received: from dibed.net-space.pl ([84.10.22.86]:36107) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_3DES_EDE_CBC_SHA1:192) (Exim 4.90_1) (envelope-from ) id 1mLTGl-0002rW-RE for grub-devel@gnu.org; Wed, 01 Sep 2021 12:39:25 -0400 Received: from router-fw.i.net-space.pl ([192.168.52.1]:49432 "EHLO tomti.i.net-space.pl") by router-fw-old.i.net-space.pl with ESMTP id S2113716AbhIAQiY (ORCPT ); Wed, 1 Sep 2021 18:38:24 +0200 X-Comment: RFC 2476 MSA function at dibed.net-space.pl logged sender identity as: dkiper Date: Wed, 1 Sep 2021 18:38:22 +0200 From: Daniel Kiper To: Michael Chang Cc: grub-devel@gnu.org Subject: Re: [PATCH] i386-pc: build btrfs zstd support into separate module Message-ID: <20210901163822.5vq766pc2wdjveef@tomti.i.net-space.pl> References: <20210831071228.8282-1-mchang@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210831071228.8282-1-mchang@suse.com> User-Agent: NeoMutt/20170113 (1.7.2) Received-SPF: pass client-ip=84.10.22.86; envelope-from=dkiper@net-space.pl; helo=dibed.net-space.pl X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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, 01 Sep 2021 16:39:26 -0000 On Tue, Aug 31, 2021 at 03:12:28PM +0800, Michael Chang via Grub-devel wrote: > The zstd support in btrfs brings significant size increment to the > on-disk image that it can no longer fit into btrfs bootloader area and > short mbr gap. > > In order to support grub update on outstanding i386-pc setup with these > size constraints remain in place, here we build the zstd suppprt of > btrfs into a separate module, named btrfs_zstd, to alleviate the size > change. Please note this only makes it's way to i386-pc, other > architecture is not affected. I am OK with extracting zstd code from btrfs code. However, I want that be done for all architectures and platforms. No exceptions. [...] > diff --git a/grub-core/fs/btrfs_zstd.c b/grub-core/fs/btrfs_zstd.c > new file mode 100644 > index 000000000..d5d1e013c > --- /dev/null > +++ b/grub-core/fs/btrfs_zstd.c > @@ -0,0 +1,36 @@ > +/* > + * GRUB -- GRand Unified Bootloader > + * Copyright (C) 2008 Free Software Foundation, Inc. > + * > + * GRUB is free software: you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation, either version 3 of the License, or > + * (at your option) any later version. > + * > + * GRUB is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with GRUB. If not, see . > + */ > + > +#include > +#include > +/* For NULL. */ > +#include > +#include > +#include > + > +GRUB_MOD_LICENSE ("GPLv3+"); > + > +GRUB_MOD_INIT (btrfs_zstd) > +{ > + grub_btrfs_zstd_decompress_func = grub_zstd_decompress; Please create a function in btrfs module which will do this for you. > +} > + > +GRUB_MOD_FINI (btrfs_zstd) > +{ > + grub_btrfs_zstd_decompress_func = NULL; Ditto. Last but not least, please CC original author of zstd support next time. Daniel