Commit Graph

3880 Commits

Author SHA1 Message Date
Warner Losh
0b9bfebf8b Use defs.mk defins in most MD code
Use defines from defs.mk in most MD code (the biggest exception is
x86, which will be its own commit due to its size). Prefer including
bsd.init.mk over the variations (../Makefile.inc and src.opts.mk being
the two biggest ones).

Sponsored by: Netflix
2017-10-30 03:12:28 +00:00
Warner Losh
05c2ec42c6 Cleanup non-arch Makefiles
Use SYSDIR, BOOTSRC, LDRSRC and FDTSRC in preference to relative
paths. Also, use bsd.init.mk where needed.

Sponsored by: Netflix
2017-10-29 05:27:22 +00:00
Warner Losh
f08693930b Define new EFI variables
Define EFISRC, EFIINC and EFIINCMD. Use them, as well as using other
symbols defined in defs.mk. Prefer <bsd.init.mk> to ../../Makefile.inc
or <src.opts.mk>.

Sponsored by: Netflix
2017-10-29 05:26:59 +00:00
Emmanuel Vadot
7562d7ddbd loader.efi: Make framebuffer commands available for arm64
Move framebuffer.{c,h} to sys/boot/efi/loader and add the efifb
related metadata and pass it to the kernel

Reviewed by:	imp, andrew
Differential Revision:	https://reviews.freebsd.org/D12757
2017-10-25 18:55:04 +00:00
Warner Losh
e1b6a0cd96 Remove sys/boot/arm/at91 and ixp425
Remove at91 bootloader. It only worked on AT91RM9200, and only
specific boards that were all EOLd 10 years ago.

Remove ixp425. It doesn't build anymore and is for boards that were
EOLd 8 years ago.

