Add bmake to the build and allow it to be installed as make(1) instead
of FreeBSD's make by setting WITH_BMAKE.  The WITH_BMAKE build makes it
easy for people to switch while working out the kinks -- think ports
tree here.  The option will be removed in due time.

Submitted by:	Simon Gerraty (sjg@juniper.net)
make: report :M or :N pattern in debug mode

MFC after:	12 days
ktrace/kern_exec: check p_tracecred instead of p_cred

.. when deciding whether to continue tracing across suid/sgid exec.
Otherwise if root ktrace-d an unprivileged process and the processed
exec-ed a suid program, then tracing didn't continue across exec.

Reviewed by:	bde, kib
MFC after:	22 days
zfs boot: chose a "first" pool if none is explicitly requested

MFC after:	8 days
zfs boot: add code for listing child datasets of a given dataset

- only filesystem datasets are supported
- children names are printed to stdout

To do: allow to iterate over the list and fetch names programatically

MFC after:	17 days
zfs boot: add lszfs command to i386 loader

... to list child datasets of a specified dataset.
Dataset name should be provided in poolname/dsname format.

MFC after:	17 days
Update to include WITH_BMAKE.
zfs_mount: taste geom providers for root pool config

This should allow to mount a dataset as a root filesystem even if
it belongs to a pool that is not described in zpool.cache.
This adds some overhead to the boot process though.

If the root filesystem's pool is found in zpool.cache, the by default
its cached configuration will be used for import.
vfs.zfs.rootpool.prefer_cached_config could be set to zero to force
the config to be retasted.

Discussed with:	gibbs, pjd, des
MFC after:	25 days
In general pmap implementations do not set the wired attribute on
the temporary mappings that are used to implement operations like
pmap_zero_page().  There is no reason for the MIPS pmap to deviate
from that practice.
zfsboot: use the same zfs dataset naming format as loader

Also, pool name alone now names a root dataset of the pool regardless
of bootfs property value.

MFC after:	15 days
boot/zfs: call zfs_spa_init for all found pools

... and drop those for which it fails.
Also, add more sanity checking to the function.

MFC after:	16 days
boot/zfs: a small whitespace cleanup

MFC after:	5 days
zfs boot spa_status: print bootfs for each reported pool

MFC after:	9 days
zfs loader: treat plain pool name as a name of its root dataset

... as opposed to the previous behavior of treating it as boot
dataset (specified by bootfs or default)

MFC after:	19 days
zfs boot: export boot/primary pool and vdev guid all the way to kenv

This is work in progress to for znextboot and it also provides
some convenient infrastructure.

MFC after:	20 days
zfsboot: simplify probe_drive() a little bit

The first discovered pool, whether it covers the whole boot disk or not,
is going to be first in zfs_pools list.  So there is no need at all
for spapp parameter.

This commit also fixes a bug where NULL would be assigned to NULL
pointer when probe_drive was called  with the spapp parameter of NULL.

MFC after:	21 days
cngetc: use cpu_spinwait to ease the cncheckc loop a tiny bit

Reviewed by:	julian
MFC after:	10 days
g_part_taste: directly destroy consumer and geom here, no need for withering

Besides withered but still alive consumers may interfere with
re-tatsing.

MFC after:	16 days
zvol: set mediasize in geom provider right upon its creation

... instead of deferring the action until first open.
Unlike upstream this has no benefit on FreeBSD.
We know that as soon as the provider is created it is going to be tasted
and thus opened.  Initial mediasize of zero causes tasting failure
and subsequent retasting because of the size change.

MFC after:	14 days
Add support for bmake. This includes:
1.  Don't do upgrade_checks when using bmake. As long as we have WITH_BMAKE,
    there's a bootstrap complication in ths respect. Avoid it. Make the
    necessary changes to have upgrade_checks work wth bmake anyway.
2.  Remove the use of -E. It's not needed in our build because we use ?= for
    the respective variables, which means that we'll take the environment
    value (if any) anyway.
3.  Properly declare phony targets as phony as bmake is a lot smarter (and
    thus agressive) about build avoidance.
4.  Make sure CLEANFILES is complete and use it on .NOPATH. bmake is a lot
    smarter about build avoidance and should not find files we generate in
    the source tree. We should not have files in the repository we want to
    generate, but this is an easier way to cross this hurdle.
5.  Have behavior under bmake the same as it is under make with respect to
    halting when sub-commands fail. Add "set -e" to compound commands so
    that bmake is informed when sub-commands fail.
6.  Make sure crunchgen uses the same make as the rest of the build. This
    is important when the make utility isn't called make (but bmake for
    example).
7.  While here, add support for using MAKEOBJDIR to set the object tree
    location. It's the second alternative bmake looks for when determining
    the actual object directory (= .OBJDIR).

Submitted by:	Simon Gerraty <sjg@juniper.net>
Submitted by:	John Van Horne <jvanhorne@juniper.net>