I'm trying to write a grub.cfg file that will add a menu entry that boots a Linux kernel from the default subvolume of a btrfs partition.

My problem is that I don't seem to be able to find a way to access the default subvolume of said partition.

In my case the partition is (hd0,gpt2).

The default subvolume is set to "@/.snapshots/1/snapshot".

The kernel is located at /boot/vmlinuz-linux of the beforementioned subvolume.

(hd0,gpt2)/ points to subvolume 5 of the btrfs partition and not to the default subvolume.

Therefore the location of the kernel would be:
(hd0,gpt2)/@/.snapshots/1/snapshot/boot/vmlinuz-linux


My questions would be as follows:

1. Does GRUB provide a way to access the default subvolume of a btrfs partition instead of subvolume 5?

2. Is there a way for GRUB to store the path of the default subvolume of a btrs partition to a variable (so I can then manually prepend it to the kernel path like in the above example)?

I tried searching online but someone created a project named "grub-btrfs" and it makes searching for actual information on grub's btrfs support quite inconvenient.

Thanks


Reply via email to