freebsd-dev/sys/boot/i386/loader/Makefile

142 lines
3.3 KiB
Makefile
Raw Normal View History

1999-08-28 01:08:13 +00:00
# $FreeBSD$
.include <src.opts.mk>
MK_SSP= no
LOADER?= loader
PROG= ${LOADER}.sym
MAN=
INTERNALPROG=
NEWVERSWHAT?= "bootstrap loader" x86
VERSION_FILE= ${.CURDIR}/../loader/version
LOADER_NET_SUPPORT?= yes
LOADER_NFS_SUPPORT?= yes
LOADER_TFTP_SUPPORT?= yes
# architecture-specific loader code
SRCS= main.c conf.c vers.c
# Put LOADER_FIREWIRE_SUPPORT=yes in /etc/make.conf for FireWire/dcons support
.if defined(LOADER_FIREWIRE_SUPPORT)
CFLAGS+= -DLOADER_FIREWIRE_SUPPORT
LIBFIREWIRE= ${.OBJDIR}/../libfirewire/libfirewire.a
.endif
# Set by zfsloader Makefile
Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes. This bring huge amount of changes, I'll enumerate only user-visible changes: - Delegated Administration Allows regular users to perform ZFS operations, like file system creation, snapshot creation, etc. - L2ARC Level 2 cache for ZFS - allows to use additional disks for cache. Huge performance improvements mostly for random read of mostly static content. - slog Allow to use additional disks for ZFS Intent Log to speed up operations like fsync(2). - vfs.zfs.super_owner Allows regular users to perform privileged operations on files stored on ZFS file systems owned by him. Very careful with this one. - chflags(2) Not all the flags are supported. This still needs work. - ZFSBoot Support to boot off of ZFS pool. Not finished, AFAIK. Submitted by: dfr - Snapshot properties - New failure modes Before if write requested failed, system paniced. Now one can select from one of three failure modes: - panic - panic on write error - wait - wait for disk to reappear - continue - serve read requests if possible, block write requests - Refquota, refreservation properties Just quota and reservation properties, but don't count space consumed by children file systems, clones and snapshots. - Sparse volumes ZVOLs that don't reserve space in the pool. - External attributes Compatible with extattr(2). - NFSv4-ACLs Not sure about the status, might not be complete yet. Submitted by: trasz - Creation-time properties - Regression tests for zpool(8) command. Obtained from: OpenSolaris
2008-11-17 20:49:29 +00:00
.if defined(LOADER_ZFS_SUPPORT)
CFLAGS+= -DLOADER_ZFS_SUPPORT
LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a
Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes. This bring huge amount of changes, I'll enumerate only user-visible changes: - Delegated Administration Allows regular users to perform ZFS operations, like file system creation, snapshot creation, etc. - L2ARC Level 2 cache for ZFS - allows to use additional disks for cache. Huge performance improvements mostly for random read of mostly static content. - slog Allow to use additional disks for ZFS Intent Log to speed up operations like fsync(2). - vfs.zfs.super_owner Allows regular users to perform privileged operations on files stored on ZFS file systems owned by him. Very careful with this one. - chflags(2) Not all the flags are supported. This still needs work. - ZFSBoot Support to boot off of ZFS pool. Not finished, AFAIK. Submitted by: dfr - Snapshot properties - New failure modes Before if write requested failed, system paniced. Now one can select from one of three failure modes: - panic - panic on write error - wait - wait for disk to reappear - continue - serve read requests if possible, block write requests - Refquota, refreservation properties Just quota and reservation properties, but don't count space consumed by children file systems, clones and snapshots. - Sparse volumes ZVOLs that don't reserve space in the pool. - External attributes Compatible with extattr(2). - NFSv4-ACLs Not sure about the status, might not be complete yet. Submitted by: trasz - Creation-time properties - Regression tests for zpool(8) command. Obtained from: OpenSolaris
2008-11-17 20:49:29 +00:00
.endif
.if defined(LOADER_NET_SUPPORT)
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
.endif
.if defined(LOADER_TFTP_SUPPORT)
CFLAGS+= -DLOADER_TFTP_SUPPORT
.endif
.if defined(LOADER_NFS_SUPPORT)
CFLAGS+= -DLOADER_NFS_SUPPORT
.endif
# Include bcache code.
HAVE_BCACHE= yes
# Enable PnP and ISA-PnP code.
HAVE_PNP= yes
HAVE_ISABUS= yes
.if ${MK_FORTH} != "no"
# Enable BootForth
BOOT_FORTH= yes
CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
.if ${MACHINE_CPUARCH} == "amd64"
LIBFICL= ${.OBJDIR}/../../ficl32/libficl.a
.else
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
.endif
.endif
.if defined(LOADER_BZIP2_SUPPORT)
CFLAGS+= -DLOADER_BZIP2_SUPPORT
.endif
.if !defined(LOADER_NO_GZIP_SUPPORT)
CFLAGS+= -DLOADER_GZIP_SUPPORT
.endif
.if defined(LOADER_NANDFS_SUPPORT)
CFLAGS+= -DLOADER_NANDFS_SUPPORT
.endif
.if !defined(LOADER_NO_GELI_SUPPORT)
CFLAGS+= -DLOADER_GELI_SUPPORT
CFLAGS+= -I${.CURDIR}/../../geli
LIBGELIBOOT= ${.OBJDIR}/../../geli/libgeliboot.a
.PATH: ${.CURDIR}/../../../opencrypto
SRCS+= xform_aes_xts.c
CFLAGS+= -I${.CURDIR}/../../.. -D_STAND
.endif
# Always add MI sources
.PATH: ${.CURDIR}/../../common
.include "${.CURDIR}/../../common/Makefile.inc"
CFLAGS+= -I${.CURDIR}/../../common
CFLAGS+= -I.
CLEANFILES= ${LOADER} ${LOADER}.bin loader.help
CFLAGS+= -Wall
LDFLAGS= -static -Ttext 0x0
# i386 standalone support library
LIBI386= ${.OBJDIR}/../libi386/libi386.a
CFLAGS+= -I${.CURDIR}/..
LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a
# BTX components
CFLAGS+= -I${.CURDIR}/../btx/lib
# Debug me!
#CFLAGS+= -g
#LDFLAGS+= -g
# Pick up ../Makefile.inc early.
.include <bsd.init.mk>
${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN}
Revert previous untested revision. The i386 loader consists of three parts: At the front is btxldr, in the middle is BTX itself (our mini-kernel), and then the 'client' (loader.bin) which is the actual loader itself. boot2 just executes a raw ELF or a.out binary with the only setup provided being that a bootinfo structure is passed on the stack. Now, since loader.bin is a BTX client, the loader needs to be able to locate a BTX kernel for the client to execute in the context. Thus, just like pxelder, btxldr uses the a.out header on the loader binary to find the BTX kernel stored in the loader and set it up. It does _not_ just reuse the BTX kernel that boot2 invoked it with. This is because it can't assume that it will _have_ a "spare" BTX kernel lying around. For example, when cdboot loads the loader there isn't an existing BTX kernel. In fact, cdboot will only work with an a.out loader as well since it also "borrows" the BTX kernel in the loader binary (which it finds by parsing the a.out header) just as pxeldr does. The only difference between cdboot and pxeldr is where they get /boot/loader from. If we wanted to make /boot/loader be an actual ELF binary we would need to change the following utilites to handle that (and they all have to be able to handle locating the BTX kernel inside of an ELF binary somehow): - btxldr - pxeldr - cdboot If we didn't want to require a flag day but make the transition smooth then we need to be able to support both a.out and ELF versions of /boot/loader which isn't exactly trivial since all three of these utilities are written in assembly. Pointy-hat to: peter
2002-08-30 14:59:47 +00:00
btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
-b ${BTXKERN} ${LOADER}.bin
${LOADER}.bin: ${LOADER}.sym
strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC}
loader.help: help.common help.i386
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
FILES= ${LOADER}
# XXX INSTALLFLAGS_loader= -b
FILESMODE_${LOADER}= ${BINMODE} -b
.if !defined(LOADER_ONLY)
.PATH: ${.CURDIR}/../../forth
.include "${.CURDIR}/../../forth/Makefile.inc"
FILES+= pcibios.4th
FILES+= loader.rc menu.rc
.endif
# XXX crt0.o needs to be first for pxeboot(8) to work
OBJS= ${BTXCRT}
DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSTAND}
LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSTAND}
.include <bsd.prog.mk>
.if ${MACHINE_CPUARCH} == "amd64"
beforedepend ${OBJS}: machine
CLEANFILES+= machine
CFLAGS+= -DLOADER_PREFER_AMD64
machine: .NOMETA
ln -sf ${.CURDIR}/../../../i386/include machine
.endif