Initial Commit
- initial default booting image
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
From e1c3734bab27fd850b4ac6681d219ceaf0637616 Mon Sep 17 00:00:00 2001
|
||||
From: Erico Nunes <nunes.erico@gmail.com>
|
||||
Date: Mon, 3 Oct 2022 18:16:55 +0200
|
||||
Subject: [PATCH] efivar: isolate makeguids host tool build
|
||||
|
||||
efivar build includes a 'makeguids' host tool which is normally built by
|
||||
distributions during the package build step. This is unfortunately not
|
||||
written with cross-compilation in mind, since it needs to build for the
|
||||
host architecture, including the build of object files which it then
|
||||
assumes can be linked into the target library.
|
||||
To make the packaging process simpler for a cross-compilation system
|
||||
like Buildroot, separate the 'makeguids' tool build to an explicit make
|
||||
target and remove target build dependencies from it.
|
||||
This way, Buildroot can build the tool separately in a host build step
|
||||
and the target build step can then be straightforward.
|
||||
|
||||
Upstream: Not applicable (does not support cross compilation)
|
||||
Signed-off-by: Julien Olivain <ju.o@free.fr>
|
||||
[Julien: rebased patch to version 39]
|
||||
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
|
||||
---
|
||||
src/Makefile | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/Makefile b/src/Makefile
|
||||
index 6fc2a62..7fa63c6 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -70,7 +70,6 @@ makeguids : LDFLAGS=$(HOST_LDFLAGS)
|
||||
makeguids : CCLDFLAGS=$(HOST_CCLDFLAGS)
|
||||
makeguids : $(MAKEGUIDS_OBJECTS)
|
||||
|
||||
-$(MAKEGUIDS_OUTPUT) : makeguids
|
||||
$(MAKEGUIDS_OUTPUT) : guids.txt
|
||||
@set -e ; \
|
||||
missing=no ; \
|
||||
@@ -83,9 +82,9 @@ $(MAKEGUIDS_OUTPUT) : guids.txt
|
||||
if [ "$${missing}" != "no" ]; then \
|
||||
exit 1 ; \
|
||||
fi
|
||||
- ./makeguids guids.txt guid-symbols.c include/efivar/efivar-guids.h
|
||||
+ makeguids guids.txt guid-symbols.c include/efivar/efivar-guids.h
|
||||
|
||||
-prep : makeguids $(GENERATED_SOURCES)
|
||||
+prep : $(GENERATED_SOURCES)
|
||||
|
||||
$(LIBEFIVAR_OBJECTS) $(LIBEFIBOOT_OBJECTS) : include/efivar/efivar-guids.h
|
||||
|
||||
--
|
||||
2.44.0
|
||||
|
||||
30
package/efivar/Config.in
Normal file
30
package/efivar/Config.in
Normal file
@@ -0,0 +1,30 @@
|
||||
config BR2_PACKAGE_EFIVAR_ARCH_SUPPORTS
|
||||
bool
|
||||
default y
|
||||
depends on BR2_arm || BR2_aarch64 || BR2_i386 || BR2_x86_64 \
|
||||
|| BR2_powerpc64le || BR2_mipsel || BR2_mips64el \
|
||||
|| BR2_RISCV_64
|
||||
|
||||
config BR2_PACKAGE_EFIVAR
|
||||
bool "efivar"
|
||||
depends on BR2_PACKAGE_EFIVAR_ARCH_SUPPORTS
|
||||
depends on !BR2_STATIC_LIBS # dlfcn.h
|
||||
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12 # linux/nvme.h
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
# linux/nvme.h has been renamed to linux/nvme_ioctl.h since 4.4,
|
||||
# and the efivar source handles that situation. However, some
|
||||
# Sourcery CodeBench toolchains use 4.4 kernel headers but they
|
||||
# don't have that header file renamed, and that is causing build
|
||||
# failures. So, prevent this package to be built using those
|
||||
# toolchains.
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
|
||||
help
|
||||
Tools and libraries to manipulate EFI variables
|
||||
|
||||
https://github.com/rhboot/efivar
|
||||
|
||||
comment "efivar needs a toolchain w/ dynamic library, threads, headers >= 3.12, gcc >= 4.9"
|
||||
depends on BR2_PACKAGE_EFIVAR_ARCH_SUPPORTS
|
||||
depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS || \
|
||||
!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12 || \
|
||||
!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
|
||||
3
package/efivar/efivar.hash
Normal file
3
package/efivar/efivar.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# locally computed hash
|
||||
sha256 c9edd15f2eeeea63232f3e669a48e992c7be9aff57ee22672ac31f5eca1609a6 efivar-39.tar.gz
|
||||
sha256 91df770634adc2755e78cae33a0d01e702ce2f69046408ae93d0d934ff29691b COPYING
|
||||
60
package/efivar/efivar.mk
Normal file
60
package/efivar/efivar.mk
Normal file
@@ -0,0 +1,60 @@
|
||||
################################################################################
|
||||
#
|
||||
# efivar
|
||||
#
|
||||
################################################################################
|
||||
|
||||
EFIVAR_VERSION = 39
|
||||
EFIVAR_SITE = $(call github,rhboot,efivar,$(EFIVAR_VERSION))
|
||||
EFIVAR_LICENSE = LGPL-2.1
|
||||
EFIVAR_LICENSE_FILES = COPYING
|
||||
EFIVAR_INSTALL_STAGING = YES
|
||||
EFIVAR_DEPENDENCIES = host-efivar
|
||||
|
||||
# -fPIC is needed at least on MIPS, otherwise fails to build shared
|
||||
# -library.
|
||||
# SUBDIRS is redefined so it skips building docs.
|
||||
# LD_DASH_T is redefined as the linker detection does not seem to
|
||||
# work properly for cross-compilation.
|
||||
EFIVAR_MAKE_OPTS = \
|
||||
libdir=/usr/lib \
|
||||
LDFLAGS="$(TARGET_LDFLAGS) -fPIC" \
|
||||
TOPDIR=$(@D) \
|
||||
SUBDIRS=src \
|
||||
LD_DASH_T=-T
|
||||
|
||||
define HOST_EFIVAR_BUILD_CMDS
|
||||
# makeguids is an internal host tool and must be built separately with
|
||||
# $(HOST_CC), otherwise it gets cross-built.
|
||||
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) \
|
||||
CFLAGS="$(HOST_CFLAGS) -std=gnu99" \
|
||||
TOPDIR=$(@D) CFLAGS_GCC= \
|
||||
$(MAKE) -C $(@D)/src makeguids
|
||||
endef
|
||||
|
||||
define EFIVAR_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
|
||||
$(EFIVAR_MAKE_OPTS) \
|
||||
all
|
||||
endef
|
||||
|
||||
define HOST_EFIVAR_INSTALL_CMDS
|
||||
$(INSTALL) -D -m 0755 $(@D)/src/makeguids $(HOST_DIR)/bin/makeguids
|
||||
endef
|
||||
|
||||
define EFIVAR_INSTALL_STAGING_CMDS
|
||||
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
|
||||
$(EFIVAR_MAKE_OPTS) \
|
||||
DESTDIR="$(STAGING_DIR)" \
|
||||
install
|
||||
endef
|
||||
|
||||
define EFIVAR_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
|
||||
$(EFIVAR_MAKE_OPTS) \
|
||||
DESTDIR="$(TARGET_DIR)" \
|
||||
install
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
$(eval $(host-generic-package))
|
||||
Reference in New Issue
Block a user