head	1.5;
access;
symbols
	RELENG_9_1_0_RELEASE:1.2.2.1.4.2
	RELENG_9_1:1.2.2.1.0.4
	RELENG_9_1_BP:1.2.2.1
	RELENG_9_0_0_RELEASE:1.2.2.1.2.1
	RELENG_9_0:1.2.2.1.0.2
	RELENG_9_0_BP:1.2.2.1
	RELENG_9:1.2.0.2
	RELENG_9_BP:1.2;
locks; strict;
comment	@# @;


1.5
date	2013.01.09.00.28.22;	author svnexp;	state Exp;
branches;
next	1.4;

1.4
date	2012.11.17.01.51.20;	author svnexp;	state Exp;
branches;
next	1.3;

1.3
date	2012.08.05.12.15.15;	author ae;	state Exp;
branches;
next	1.2;

1.2
date	2011.07.01.18.31.59;	author marius;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2011.06.30.16.08.56;	author dfr;	state Exp;
branches;
next	;

1.2.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.2.2.1.2.1
	1.2.2.1.4.1;
next	1.2.2.2;

1.2.2.2
date	2012.11.17.11.36.48;	author svnexp;	state Exp;
branches;
next	1.2.2.3;

1.2.2.3
date	2012.11.18.17.11.47;	author svnexp;	state Exp;
branches;
next	1.2.2.4;

1.2.2.4
date	2013.10.10.13.01.43;	author svnexp;	state Exp;
branches;
next	;

1.2.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.2.2.1.2.2;

1.2.2.1.2.2
date	2012.11.17.08.36.47;	author svnexp;	state Exp;
branches;
next	;

1.2.2.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.2.2.1.4.2;

1.2.2.1.4.2
date	2012.11.17.08.47.37;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.5
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/245148
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@# $FreeBSD: head/sys/boot/userboot/userboot/Makefile 245148 2013-01-08 03:27:37Z grehan $

NO_MAN=
WITHOUT_SSP=

.include <bsd.own.mk>

SHLIB_NAME=	userboot.so
NO_CTF=		yes
STRIP=
LIBDIR=		/boot

SRCS=		autoload.c
SRCS+=		bootinfo.c
SRCS+=		bootinfo32.c
SRCS+=		bootinfo64.c
SRCS+=		conf.c
SRCS+=		console.c
SRCS+=		copy.c
SRCS+=		devicename.c
SRCS+=		elf32_freebsd.c
SRCS+=		elf64_freebsd.c
SRCS+=		host.c
SRCS+=		main.c
SRCS+=		userboot_cons.c
SRCS+=		userboot_disk.c
SRCS+=		vers.c

CFLAGS+=	-Wall
CFLAGS+=	-I${.CURDIR}/..
CFLAGS+=	-I${.CURDIR}/../../common
CFLAGS+=	-I${.CURDIR}/../../..
CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand
CFLAGS+=	-ffreestanding -I.

LDFLAGS+=	-nostdlib -Wl,-Bsymbolic

NEWVERSWHAT=	"User boot" ${MACHINE_CPUARCH}

vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}

CLEANFILES=	vers.c

.if ${MK_FORTH} != "no"
BOOT_FORTH=	yes
CFLAGS+=        -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
CFLAGS+=	-DBF_DICTSIZE=15000
LIBFICL=	${.OBJDIR}/../ficl/libficl.a
LIBSTAND=	${.OBJDIR}/../libstand/libstand.a
.endif

# Always add MI sources 
.PATH:		${.CURDIR}/../../common
.include	"${.CURDIR}/../../common/Makefile.inc"
CFLAGS+=	-I${.CURDIR}/../../common
CFLAGS+=	-I.
DPADD=		${LIBFICL} ${LIBSTAND}
LDADD=		${LIBFICL} ${LIBSTAND}

.include <bsd.lib.mk>
@


1.4
log
@Switching exporter and resync
@
text
@d1 1
a1 1
# $FreeBSD: head/sys/boot/userboot/userboot/Makefile 239058 2012-08-05 12:15:15Z ae $
d48 1
@


1.3
log
@SVN rev 239058 on 2012-08-05 12:15:15Z by ae

Introduce new API to work with disks from the loader's drivers.
It uses new API from the part.c to work with partition tables.

Update userboot's disk driver to use new API. Note that struct
loader_callbacks_v1 has changed.
@
text
@d1 1
a1 1
# $FreeBSD$
@


1.2
log
@SVN rev 223712 on 2011-07-01 18:31:59Z by marius