Sponsored by: Netflix
2017-10-25 15:28:05 +00:00
Warner Losh
b533f63ed0 Move BINDIR definition to defs.mk, and override where it isn't /boot
(those files already do that so weren't changed).

Sponsored by: Netflix
2017-10-25 15:27:58 +00:00
Warner Losh
2125122d25 Use BOOTDIR consistently. We need to include bsd.init.mk early to make
this happen. This will cause src.opts.mk to be included, so remove
that. This needs to propigate through the sys/boot tree.

Sponsored by: Netflix
2017-10-25 15:27:53 +00:00
Warner Losh
6c458a6a56 Use preferred defined paths, rather than relative paths in fdt.
Sponsored by: Netflix
2017-10-22 22:52:27 +00:00
Warner Losh
404a0a2f40 Use SYSDIR instead of ${.CURDIR}/../..<etc>/sys.
Sponsored by: Netflix
2017-10-22 22:50:28 +00:00
Warner Losh
b022947e0e Use BOOTSRC here.
sponsored by: Netflix
2017-10-22 22:50:23 +00:00
Warner Losh
45e0c11351 Prefer SRCTOP paths for bits we're grabbing from libc.
Sponsored by: Netflix
2017-10-22 22:50:19 +00:00
Warner Losh
254ba2c985 Make at91 boot loader compile again.
No clue if it actually still works, but it might.
2017-10-22 22:50:15 +00:00
Warner Losh
cb3ee5c694 End source directories with SRC rather than a hodgepodge of names
BOOTDIR->BOOTSRC
FICLDIR->FICLSRC
LDR_MI->LDRSRC

This matches the patterns used in the rest of the system a bit vetter.

Suggested by: rgrimes@
Sponsored by: Netflix
2017-10-22 22:50:08 +00:00
Warner Losh
392c874409 Move fdt and uboot defines into common uboot.mk.
Sponsored by: Netflix
2017-10-22 22:49:51 +00:00
Warner Losh
cced8b11d9 Define LIBSA32 to LIBSA on i386 to fix build.
Sponsored by: Netflix
2017-10-22 07:25:28 +00:00
Warner Losh
4b165a5f12 Use BOOTOBJ and BOOTDIR to find geli includes and libraries.
Sponsored by: Netflix
2017-10-22 03:52:22 +00:00
Warner Losh
cee8ef91e3 Stopgap fix to the mistmatch between LOADER_GELI_SUPPORT and
LOADER_NO_GELI_SUPPORT. To disable geli support in the loader, define
LOADER_GELI_SUPPORT=no. Proper warnings for for old build options to
follow.

Sponsored by: Netflix
2017-10-22 03:52:12 +00:00
Warner Losh
d1d01d440c Introduce BOOTOBJ: The top level object directory for the boot tree
and use it in preference to spelling out the path.

Sponsored by: Netflix
2017-10-22 03:52:08 +00:00
Warner Losh
913dd6b0fa Use BOOTDIR more consistently in defs.mk rather than repeat sys/boot.
Sponsored By: Netflix
2017-10-22 03:52:03 +00:00
Toomas Soome
47243561f4 libsa/ip: stop read loop on bad fragments
Lets try to clear out from case of overlapping etc fragments and stop read.

Reported by:	Dan McDonald
2017-10-18 08:06:05 +00:00
Toomas Soome
9d3fb104c9 libsa/ip.c: misplaced comment, ip_v is half char, not ip_p
The comment should be at previous line.

Reported by:	Dan McDonald
2017-10-18 07:39:21 +00:00
Warner Losh
b0900232b9 Revert "Unify boot1 with loader" change r324646
Back out the unification commit to boot1. There's some issues on the
arm and arm64 platforms that need to be addressed with code
changes. There's also a discussion on arch@ about the future of
boot1.efi vs just using loader.efi that needs to play out. So take a
pause on these changes until the arm issues can be fixed and it's
clear boot1.efi will survive into FreeBSD 12.

OK'd by: Eric@meatspace
2017-10-17 23:38:27 +00:00
Ed Maste
14481f92c4 loader.mk: clean md.o even if MD_IMAGE_SIZE not defined
We don't normally provide special handling for optionally-included src
files, but md.o depends on both md.c and the value of ${MD_IMAGE_SIZE}.
Previously if one built with MD_IMAGE_SIZE, executed "make clean", and
then built with a different MD_IMAGE_SIZE md.o would not be rebuilt.

Reported by:	Zakary Nafziger
Sponsored by:	The FreeBSD Foundation
2017-10-17 19:11:29 +00:00
Warner Losh
1118d57b36 We need to include disk.o in libuboot.a when we're building with
support for disk access.

Sponsored by: Netflix
2017-10-17 19:11:19 +00:00
Ed Maste
3a4661b9b4 loader: initialize dv_cleanup in md.c to eliminate clang warning
Submitted by:	Zakary Nafziger <worldofzak@gmail.com>
Sponsored by:	The FreeBSD Foundation
2017-10-17 18:00:01 +00:00
Warner Losh
e4e7fb2337 Explicitly inlcude SYSDIR in the include path -- need machine path too? 2017-10-16 03:59:58 +00:00
Warner Losh
a7fa2fb669 LOADER_foo_SUPPORTED 2017-10-16 03:59:52 +00:00
Warner Losh
6b9f688352 Move all the ficl common code into ficl.mk
There's a number of copies of basically identical code to enable
building forth in /boot/loader. Move it all into ficl.mk.
2017-10-16 03:59:44 +00:00
Warner Losh
8ed8e50775 create defs.mk for common definitions 2017-10-16 03:59:38 +00:00
Warner Losh
bcbe0c006e tweak style 2017-10-16 03:59:33 +00:00
Warner Losh
7f20726e4b Move common/Makefile.inc to sys/boot/loader.mk.
Makefile.inc has a specific meaning in the tree, and
common/Makefile.inc doesn't quite fit into that. Rename it to
loader.mk and it will be a place to collect common things to all
/boot/loader programs there.

Sponsored by: Netflix
2017-10-16 03:59:28 +00:00
Warner Losh
7e705f54f8 Rename top level Makefile.ficl to ficl.mk. 2017-10-16 03:59:22 +00:00
Warner Losh
6c4b856dbe Move orphaned man pages into new man directory from common. This helps
keep cleaer that common is just for the MI files for /boot/loader
programs.

Sponsored by: Netflix
2017-10-16 03:59:17 +00:00
Warner Losh
cb0ba37ec5 Unify boot1 with loader
Refactor boot1 to use the same I/O code as /boot/loader uses. Refactor
to use the common efi_main.c.

Submitted by: Eric McCorkle
Differential Revision: https://reviews.freebsd.org/D10447
2017-10-16 03:59:11 +00:00
Warner Losh
042ea0aa16 Move panic back into libsa. It's documented in libstand(3) to belong
there.

Sponsored by: Netflix
2017-10-12 15:16:27 +00:00
Warner Losh
a37f4eb659 Define prototype for exit and ensure references
Define a prototype for exit in stand.h. Provide a reference to exit in
a few conf.c files to ensure that its definition gets pulled in early.
Since exit() is a MD routine, it isn't defined in libsa. However,
libsa tends to be listed last and will soon have panic() in it which
calls exit(). The reference to exit early ensures that the MD exit is
available to satisfy linking for static libraries.
2017-10-12 15:16:22 +00:00
Warner Losh
1461c26d38 Rename exit to efi_exit to avoid clashing with libsa exit definition
Rename exit to efi_exit. It doesn't have the proper signature and
conflicts with standard definition. Provide the standard definition as
well.

Sponsored by: Netflix
2017-10-12 15:16:16 +00:00
Warner Losh
9576e1ee54 Move ufsread.c
Move ufsread.c from sys/boot/common (which used to be all the common
files for /boot/loader, but grew to be all the common files for
sys/boot, but that's now sys/boot/libsa's job) to sys/boot/libsa.

Sponsored by: Netflix
2017-10-12 14:57:05 +00:00
Warner Losh
cd955ec800 Honor CFLAGS modifications in Makefile.inc by using += here. There's
no hyper-small space constraints, so there's no reason to tightly
control it.

Sponsored by: Netflix
2017-10-12 14:57:00 +00:00
Warner Losh
6f0970a4c6 Move crc32.c, util.c and gpt.c over to libsa.
Sponsored by: Netflix
2017-10-12 14:56:54 +00:00
Warner Losh
917587f435 Rename libstand.a to libsa.a and libstand32.a to libsa32.a
Sponsored by: Netflix
2017-10-12 14:56:48 +00:00
Warner Losh
3006b7c8a9 Kill the userboot copy of libstand.
It's not needed (it's now identical to libsa, and seems to have been
for some time).

