|
1 # Source: Internal |
|
2 # Info: Written internally so this component can be built and run on Solaris. |
|
3 # Status: This patch is offered at https://github.com/rhinstaller/shim/issues/54 |
|
4 |
|
5 --- ORIGINAL/shim.c 2016-06-24 03:08:17.837273349 +0000 |
|
6 +++ shim-0.9/shim.c 2016-08-01 21:16:42.359585949 +0000 |
|
7 @@ -53,6 +53,11 @@ |
|
8 #define FALLBACK L"\\fallback.efi" |
|
9 #define MOK_MANAGER L"\\MokManager.efi" |
|
10 |
|
11 +#ifdef __sun |
|
12 +#include <sys/int_types.h> |
|
13 +typedef uint64_t UINTN; |
|
14 +#endif |
|
15 + |
|
16 static EFI_SYSTEM_TABLE *systab; |
|
17 static EFI_HANDLE image_handle; |
|
18 static EFI_STATUS (EFIAPI *entry_point) (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table); |
|
19 @@ -1590,6 +1595,9 @@ |
|
20 CHAR16 *PathName = NULL; |
|
21 void *sourcebuffer = NULL; |
|
22 UINT64 sourcesize = 0; |
|
23 +#ifdef __sun |
|
24 + UINT8 boot_grub = 0; |
|
25 +#endif |
|
26 void *data = NULL; |
|
27 int datasize; |
|
28 |
|
29 @@ -1616,7 +1624,13 @@ |
|
30 } |
|
31 |
|
32 if (findNetboot(li->DeviceHandle)) { |
|
33 +#ifdef __sun |
|
34 + if (PathName[0] == 'g') |
|
35 + boot_grub = 1; |
|
36 + efi_status = parseNetbootinfo(image_handle, boot_grub); |
|
37 +#else |
|
38 efi_status = parseNetbootinfo(image_handle); |
|
39 +#endif |
|
40 if (efi_status != EFI_SUCCESS) { |
|
41 perror(L"Netboot parsing failed: %r\n", efi_status); |
|
42 return EFI_PROTOCOL_ERROR; |
|
43 @@ -1690,7 +1704,7 @@ |
|
44 |
|
45 efi_status = start_image(image_handle, use_fb ? FALLBACK :second_stage); |
|
46 |
|
47 - if (efi_status == EFI_SECURITY_VIOLATION) { |
|
48 + if (efi_status != EFI_SUCCESS) { |
|
49 efi_status = start_image(image_handle, MOK_MANAGER); |
|
50 if (efi_status != EFI_SUCCESS) { |
|
51 Print(L"start_image() returned %r\n", efi_status); |
|
52 @@ -2173,7 +2187,11 @@ |
|
53 while (x++) { |
|
54 /* Make this so it can't /totally/ DoS us. */ |
|
55 #if defined(__x86_64__) || defined(__i386__) || defined(__i686__) |
|
56 +#ifndef __sun |
|
57 if (x > 4294967294) |
|
58 +#else |
|
59 + if (x > 4294967294LL) |
|
60 +#endif |
|
61 break; |
|
62 __asm__ __volatile__("pause"); |
|
63 #elif defined(__aarch64__) |