[PATCH] EFI: don't mistakenly delete a file we never installed

Jan Beulich posted 1 patch 2 years ago
Failed in applying to current master (apply log)
[PATCH] EFI: don't mistakenly delete a file we never installed
Posted by Jan Beulich 2 years ago
Just like for "install", make dealing with xen.efi on the EFI partition
dependent upon mount point and vendor directory being known.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/Makefile
+++ b/xen/Makefile
@@ -515,7 +515,9 @@ _uninstall:
 	rm -f $(D)$(DEBUG_DIR)/$(T)-$(XEN_FULLVERSION).efi.map
 	rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).efi
 	rm -f $(D)$(EFI_DIR)/$(T).efi
-	rm -f $(D)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR)/$(T)-$(XEN_FULLVERSION).efi
+	if [ -n '$(EFI_MOUNTPOINT)' -a -n '$(EFI_VENDOR)' ]; then \
+		rm -f $(D)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR)/$(T)-$(XEN_FULLVERSION).efi; \
+	fi
 
 .PHONY: _debug
 _debug:
Re: [PATCH] EFI: don't mistakenly delete a file we never installed
Posted by Bertrand Marquis 2 years ago
Hi Jan,

> On 25 Apr 2022, at 11:47, Jan Beulich <jbeulich@suse.com> wrote:
> 
> Just like for "install", make dealing with xen.efi on the EFI partition
> dependent upon mount point and vendor directory being known.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> 
> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -515,7 +515,9 @@ _uninstall:
> 	rm -f $(D)$(DEBUG_DIR)/$(T)-$(XEN_FULLVERSION).efi.map
> 	rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).efi
> 	rm -f $(D)$(EFI_DIR)/$(T).efi
> -	rm -f $(D)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR)/$(T)-$(XEN_FULLVERSION).efi
> +	if [ -n '$(EFI_MOUNTPOINT)' -a -n '$(EFI_VENDOR)' ]; then \
> +		rm -f $(D)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR)/$(T)-$(XEN_FULLVERSION).efi; \
> +	fi
> 
> .PHONY: _debug
> _debug:
> 
>