aboutsummaryrefslogtreecommitdiff
path: root/stand/efi
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2018-08-14 18:44:41 +0000
committerWarner Losh <imp@FreeBSD.org>2018-08-14 18:44:41 +0000
commit9d45c24cc4078e0c2962ba28e5a726709fef2269 (patch)
treee459b76fd0c9a0d3e749cf8a3ef6ce4dfc6ce408 /stand/efi
parent4c5d19fda423193c9fd51548dcb45a2dccaa34da (diff)
downloadsrc-9d45c24cc4078e0c2962ba28e5a726709fef2269.tar.gz
src-9d45c24cc4078e0c2962ba28e5a726709fef2269.zip
Create a loader for each interpreter for x86 BIOS and all EFI
Create loader_{4th,lua,simp}{,.efi}. All of these are installed by default. Create LOADER_DEFAULT_INTERP to specify the default interpreter when no other is specified. LOADER_INTERP is the current interpreter language building. Turn building of lua on by default to match 4th. simploader is a simplified loader build w/o any interpreter language (but with a simple loader). This is the historic behavir you got with WITHOUT_FORTH. Make a hard link to the default loader. This has to be a hard link rather than the more desirable soft link because older zfsboot blocks don't support symlinks. RelNotes: Yes Differential Revision: https://reviews.freebsd.org/D16705
Notes
Notes: svn path=/head/; revision=337806
Diffstat (limited to 'stand/efi')
-rw-r--r--stand/efi/Makefile5
-rw-r--r--stand/efi/loader/Makefile24
-rw-r--r--stand/efi/loader_4th/Makefile6
-rw-r--r--stand/efi/loader_lua/Makefile6
-rw-r--r--stand/efi/loader_simp/Makefile6
5 files changed, 36 insertions, 11 deletions
diff --git a/stand/efi/Makefile b/stand/efi/Makefile
index 4f8dc6549662..0772609a7255 100644
--- a/stand/efi/Makefile
+++ b/stand/efi/Makefile
@@ -9,7 +9,10 @@ NO_OBJ=t
.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500
SUBDIR.${MK_FDT}+= fdt
-SUBDIR.yes+= libefi loader boot1
+SUBDIR.yes+= libefi boot1
+SUBDIR.${MK_FORTH}+= loader_4th
+SUBDIR.${MK_LOADER_LUA}+= loader_lua
+SUBDIR.yes+= loader_simp
.endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500
diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile
index ecd8acc0cf6b..77f9d598dbc8 100644
--- a/stand/efi/loader/Makefile
+++ b/stand/efi/loader/Makefile
@@ -8,7 +8,8 @@ LOADER_EXT2FS_SUPPORT?= no
.include <bsd.init.mk>
-PROG= loader.sym
+LOADER?= loader_${LOADER_INTERP}
+PROG= ${LOADER}.sym
INTERNALPROG=
WARNS?= 3
@@ -24,6 +25,7 @@ SRCS= autoload.c \
smbios.c \
vers.c
+CFLAGS+= -I${.CURDIR}/../loader
.if ${MK_ZFS} != "no"
CFLAGS+= -I${ZFSSRC}
CFLAGS+= -DEFI_ZFS_BOOT
@@ -41,10 +43,11 @@ CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized
# warnings for now.
CWARNFLAGS.main.c+= -Wno-format
-.PATH: ${.CURDIR}/arch/${MACHINE}
-# For smbios.c
+.PATH: ${.CURDIR}/../loader
+.PATH: ${.CURDIR}/../loader/arch/${MACHINE}
+# For smbios.c XXX need to abstract properly
.PATH: ${BOOTSRC}/i386/libi386
-.include "${.CURDIR}/arch/${MACHINE}/Makefile.inc"
+.include "${.CURDIR}/../loader/arch/${MACHINE}/Makefile.inc"
CFLAGS+= -I${.CURDIR}
CFLAGS+= -I${.CURDIR}/arch/${MACHINE}
@@ -78,20 +81,21 @@ HAVE_BCACHE= yes
CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE}
.endif
+NEWVERSWHAT= "EFI loader" ${MACHINE}
+VERSION_FILE= ${.CURDIR}/../loader/version
+
# Always add MI sources
.include "${BOOTSRC}/loader.mk"
-FILES+= loader.efi
-FILESMODE_loader.efi= ${BINMODE}
+FILES+= ${LOADER}.efi
+FILESMODE_${LOADER}.efi= ${BINMODE}
-LDSCRIPT= ${.CURDIR}/arch/${MACHINE}/ldscript.${MACHINE}
+LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE}
LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared
CLEANFILES+= loader.efi
-NEWVERSWHAT= "EFI loader" ${MACHINE}
-
-loader.efi: ${PROG}
+${LOADER}.efi: ${PROG}
if ${NM} ${.ALLSRC} | grep ' U '; then \
echo "Undefined symbols in ${.ALLSRC}"; \
exit 1; \
diff --git a/stand/efi/loader_4th/Makefile b/stand/efi/loader_4th/Makefile
new file mode 100644
index 000000000000..3659f7efe673
--- /dev/null
+++ b/stand/efi/loader_4th/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+LOADER_INTERP=4th
+
+.include "../loader/Makefile"
+
diff --git a/stand/efi/loader_lua/Makefile b/stand/efi/loader_lua/Makefile
new file mode 100644
index 000000000000..3a4268440cf6
--- /dev/null
+++ b/stand/efi/loader_lua/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+LOADER_INTERP=lua
+
+.include "../loader/Makefile"
+
diff --git a/stand/efi/loader_simp/Makefile b/stand/efi/loader_simp/Makefile
new file mode 100644
index 000000000000..0c27d5673941
--- /dev/null
+++ b/stand/efi/loader_simp/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+LOADER_INTERP=simp
+
+.include "../loader/Makefile"
+