From: Alexander Graf Date: Tue, 4 Sep 2018 11:16:38 +0200 Subject: [U-Boot] [PATCH v2 18/23] efi_loader: implement a pseudo "file delete" In-Reply-To: <20180904074948.18146-19-takahiro.akashi@linaro.org> References: <20180904074948.18146-1-takahiro.akashi@linaro.org> <20180904074948.18146-19-takahiro.akashi@linaro.org> Message-ID: <98202c7d-501c-e886-900f-b3b561b11fa3@suse.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 04.09.18 09:49, AKASHI Takahiro wrote: > This patch is necessary to run SCT.efi (UEFI Self-Certification Test). > Returning EFI_SUCCESS can cheat SCT execution. > > Signed-off-by: AKASHI Takahiro How hard would it be to implement a real delete instead? Alex > --- > lib/efi_loader/efi_file.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c > index 6ec98c80227e..12044a0c7196 100644 > --- a/lib/efi_loader/efi_file.c > +++ b/lib/efi_loader/efi_file.c > @@ -226,12 +226,20 @@ static efi_status_t EFIAPI efi_file_close(struct efi_file_handle *file) > return EFI_EXIT(file_close(fh)); > } > > +static efi_status_t EFIAPI efi_file_write(struct efi_file_handle *file, > + efi_uintn_t *buffer_size, > + void *buffer); > + > static efi_status_t EFIAPI efi_file_delete(struct efi_file_handle *file) > { > struct file_handle *fh = to_fh(file); > + efi_uintn_t size = 0; > EFI_ENTRY("%p", file); > + > + /* TODO: implement real 'delete' */ > + efi_file_write(file, &size, NULL); > file_close(fh); > - return EFI_EXIT(EFI_WARN_DELETE_FAILURE); > + return EFI_SUCCESS; > } > > static efi_status_t file_read(struct file_handle *fh, u64 *buffer_size, >