Skip to content

Commit

Permalink
Clean up the restoration of snponly.efi a little bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarrod Johnson committed Jul 1, 2013
1 parent 73d1ff0 commit f411dce
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/image/efi_image.c
Expand Up @@ -127,6 +127,20 @@ static wchar_t * efi_image_cmdline ( struct image *image ) {
return cmdline;
}

static int check_boot_snp() {
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
EFI_STATUS efirc;
void *snp;
EFI_GUID snpguid = EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
efirc = bs->OpenProtocol ( efi_loaded_image->DeviceHandle,
&snpguid,
&snp, efi_image_handle, NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (efirc) {
return -1;
}
return 1;
}
/**
* Execute EFI image
*
Expand All @@ -152,7 +166,9 @@ static int efi_image_exec ( struct image *image ) {
snpdev = last_opened_snpdev();
netpath=NULL;
if ( snpdev ) {
} else if (1) {
nethandle = snpdev->handle;
netpath = &snpdev->path;
} else if (check_boot_snp() > 0) {
nethandle = efi_loaded_image->DeviceHandle;
netpath = efi_loaded_image->FilePath;
} else {
Expand Down

0 comments on commit f411dce

Please sign in to comment.