On Wed, Oct 30, 2019 at 11:48:14AM +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.
>
> 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,
>
> I didn't add a check for x* allocation functions since as mentioned in my
> previous email these are not needed. The functions already check for NULL
> and call exit(3) if that's the case.

Argh... This reminds me that I was asking somebody else about that and
got the same reply. So, I have to get used to the x* allocation
functions behavior. Sorry for the confusion.

Daniel

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

Reply via email to