I've done my own testing on my side and unfortunately it seems like hinting the search command isn't sufficient to make this work -- there's definitely also the need to patch is some more to not use cache when hinting the command, so that things appear in the right order.
This said, I've had review on the $bootdrive patch and there's been some rightful pushback: there's a way to get the same thing via regexp, and we should otherwise make sure we're not unnecessarily duplicating variables (since there is already $cmdpath; though there is so logic to having a $grub_bootdev and $grub_bootpath separation).
Since it was suggested, I've looked into using regexp to retrieve the boot device name, it looks like it might work to remove the need to search for the right root device, but given that this is run in a UEFI context, there could be security implications to using regexp -- I've asked Colin Watson to weight in on that.
I've done my own testing on my side and unfortunately it seems like hinting the search command isn't sufficient to make this work -- there's definitely also the need to patch is some more to not use cache when hinting the command, so that things appear in the right order.
This said, I've had review on the $bootdrive patch and there's been some rightful pushback: there's a way to get the same thing via regexp, and we should otherwise make sure we're not unnecessarily duplicating variables (since there is already $cmdpath; though there is so logic to having a $grub_bootdev and $grub_bootpath separation).
Since it was suggested, I've looked into using regexp to retrieve the boot device name, it looks like it might work to remove the need to search for the right root device, but given that this is run in a UEFI context, there could be security implications to using regexp -- I've asked Colin Watson to weight in on that.