[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 2/2] Make editenv chase symlinks including those across de
Re: [PATCH v3 2/2] Make editenv chase symlinks including those across devices
Wed, 30 Oct 2019 12:47:43 +0100
On Wed, Oct 30, 2019 at 11:48:14AM +0100, Javier Martinez Canillas wrote:
> From: Peter Jones <address@hidden>
> 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 <address@hidden>
> Signed-off-by: Jonathan Lebon <address@hidden>
> Reviewed-by: Adam Jackson <address@hidden>
> Signed-off-by: Javier Martinez Canillas <address@hidden>
Reviewed-by: Daniel Kiper <address@hidden>
> 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.