On Fri, Jan 17, 2020 at 05:10:43PM +0100, Javier Martinez Canillas wrote:
> From: Peter Jones <pjo...@redhat.com>
>
> The grub-editenv create command will wrongly overwrite /boot/grub2/grubenv
> with a regular file if grubenv is a symbolic link. But instead, it should
> create a new file in the path the symlink points to.
>
> This lets /boot/grub2/grubenv be a symlink to /boot/efi/EFI/fedora/grubenv
> even when they're different mount points, which allows grub2-editenv to be
> the same across platforms (i.e. UEFI vs BIOS).
>
> For example, in Fedora the GRUB EFI builds have prefix set to /EFI/fedora
> (on the EFI System Partition), but for BIOS machine it'll be /boot/grub2
> (which may or may not be its own mountpoint).
>
> With this patch, on EFI machines we can make /boot/grub2/grubenv a symlink
> to /boot/efi/EFI/fedora/grubenv, and the same copy of grub-set-default will
> work on both kinds of systems.
>
> Windows doesn't implement a readlink primitive, so the current behaviour is
> maintained for this operating system.
>
> Signed-off-by: Peter Jones <pjo...@redhat.com>
> Signed-off-by: Jonathan Lebon <jle...@redhat.com>
> Reviewed-by: Adam Jackson <a...@redhat.com>
> Signed-off-by: Javier Martinez Canillas <javi...@redhat.com>

Reviewed-by: Daniel Kiper <daniel.ki...@oracle.com>

Daniel

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

Reply via email to