Use a new directory layout for checking out extra sources and
building objects.

If make is invoked like this:
  make checkout USE_NEW_LAYOUT=yes
  make build USE_NEW_LAYOUT=yes

then the layout will look like:
  $AVATAR_ROOT
  $AVATAR_ROOT/build
  $AVATAR_ROOT/docs
  $AVATAR_ROOT/examples
  $AVATAR_ROOT/gui
  $AVATAR_ROOT/nanobsd
  $AVATAR_ROOT/nas_ports
  $AVATAR_ROOT/src
  $AVATAR_ROOT/test
  $AVATAR_ROOT/tools

  $AVATAR_ROOT/../extra-src
  $AVATAR_ROOT/../extra-src/FreeBSD
  $AVATAR_ROOT/../extra-src/FreeBSD/src
  $AVATAR_ROOT/../extra-src/FreeBSD/ports
  $AVATAR_ROOT/../extra-src/nas_source

  $AVATAR_ROOT/../obj
  $AVATAR_ROOT/../obj/os-base

If USE_NEW_LAYOUT is omitted, then the old directory layout
is used.  This will allow us to test and evaluate the
new directory layout before switching over permanently.
Modify the clean target.  If the following are invoked:

   (1)  make clean USE_NEW_LAYOUT=yes
        -> this will only blow away objects generated during the
           build which exist under $AVATAR_ROOT/../obj

   (2)  make distclean USE_NEW_LAYOUT=yes
        -> this will first do (1), and then
           blow away all sources under $AVATAR_ROOT/../extra-src
           which were checked out with 'make checkout USE_NEW_LAYOUT=yes'

If USE_NEW_LAYOUT is not specified, then the old
behavior of the clean target occurs.  This will allow us
to conditionally try out the new clean target, until we decide
to fully switch over to the new behavior.
Remove unused variable.
Fix paths in release targets for testing with USE_NEW_LAYOUT.
In 'make clean', whether using the old layout or USE_NEW_LAYOUT,
we need to blow away a directory such as $AVATAR_ROOT/FreeNAS-9.2.2-ALPHA-20140327/
which is created by the release script.

Later on, we should change the release script so that it puts
this generated directory under
$AVATAR_ROOT/../obj/release/FreeNAS-9.2.2-ALPHA-20140327/

so that generated directories don't get put under the checked out source
directory.
Clean whitespace a little to make file more readable in vi.
Rename checkout_freebsd_source() to checkout_source().

The function now actually checks out more than just FreeBSD source.
Delete unused code.
In check_sandbox(), check for the existence of .git directories
in all checkouted out directories under nas_source/ .
This is consistent with other checks in this function.
Allow overriding the checkout branch and tag passed to git
commands.

If you do:

make checkout BRANCH=somebranch

Then all repositories will be checked out from the branch "somebranch".

If you do:

make checkout TAG=sometag

Then all repositories will be checked out using the tag "sometag".

If BRANCH and TAG are omitted from the command-line of "make checkout",
then the default values of the branch and tag hardcoded in the
do_checkout.sh script are used.
Right now, each repository has a different default value for the
checkout branch and tag.

It is possible to override the checkout branch on a per repository basis.
For example, if you do:

make checkout GIT_FREEBSD_BRANCH=craig/fixbranch

then when the FreeBSD repo is checked out, instead of checking out
the FreeBSD src tree from the "feature/unified_freebsd" branch,
it will check out from the "craig/fixbranch" branch.

The following variables can be overridden:

GIT_FREEBSD_BRANCH
GIT_PORT_BRANCH
GIT_ZFSD_BRANCH
GIT_TRUENAS_COMPONENTS_BRANCH
Allow 'make checkout TAG=sometag' to work
if we have a fresh tree where no previous checkouts have been done.
Rename do_checkout to mksb, to distinguish it from do_checkout.sh.

"mksb" was the name of a tool which was part of the
OSF Development Environment for creating a "sandbox" environment for
doing development.

This name is also used elsewhere:
http://www.bsdcan.org/2011/schedule/attachments/156_BuildingBSD

The purpose of mksb is to prepare an environment for doing FreeNAS
development.  mksb does this by checking out the
sources from all the different source code repositories
which constitute a "sandbox development environment" for FreeNAS.
mksb will place the checked out sources in a hierarchy of directories
that the FreeNAS build system recognizes.

mksb will also write out any special config files into the sandbox
environment that are needed by the build system.
Rename .sb-vars to .sandbox-env
Change mksb so that it can be used in the following way:

  (1)  Invoke the tool with in its simplest form:
         ./mksb -n testdir1

  (2)  mksb will create a directory "testdir1" and
       do the initial checkout of freenas.git into a testdir1/freenas
       directory.

  (3)  mksb will write out some config files into the testdir1 "sandbox".
       This includes config files like .git-repo-setting
       which specify INTERNAL or EXTERNAL.

  (4)  mksb will chdir to "testdir1/freenas" and execute
       "make checkout"

       This will do the second-level checkout which

When mksb has completed, the user can:

   cd testdir1/freenas
   make release

The idea is to keep 'mksb' as a simple bootstrap tool which
does the initial "git clone" followed by a "make checkout".
The logic for actually checking out a full sandbox should
be kept out of mksb as much as possible.  That way, mksb
can live outside the sandbox, and not change very often.

The logic for checking out a sandbox can change more frequently,
as long as "make checkout" is the command for checking out the sandbox.
Remove the '-z' flag to do_build.sh, and instead
set "PACKAGE_PREP_BUILD=1" in the environment before calling do_build.sh
whenever we want the '-z' behavior.
This simplifies do_build.sh a little bit and makes it a bit more
clear what is going on.
We do not use this script any more.
Rename .sb-vars to .sandbox-env
Update text.
Remove unused files.
- Remove some flags to specify branch and cache.  We will bring them
  back in another way.
- Do not hardcode the git url in the script.  Force user to specify it.