Fix r223695 to compile on architectures which don't use the MBR scheme; wrap
the MBR support in the common part of the loader in #ifdef's and enable it
only for userboot for now.
@
text
@a34 1
CFLAGS+=	-DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT
@


1.2.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.2.2.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/sys/boot/userboot/userboot/Makefile 223712 2011-07-01 18:31:59Z marius $
@


1.2.2.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 243243
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r243243 | ae | 2012-11-18 17:09:29 +0000 (Sun, 18 Nov 2012) | 135 lines
## SVN ##
## SVN ## MFC 239054,239057,239058,239060,239066,239067,239068,239070,239073,
## SVN ##     239087,239088,239127,239210,239211,239230,239231,239232,239243,
## SVN ##     239292,239293,239294,239325,240272,240273,240274,240275,240276,
## SVN ##     240277,240335,240481,241023,241047,241053,241065,241068,241069,
## SVN ##     241070,241164,241809,241876
## SVN ##
## SVN ## 239054:
## SVN ##   Create the interface to work with various partition tables from the
## SVN ##   loader(8). The following partition tables are supported: BSD label, GPT,
## SVN ##   MBR, EBR and VTOC8.
## SVN ## 239057:
## SVN ##   Remove unused variables.
## SVN ## 239058:
## SVN ##   Introduce new API to work with disks from the loader's drivers.
## SVN ##   It uses new API from the part.c to work with partition tables.
## SVN ## 239060:
## SVN ##   When GPT signature is invalid in the primary GPT header, then try to
## SVN ##   read backup GPT header.
## SVN ## 239066:
## SVN ##   Add offset field to the i386_devdesc structure to be compatible with
## SVN ##   disk_devdesc structure. Update biosdisk driver to the new disk API.
## SVN ## 239067:
## SVN ##   Remove unneeded flag.
## SVN ## 239068:
## SVN ##   Teach the ZFS use new partitions API when probing.
## SVN ##   Note: now ZFS does probe only for partitions with type "freebsd-zfs"
## SVN ##   and "freebsd".
## SVN ## 239070:
## SVN ##   Add simple test program that uses the partition tables handling code.
## SVN ##   It is useful to test and debug how boot loader handles partition tables
## SVN ##   metadata.
## SVN ## 239073:
## SVN ##   Bump USERBOOT_VERSION.
## SVN ## 239087:
## SVN ##   Add to the debug output the offset from the parent partitioning scheme.
## SVN ## 239088:
## SVN ##   Fix start offset calculation for the EBR partitions.
## SVN ## 239127:
## SVN ##   As it turned out, there are some installations, where BSD label
## SVN ##   contains partitions with type zero. And it has worked.
## SVN ##   So, allow detect these partitions.
## SVN ## 239210:
## SVN ##   Add more debug messages.
## SVN ## 239211:
## SVN ##   Add another debug message.
## SVN ## 239230:
## SVN ##   Unbreak booting from the true dedicated disks.
## SVN ##   When we open the disk, check the type of partition table, that has
## SVN ##   been detected. If this is BSD label, then we assume this is DD mode.
## SVN ## 239231:
## SVN ##   Remove colons from the debug message, device name returned by the
## SVN ##   disk_fmtdev() already has the colons.
## SVN ## 239232:
## SVN ##   Restore the old behaviour. If requested partition is a BSD slice,
## SVN ##   but d_partition isn't explicitly set, then try to open BSD label and its
## SVN ##   first partition.
## SVN ## 239243:
## SVN ##   After r239066, reinitialize v86.ctl and v86.addr for int 13 EDD probing
## SVN ##   in sys/boot/i386/libi386/biosdisk.c.  Otherwise, when DISK_DEBUG is
## SVN ##   enabled, the DEBUG() macros will clobber those fields, and cause the
## SVN ##   probing to always fail mysteriously when debugging is enabled.
## SVN ## 239292:
## SVN ##   Explicitly terminate the string after strncpy(3).
## SVN ## 239293:
## SVN ##   Rework r239232 to unbreak ZFS detection on MBR slices.
## SVN ## 239294:
## SVN ##   Some BIOSes return incorrect number of sectors, make checks less
## SVN ##   strictly, to do not lost some partitions.
## SVN ## 239325:
## SVN ##   Add comment why the code has been disabled.
## SVN ## 240272:
## SVN ##   Make struct uboot_devdesc compatible with struct disk_devdesc.
## SVN ## 240273:
## SVN ##   Use disk_fmtdev() and disk_parsedev() functions from the new DISK API.
## SVN ## 240274:
## SVN ##   Update uboot's disk driver to use new DISK API.
## SVN ## 240275:
## SVN ##   Build disk.c only when DISK_SUPPORT is enabled.
## SVN ## 240276:
## SVN ##   Update according to the change of struct uboot_devdesc.
## SVN ## 240277:
## SVN ##   Handle LOADER_NO_DISK_SUPPORT knob in the arm and powerpc ubldr.
## SVN ## 240335:
## SVN ##   Slightly reduce an overhead for the open() call in the zfsloader.
## SVN ##   libstand(3) tries to detect file system in the predefined order,
## SVN ##   but zfsloader usually is used for the booting from ZFS, and there is
## SVN ##   no need to try detect several file system types for each open() call.
## SVN ## 240481:
## SVN ##   The MBR data is not necessarily aligned.  This is a problem on ARM.
## SVN ## 241023:
## SVN ##   Make the loader a bit smarter, when it tries to open disk and the slice
## SVN ##   number is not exactly specified. When the disk has MBR, also try to read
## SVN ##   BSD label after ptable_getpart() call. When the disk has GPT, also set
## SVN ##   d_partition to 255.  Mostly, this is how it worked before.
## SVN ## 241047:
## SVN ##   Disable splitfs support, since we aren't support floppies for a long
## SVN ##   time. This slightly reduces an overhead, when loader tries to open
## SVN ##   file that doesn't exist.
## SVN ## 241053:
## SVN ##   Almost each time when loader opens a file, this leads to calling
## SVN ##   disk_open(). Very often this is called several times for one file.
## SVN ##   This leads to reading partition table metadata for each call. To
## SVN ##   reduce the number of disk I/O we have a simple block cache, but it
## SVN ##   is very dumb and more than half of I/O operations related to reading
## SVN ##   metadata, misses this cache.
## SVN ##
## SVN ##   Introduce new cache layer to resolve this problem. It is independent
## SVN ##   and doesn't need initialization like bcache, and will work by default
## SVN ##   for all loaders which use the new DISK API. A successful disk_open()
## SVN ##   call to each new disk or partition produces new entry in the cache.
## SVN ##   Even more, when disk was already open, now opening of any nested
## SVN ##   partitions does not require reading top level partition table.
## SVN ##   So, if without this cache, partition table metadata was read around
## SVN ##   20-50 times during boot, now it reads only once. This affects the booting
## SVN ##   from GPT and MBR from the UFS.
## SVN ## 241065:
## SVN ##   Fix disk_cleanup() to work without DISK_DEBUG too.
## SVN ## 241068:
## SVN ##   Reduce the number of attempts to detect proper kld format for the amd64
## SVN ##   loader.
## SVN ## 241069:
## SVN ##   Remember the file format of the last loaded module and try to use it for
## SVN ##   next files.
## SVN ## 241070:
## SVN ##   Fix the style.
## SVN ## 241164:
## SVN ##   Replace all references to loader_callbacks_v1 with loader_callbacks.
## SVN ## 241809:
## SVN ##   Add the flags parameter to the disk_open() function and DISK_F_NOCACHE
## SVN ##   flag, that disables the caching of partition tables metadata.
## SVN ##   Use this flag for floppies in the libi386/biosdisk driver.
## SVN ## 241876:
## SVN ##   When loader tries to open GPT partition, but partition table is not GPT,
## SVN ##   then try automatically detect an appropriate partition type.
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/sys/boot/userboot/userboot/Makefile 243243 2012-11-18 17:09:29Z ae $
d35 1
@


1.2.2.4
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/256266
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/sys/boot/userboot/userboot/Makefile 256266 2013-10-10 12:46:26Z bdrewery $
d4 1
a6 1
MK_SSP=		no
@


1.2.2.1.4.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.2.2.1.4.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.1/sys/boot/userboot/userboot/Makefile 223712 2011-07-01 18:31:59Z marius $
@


1.2.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.2.2.1.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.0/sys/boot/userboot/userboot/Makefile 223712 2011-07-01 18:31:59Z marius $
@


1.1
log
@SVN rev 223695 on 2011-06-30 16:08:56Z by dfr

Add a version of the FreeBSD bootloader which can run in userland, packaged
as a shared library. This is intended to be used by BHyVe to load FreeBSD
kernels into new virtual machines.
@
text
@d35 1
a35 1
CFLAGS+=	-DLOADER_GPT_SUPPORT
@

