From e5b75c44823a4c63441f6d9f8a9ffefc6132eb9e Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Mon, 23 Sep 2024 16:05:46 +0100 Subject: [PATCH 1/9] Remove unused files * tpause wasn't included in Makefile and is very basic (also removed from VS references) * trivial.S doesn't actually use gnu-efi and wasn't built * Remove make stuff likely intended for Intel make?? Signed-off-by: Callum Farmer --- .vs/apps/tpause.vcxproj | 13 --------- .vs/apps/tpause.vcxproj.filters | 18 ------------ apps/tpause.c | 9 ------ apps/trivial.S | 47 ------------------------------- gnu-efi.sln | 22 --------------- inc/inc.mak | 24 ---------------- inc/make.inf | 34 ----------------------- inc/makefile.hdr | 49 --------------------------------- 8 files changed, 216 deletions(-) delete mode 100644 .vs/apps/tpause.vcxproj delete mode 100644 .vs/apps/tpause.vcxproj.filters delete mode 100644 apps/tpause.c delete mode 100644 apps/trivial.S delete mode 100644 inc/inc.mak delete mode 100644 inc/make.inf delete mode 100644 inc/makefile.hdr diff --git a/.vs/apps/tpause.vcxproj b/.vs/apps/tpause.vcxproj deleted file mode 100644 index 6b1668a..0000000 --- a/.vs/apps/tpause.vcxproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - {8E407F19-F112-4630-B879-CFF982791261} - tpause - 10.0 - tpause - - - - - diff --git a/.vs/apps/tpause.vcxproj.filters b/.vs/apps/tpause.vcxproj.filters deleted file mode 100644 index b2d238f..0000000 --- a/.vs/apps/tpause.vcxproj.filters +++ /dev/null @@ -1,18 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - - - Source Files - - - diff --git a/apps/tpause.c b/apps/tpause.c deleted file mode 100644 index ab7eb64..0000000 --- a/apps/tpause.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include - -EFI_STATUS -efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab) -{ - Print(u"Press `q' to quit, any other key to continue:\n"); - return EFI_SUCCESS; -} diff --git a/apps/trivial.S b/apps/trivial.S deleted file mode 100644 index 3ec6562..0000000 --- a/apps/trivial.S +++ /dev/null @@ -1,47 +0,0 @@ - .text - .align 4 - - .globl _start -_start: -#if 0 - pushl %ebp - movl %esp,%ebp - pushl %ebx # save ebx - movl 12(%ebp),%eax # eax <- systab - movl 24(%eax),%ebx # ebx <- systab->FirmwareVendor - pushl %ebx - movl 44(%eax),%ebx # ebx <- systab->ConOut - pushl %ebx - movl 4(%ebx),%eax # eax <- conout->OutputString - call *%eax - movl -4(%ebp),%ebx # restore ebx - leave - ret - -#else - - pushl %ebp - movl %esp,%ebp - pushl %ebx - call 0f -0: popl %eax - addl $hello-0b,%eax - pushl %eax - movl 12(%ebp),%eax # eax <- systab - movl 44(%eax),%ebx # ebx <- systab->ConOut - pushl %ebx - movl 4(%ebx),%eax # eax <- conout->OutputString - call *%eax - movl -4(%ebp),%ebx - leave - ret - - .section .rodata - .align 2 -hello: .byte 'h',0,'e',0,'l',0,'l',0,'o',0,'\n',0,'\r',0,0,0 - -#endif - -#if defined(__ELF__) && defined(__linux__) - .section .note.GNU-stack,"",%progbits -#endif diff --git a/gnu-efi.sln b/gnu-efi.sln index 6d1c8f4..c9d7bd1 100644 --- a/gnu-efi.sln +++ b/gnu-efi.sln @@ -106,11 +106,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tcc", ".vs\apps\tcc.vcxproj {3135D563-9596-4584-9ED6-616ADEC52974} = {3135D563-9596-4584-9ED6-616ADEC52974} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tpause", ".vs\apps\tpause.vcxproj", "{8E407F19-F112-4630-B879-CFF982791261}" - ProjectSection(ProjectDependencies) = postProject - {3135D563-9596-4584-9ED6-616ADEC52974} = {3135D563-9596-4584-9ED6-616ADEC52974} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unsetdbg", ".vs\apps\unsetdbg.vcxproj", "{06089797-265A-4FF5-838E-25374C1F0159}" ProjectSection(ProjectDependencies) = postProject {3135D563-9596-4584-9ED6-616ADEC52974} = {3135D563-9596-4584-9ED6-616ADEC52974} @@ -464,22 +459,6 @@ Global {6E45A33B-E4A0-48D4-81AE-ACFD46FDB1CA}.Release|ia32.Build.0 = Release|Win32 {6E45A33B-E4A0-48D4-81AE-ACFD46FDB1CA}.Release|x64.ActiveCfg = Release|x64 {6E45A33B-E4A0-48D4-81AE-ACFD46FDB1CA}.Release|x64.Build.0 = Release|x64 - {8E407F19-F112-4630-B879-CFF982791261}.Debug|aa64.ActiveCfg = Debug|ARM64 - {8E407F19-F112-4630-B879-CFF982791261}.Debug|aa64.Build.0 = Debug|ARM64 - {8E407F19-F112-4630-B879-CFF982791261}.Debug|arm.ActiveCfg = Debug|ARM - {8E407F19-F112-4630-B879-CFF982791261}.Debug|arm.Build.0 = Debug|ARM - {8E407F19-F112-4630-B879-CFF982791261}.Debug|ia32.ActiveCfg = Debug|Win32 - {8E407F19-F112-4630-B879-CFF982791261}.Debug|ia32.Build.0 = Debug|Win32 - {8E407F19-F112-4630-B879-CFF982791261}.Debug|x64.ActiveCfg = Debug|x64 - {8E407F19-F112-4630-B879-CFF982791261}.Debug|x64.Build.0 = Debug|x64 - {8E407F19-F112-4630-B879-CFF982791261}.Release|aa64.ActiveCfg = Release|ARM64 - {8E407F19-F112-4630-B879-CFF982791261}.Release|aa64.Build.0 = Release|ARM64 - {8E407F19-F112-4630-B879-CFF982791261}.Release|arm.ActiveCfg = Release|ARM - {8E407F19-F112-4630-B879-CFF982791261}.Release|arm.Build.0 = Release|ARM - {8E407F19-F112-4630-B879-CFF982791261}.Release|ia32.ActiveCfg = Release|Win32 - {8E407F19-F112-4630-B879-CFF982791261}.Release|ia32.Build.0 = Release|Win32 - {8E407F19-F112-4630-B879-CFF982791261}.Release|x64.ActiveCfg = Release|x64 - {8E407F19-F112-4630-B879-CFF982791261}.Release|x64.Build.0 = Release|x64 {06089797-265A-4FF5-838E-25374C1F0159}.Debug|aa64.ActiveCfg = Debug|ARM64 {06089797-265A-4FF5-838E-25374C1F0159}.Debug|aa64.Build.0 = Debug|ARM64 {06089797-265A-4FF5-838E-25374C1F0159}.Debug|arm.ActiveCfg = Debug|ARM @@ -521,7 +500,6 @@ Global {04D2685F-8150-47E0-BC10-338D2D6B804C} = {DF105116-5A3A-4D48-AB1D-7221690ED545} {6C664A44-BC53-4225-A14B-D969D4EED647} = {DF105116-5A3A-4D48-AB1D-7221690ED545} {6E45A33B-E4A0-48D4-81AE-ACFD46FDB1CA} = {DF105116-5A3A-4D48-AB1D-7221690ED545} - {8E407F19-F112-4630-B879-CFF982791261} = {DF105116-5A3A-4D48-AB1D-7221690ED545} {06089797-265A-4FF5-838E-25374C1F0159} = {DF105116-5A3A-4D48-AB1D-7221690ED545} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/inc/inc.mak b/inc/inc.mak deleted file mode 100644 index 8fd8766..0000000 --- a/inc/inc.mak +++ /dev/null @@ -1,24 +0,0 @@ - - -INC_DEPS = $(INC_DEPS) \ - efi.h \ - efiapi.h \ - efibind.h \ - eficon.h \ - efidebug.h \ - efidef.h \ - efidevp.h \ - efierr.h \ - efifs.h \ - efimp.h \ - efilib.h \ - efipart.h \ - efipciio.h \ - efiprot.h \ - efipxe.h \ - efivar.h \ - pe.h \ - efiip.h \ - efiudp.h \ - efitcp.h \ - stdarg.h diff --git a/inc/make.inf b/inc/make.inf deleted file mode 100644 index 319f428..0000000 --- a/inc/make.inf +++ /dev/null @@ -1,34 +0,0 @@ -# -# -# - -[sources] - efi.h - efiapi.h - eficon.h - efidebug.h - efidef.h - efidevp.h - efierr.h - efifs.h - efimp.h - efilib.h - efipart.h - efipciio.h - efiprot.h - efipxebc.h - efistdarg.h - efinet.h - efiip.h - efiudp.h - efitcp.h - -[ia32sources] - efibind.h - pe.h - efilibplat.h - -[ia64sources] - efibind.h - pe.h - efilibplat.h diff --git a/inc/makefile.hdr b/inc/makefile.hdr deleted file mode 100644 index 1243d0c..0000000 --- a/inc/makefile.hdr +++ /dev/null @@ -1,49 +0,0 @@ - -# -# This is a machine generated file - DO NOT EDIT -# Generated by genmake.exe -# Generated from make.inf -# Copyright (c) 1998 Intel Corporation -# - -INC_DEPS = $(INC_DEPS) \ - $(SDK_INSTALL_DIR)\include\efi\efi.h \ - $(SDK_INSTALL_DIR)\include\efi\efiapi.h \ - $(SDK_INSTALL_DIR)\include\efi\eficon.h \ - $(SDK_INSTALL_DIR)\include\efi\efidebug.h \ - $(SDK_INSTALL_DIR)\include\efi\efidef.h \ - $(SDK_INSTALL_DIR)\include\efi\efidevp.h \ - $(SDK_INSTALL_DIR)\include\efi\efierr.h \ - $(SDK_INSTALL_DIR)\include\efi\efifs.h \ - $(SDK_INSTALL_DIR)\include\efi\efimp.h \ - $(SDK_INSTALL_DIR)\include\efi\efilib.h \ - $(SDK_INSTALL_DIR)\include\efi\efipart.h \ - $(SDK_INSTALL_DIR)\include\efi\efipciio.h \ - $(SDK_INSTALL_DIR)\include\efi\efiprot.h \ - $(SDK_INSTALL_DIR)\include\efi\efipxebc.h \ - $(SDK_INSTALL_DIR)\include\efi\efistdarg.h \ - $(SDK_INSTALL_DIR)\include\efi\efinet.h \ - $(SDK_INSTALL_DIR)\include\efi\efiip.h \ - $(SDK_INSTALL_DIR)\include\efi\efiudp.h \ - $(SDK_INSTALL_DIR)\include\efi\efitcp.h \ - - -!IF "$(PROCESSOR)" == "Ia32" -INC_DEPS = $(INC_DEPS) \ - $(SDK_INSTALL_DIR)\include\efi\Ia32\efibind.h \ - $(SDK_INSTALL_DIR)\include\efi\Ia32\pe.h \ - $(SDK_INSTALL_DIR)\include\efi\Ia32\efilibplat.h \ - - -!ENDIF - - -!IF "$(PROCESSOR)" == "Ia64" -INC_DEPS = $(INC_DEPS) \ - $(SDK_INSTALL_DIR)\include\efi\Ia64\efibind.h \ - $(SDK_INSTALL_DIR)\include\efi\Ia64\pe.h \ - $(SDK_INSTALL_DIR)\include\efi\Ia64\efilibplat.h \ - - -!ENDIF - From b5a7f60a6b817402e2d96f4a35c79821b5073052 Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Mon, 23 Sep 2024 16:12:19 +0100 Subject: [PATCH 2/9] Clarify CompareGuid change * Update guid.c to display correct output code in description * Add warning about failure in ABI README Signed-off-by: Callum Farmer --- docs/README.ABI.md | 4 ++++ lib/guid.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/README.ABI.md b/docs/README.ABI.md index 775e010..d843675 100644 --- a/docs/README.ABI.md +++ b/docs/README.ABI.md @@ -5,8 +5,12 @@ versions This currently includes the following functions: - ReallocatePool + - CopyMem + - CompareGuid + + **Will break at runtime - likely causing opposite output to expected** 2) Applications which haven't been updated in a while may also be missing the required `.rodata` section which contains needed read-only data which will prevent diff --git a/lib/guid.c b/lib/guid.c index 9b8fffc..9236cab 100644 --- a/lib/guid.c +++ b/lib/guid.c @@ -134,7 +134,7 @@ Routine Description: Guid2 - guid to compare Returns: - = 0 if Guid1 == Guid2 + = 1 if Guid1 == Guid2 --*/ { From aa8151c3d214ce19797abc8069cc8a7acb979f45 Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Mon, 23 Sep 2024 16:19:33 +0100 Subject: [PATCH 3/9] Add more notes to GitHub release info * Just to ensure GitHub doesn't run anyway with the hills Signed-off-by: Callum Farmer --- docs/README.git.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/README.git.md b/docs/README.git.md index 7b6aef5..fc4238f 100644 --- a/docs/README.git.md +++ b/docs/README.git.md @@ -11,11 +11,21 @@ Generating releases on GitHub is a very simple process; 2) Enter the version number in the tag field, selecting "create tag on publish" **Ignore GitHub's suggestion of prefixing the version with a "v"** -3) **OPTIONAL** - Add a release description and/or a list of pull requests and contributors via "Generate release notes" -4) For alpha/beta versions, set it to be a pre-release -5) Release the new version -6) GitHub will automatically generate a GZ compressed TAR file and a ZIP file of the repo +3) Set previous tag manually + + - Last stable for stable releases + - Last alpha/beta for alpha/beta releases + + **Ensures GitHub sets the Full Changelog to be between the last release in the cycle** + **and not the start of the repository** +4) Add a release title - use the version number + + **Otherwise GitHub will add the last commit name as the title** +5) ***OPTIONAL*** + Add a release description *and/or* a list of pull requests and contributors via "Generate release notes" +6) For alpha/beta versions, set it to be a pre-release +7) Release the new version +8) GitHub will automatically generate a GZ compressed TAR file and a ZIP file of the repo From 57d2e370d8435e3ace3d1426d4db466848e32969 Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Mon, 23 Sep 2024 16:32:53 +0100 Subject: [PATCH 4/9] Add more detail to ABI notice Signed-off-by: Callum Farmer --- docs/README.ABI.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/README.ABI.md b/docs/README.ABI.md index d843675..a6154bc 100644 --- a/docs/README.ABI.md +++ b/docs/README.ABI.md @@ -5,11 +5,20 @@ versions This currently includes the following functions: - ReallocatePool + + Inputs were re-ordered - CopyMem + Source is no longer marked as constant + + CopyMemC is introduced as a helper function when using a constant source input + - CompareGuid - + + Function now returns BOOLEAN instead of INTN + Return codes are now reversed + **Will break at runtime - likely causing opposite output to expected** 2) Applications which haven't been updated in a while may also be missing the From 24a4cd0e5653fd84b004c00c808c45cc3fb7a7e2 Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Mon, 23 Sep 2024 16:51:49 +0100 Subject: [PATCH 5/9] ARM32: Split headers and code * Force code to be at known dest of 4096 * Move _start into .text * Load the _start symbol address and then minus 4096 to get the load address Signed-off-by: Callum Farmer --- gnuefi/crt0-efi-arm.S | 21 +++++++++++---------- gnuefi/elf_arm_efi.lds | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/gnuefi/crt0-efi-arm.S b/gnuefi/crt0-efi-arm.S index 9c2c467..ad02ca1 100644 --- a/gnuefi/crt0-efi-arm.S +++ b/gnuefi/crt0-efi-arm.S @@ -45,11 +45,11 @@ optional_header: .2byte 0x10b // PE32+ format .byte 0x02 // MajorLinkerVersion .byte 0x14 // MinorLinkerVersion - .4byte _etext - _start // SizeOfCode + .4byte _text_size - ImageBase // SizeOfCode .4byte _alldata_size - ImageBase // SizeOfInitializedData .4byte 0 // SizeOfUninitializedData - .4byte _start - ImageBase // AddressOfEntryPoint - .4byte _start - ImageBase // BaseOfCode + .4byte _text - ImageBase // AddressOfEntryPoint + .4byte _text - ImageBase // BaseOfCode .4byte _reloc - ImageBase // BaseOfData extra_header_fields: @@ -67,7 +67,7 @@ extra_header_fields: .4byte _image_end - ImageBase // SizeOfImage // Everything before the kernel image is considered part of the header - .4byte _start - ImageBase // SizeOfHeaders + .4byte _text - ImageBase // SizeOfHeaders .4byte 0 // CheckSum .2byte EFI_SUBSYSTEM // Subsystem .2byte 0 // DllCharacteristics @@ -100,10 +100,10 @@ extra_header_fields: section_table: .ascii ".text\0\0\0" - .4byte _evtext - _start // VirtualSize - .4byte _start - ImageBase // VirtualAddress - .4byte _etext - _start // SizeOfRawData - .4byte _start - ImageBase // PointerToRawData + .4byte _text_vsize - ImageBase // VirtualSize + .4byte _text - ImageBase // VirtualAddress + .4byte _text_size - ImageBase // SizeOfRawData + .4byte _text - ImageBase // PointerToRawData .4byte 0 // PointerToRelocations (0 for executables) .4byte 0 // PointerToLineNumbers (0 for executables) .2byte 0 // NumberOfRelocations (0 for executables) @@ -148,7 +148,7 @@ section_table: .2byte 0 // NumberOfLineNumbers .4byte 0x40000040 // Characteristics (section flags) -.balign 256 +.text .globl _start .type _start,%function _start: @@ -159,7 +159,8 @@ _start: adr r1, .L_DYNAMIC ldr r0, [r1] add r1, r0, r1 - adr r0, ImageBase + adr r0, _start + sub r0, r0, #0x1000 bl _relocate teq r0, #0 bne 0f diff --git a/gnuefi/elf_arm_efi.lds b/gnuefi/elf_arm_efi.lds index afe17af..b7e3fb1 100644 --- a/gnuefi/elf_arm_efi.lds +++ b/gnuefi/elf_arm_efi.lds @@ -5,6 +5,7 @@ SECTIONS { .text 0 : { *(.text.head) + . = 0x1000; _text = .; *(.text) *(.text.*) From e9b6ac7126382e23988d63e7916d21b2d66da7fb Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Mon, 23 Sep 2024 17:38:22 +0100 Subject: [PATCH 6/9] ARM64 local: Remove NR_SECTIONS * NR_SECTIONS is part of the crt0 generator for fwupd-efi * This isn't implemented here Signed-off-by: Callum Farmer --- gnuefi/crt0-efi-aarch64-local.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnuefi/crt0-efi-aarch64-local.S b/gnuefi/crt0-efi-aarch64-local.S index 49a8e95..8ce3d28 100644 --- a/gnuefi/crt0-efi-aarch64-local.S +++ b/gnuefi/crt0-efi-aarch64-local.S @@ -31,7 +31,7 @@ pe_header: .2byte 0 coff_header: .2byte 0xaa64 // AArch64 - .2byte NR_SECTIONS // nr_sections + .2byte 4 // nr_sections .4byte 0 // TimeDateStamp .4byte 0 // PointerToSymbolTable .4byte 0 // NumberOfSymbols From 21ea877a013d7d014e171cd2773dcac83fca7ada Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Mon, 23 Sep 2024 17:57:11 +0100 Subject: [PATCH 7/9] IA32 local: Fix up crt0 symbols * This should use a fully split version of the CRT0 not the old ARM un-split version Signed-off-by: Callum Farmer --- gnuefi/crt0-efi-ia32-local.S | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gnuefi/crt0-efi-ia32-local.S b/gnuefi/crt0-efi-ia32-local.S index 8b562ab..a13be2d 100644 --- a/gnuefi/crt0-efi-ia32-local.S +++ b/gnuefi/crt0-efi-ia32-local.S @@ -27,7 +27,7 @@ optional_header: .2byte 0x10b // PE32+ format .byte 0x02 // MajorLinkerVersion .byte 0x14 // MinorLinkerVersion - .4byte _etext - _start // SizeOfCode + .4byte _text_size - ImageBase // SizeOfCode .4byte _alldata_size - ImageBase // SizeOfInitializedData .4byte 0 // SizeOfUninitializedData .4byte _start - ImageBase // AddressOfEntryPoint @@ -82,10 +82,10 @@ extra_header_fields: section_table: .ascii ".text\0\0\0" - .4byte _evtext - _start // VirtualSize - .4byte _start - ImageBase // VirtualAddress - .4byte _etext - _start // SizeOfRawData - .4byte _start - ImageBase // PointerToRawData + .4byte _text_vsize - ImageBase // VirtualSize + .4byte _text - ImageBase // VirtualAddress + .4byte _text_size - ImageBase // SizeOfRawData + .4byte _text - ImageBase // PointerToRawData .4byte 0 // PointerToRelocations (0 for executables) .4byte 0 // PointerToLineNumbers (0 for executables) .2byte 0 // NumberOfRelocations (0 for executables) @@ -130,6 +130,7 @@ section_table: .2byte 0 // NumberOfLineNumbers .4byte 0x40000040 // Characteristics (section flags) +.text .globl _start .type _start,%function _start: From aa2ad0329bc179f121142371680c14ef0cd9644e Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Tue, 24 Sep 2024 14:24:03 +0100 Subject: [PATCH 8/9] Fix calling of gnuefi install with local lds * Local lds wasn't being installed on RISC-V Signed-off-by: Callum Farmer --- gnuefi/Makefile | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/gnuefi/Makefile b/gnuefi/Makefile index 8911274..405439b 100644 --- a/gnuefi/Makefile +++ b/gnuefi/Makefile @@ -112,18 +112,13 @@ clean: install: mkdir -p $(INSTALLROOT)$(LIBDIR) $(INSTALL) -m 644 $(TARGETS) $(INSTALLROOT)$(LIBDIR) -ifeq ($(USING_FREEBSD),1) - ifeq ($(ARCH),x86_64) +ifneq (,$(filter $(ARCH),x86_64 ia32)) $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_fbsd_efi.lds $(INSTALLROOT)$(LIBDIR) - else - ifneq (,$(filter $(ARCH),aarch64 riscv64 ia32)) - $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi_local.lds $(INSTALLROOT)$(LIBDIR) - endif - $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR) - endif -else - $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR) endif +ifneq (,$(filter $(ARCH),aarch64 riscv64 ia32)) + $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi_local.lds $(INSTALLROOT)$(LIBDIR) +endif + $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR) $(INSTALL) -d $(INSTALLROOT)$(PKGCONFIGDIR) $(INSTALL) -m 644 gnu-efi.pc $(INSTALLROOT)$(PKGCONFIGDIR) From 57e8966b5d03933335a40ecb1a8fd27691012097 Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Sat, 28 Sep 2024 18:07:44 +0100 Subject: [PATCH 9/9] Add packaging guide Files have been ending up in differing places between distros - this is an attempt to fix this Signed-off-by: Callum Farmer --- docs/README.packaging.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/README.packaging.md diff --git a/docs/README.packaging.md b/docs/README.packaging.md new file mode 100644 index 0000000..37b9f38 --- /dev/null +++ b/docs/README.packaging.md @@ -0,0 +1,19 @@ +# Packaging gnu-efi + +## Set variables per distro configuration + +make should be called with the following variables: + +- PREFIX (defaults to `/usr/local`)(`%{_prefix}` on RPM distros) +- EXEC_PREFIX (*optional*) (defaults to `$PREFIX`) (`%{_exec_prefix}` on RPM distros) +- LIBDIR (defaults to `$EXEC_PREFIX/lib`) (`%{_libdir}` on RPM distros) +- INCLUDEDIR (*optional*) (defaults to `$PREFIX/include`) (`%{_includedir}` on RPM distros) +- LINUX_HEADERS (*optional*) (**build only**) - location of Linux kernel header files (defaults to `/usr/src/sys/build`) +- DESTDIR (**install only**) - installation output directory (`%{buildroot}` on RPM distros - included in `%make_install`) + +Currently, these variables unless stated will need to be set for both build and installation stages. + +Those without optional markers I heavily suggest you to set them otherwise files may be located in the wrong directory +for the architecture which you are building for + +*The related RPM variables are included here for cross referencing purposes* \ No newline at end of file