Sponsored by: Netflix
2017-10-12 14:56:42 +00:00
Warner Losh
4eb1313ff2 Move lib/libstand to sys/boot/libsa
Move the sources to sys/boot. Make adjustments related to the
move. Kill LIBSTAND_SRC since it's no longer needed.

Sponsored by: Netflix
2017-10-12 14:56:28 +00:00
Enji Cooper
6cea2e6b1a Fix typos: stand alon{e,g} should be spelled like standalone 2017-10-10 04:53:26 +00:00
Warner Losh
b9b9a7c3a2 Rather than laying whack-a-mole with including the path to stand.h,
always include it. Remove places where we explicitly include it. This
also helps reduce the 'cut-and-paste' factor of these Makefiles.

Sponsored by: Netflix
2017-10-10 01:31:44 +00:00
Warner Losh
e1ff8b2f35 Create sys/boot/libsa and build libstand.a there
Build libstand from inside the sys/boot build. Redirect all users in
sys/boot to grab it from there. We still build it as libstand.a for
the moment. When lib/libstand is moved here, we'll change the name.

Sponsored by: Netflix
2017-10-09 22:12:53 +00:00
Warner Losh
8f409b435a Define LIBSA* and use them instead of overloaded LIBSTAND
LIBSA is the current stand alone library. LIBSA32 is the 32-bit
version of the library. LIBSAU is the userboot version of libsa. Use
the proper define instead of the more generic define.

Sponsored by: Netflix
2017-10-09 22:12:46 +00:00
Warner Losh
0b2c7b3f7e Add missing -I${SASRC} in a couple of places so that stand.h doesn't
accidentally come in via host pollution.

Sponsored by: Netflix
2017-10-09 22:12:39 +00:00
Warner Losh
eca8b9c449 Define SASRC and use it
Define SASRC to point to the current libstand sources. Include
../Makefile.inc early enough in a few places so we can .include
"${SASRC}/Makefile" and have it work. Create a new pass-up
Makefile.inc in sys/boot/userboot to allow this pattern to work.

Sponsored by: Netflix
2017-10-09 22:12:32 +00:00
Warner Losh
6a971c1732 Prefer ${LIBSTAND} to -lstand
Sponsored by: Netflix
2017-10-09 22:11:57 +00:00