On Sat, Oct 19, 2024 at 01:32:12PM GMT, Vladimir 'phcoder' Serbinenko wrote:
> What if I put /boot and /boot/grub in different sub volumes? How do I set
> variables then in order to correctly load additional modules from $prefix
> and yet load correct kernels? This convoy is needed in order to load
> several linuxes from the same btrfs (think installing v1 then making a
> clone and upgrading one of them to v2).

The problem of incompatible modules and core images due to floating
$prefix to any subvolume is mitigated by utilizing monolithic or
standalone images like UEFI Secure Boot these days. For i386-pc or any
other use case where embedding a standalone image is not applicable due
to size constraints etc, we create a separate subvolume and mount it to
/boot/grub2/i386-pc. At grub runtime, we use btrfs-mount-subvol, present
in the patch [1], to remount it to /boot/grub/i386-pc, making it
accessible in place.

[1] https://lists.gnu.org/archive/html/grub-devel/2024-10/msg00089.html

Thanks,
Michael

> 
> Le lun. 14 oct. 2024, 20:09, Leo Sandoval <lsand...@redhat.com> a écrit :
> 
> > From: Michael Chang <mch...@suse.com>
> >
> > We should export btrfs_subvol and btrfs_subvolid to have both visible
> > to subsidiary configuration files loaded using configfile.
> >
> > Signed-off-by: Michael Chang <mch...@suse.com>
> > ---
> >  grub-core/fs/btrfs.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
> > index 8e2b1e9f7..14e38a4df 100644
> > --- a/grub-core/fs/btrfs.c
> > +++ b/grub-core/fs/btrfs.c
> > @@ -2920,6 +2920,8 @@ GRUB_MOD_INIT (btrfs)
> >                                 subvol_set_env);
> >    grub_register_variable_hook ("btrfs_subvolid", subvolid_get_env,
> >                                 subvolid_set_env);
> > +  grub_env_export ("btrfs_subvol");
> > +  grub_env_export ("btrfs_subvolid");
> >  }
> >
> >  GRUB_MOD_FINI (btrfs)
> > --
> > 2.46.2
> >
> >
> > _______________________________________________
> > Grub-devel mailing list
> > Grub-devel@gnu.org
> > https://lists.gnu.org/mailman/listinfo/grub-devel
> >

> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to