Include bsd.own.mk for MK_CASPER to work.

Reported by:	nwhitehorn


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259440 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Properly drain the TTY when both revoke(2) and close(2) end up closing
the TTY. In such a case, ttydev_close() is called multiple times and
each time, t_revokecnt is incremented and cv_broadcast() is called for
both the t_outwait and t_inwait condition variables.
Let's say revoke(2) comes in first and gets to call tty_drain() from
ttydev_leave(). Let's say that the revoke comes from init(8) as the
result of running "shutdown -r now". Since shutdown prints various
messages to the console before announing that the machine will reboot
immediately, let's also say that the output queue is not empty and
that tty_drain() has something to do. Let's assume this all happens
on a 9600 baud serial console, so it takes a time to drain.
The shutdown command will exit(2) and as such will end up closing
stdout. Let's say this close will come in second, bump t_revokecnt
and call tty_wakeup(). This has tty_wait() return prematurely and
the next thing that will happen is that the thread doing revoke(2)
will flush the TTY. Since the drain wasn't complete, the flush will
effectively drop whatever is left in t_outq.

This change takes into account that tty_drain() will return ERESTART
due to the fact that t_revokecnt was bumped and in that case simply
call tty_drain() again. The thread in question is already performing
the close so it can safely finish draining the TTY before destroying
the TTY structure.

Now all messages from shutdown will be printed on the serial console.

Obtained from:	Juniper Networks, Inc.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259441 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
tzfile.5: catch up to r204333

The stdtime sources were moved from lib/libc to contrib/tzcode, and tzfile.h
is not an installed header, so the man page refers to its location in the
source tree.

The documentation could be more clear about the internal nature of the
header, but those changes should go through upstream tzcode.

PR:	docs/176864
Approved by:	hrs (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259446 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix regression issue after r259248:

Some Intel XHCI controlles timeout processing so-called "TRBs" when
the final LINK TRB of a so-called "TD" has the CHAIN-BIT set.

MFC after:	1 week
Tested by:	glebius @


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259462 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Start-up script for casperd daemon.

Sponsored by:	The FreeBSD Foundation


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259463 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix periodic per-CPU timers startup on boot.

Reported by:	neel
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259464 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a fix for Long-standing problem with VMware. Described in below links:
https://communities.vmware.com/thread/107230
https://communities.vmware.com/docs/DOC-11677

Basically, ignore the ``function 62'' and ``function 63'' interpretations
of the left/right command key when we're in the lengthiest portion of the
installation (initiated by the `auto' module).

The net effect is that you can now (once you've started the installer from
the media) escape the VM without prematurely terminating the current action
due to spurious escape sequence.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259468 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Mask error from newaliases(1) when the hostname is not fully qualified.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259469 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
As per discussions on -current, re-add /var/mail (removed in r257842) but
this time with atime=on in support of various software that requires it.

Discussed on:	-current
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259470 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add myself to the src-committers list

Approved by:	bapt (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259471 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Accept NULL input as also meaning zero swap.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259472 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Enable llvm's integrated assembler for PowerPC, since it should now be
good enough for typical usage.

Requested by:	rdivacky
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259473 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Bug-fixes and debugging improvments:
+ De-obfuscate debugging to show actual values
+ Change graid(8) syntax; s/destroy/delete/ [destroy is not invalid syntax]
+ Log commands that were previously quiet
+ Added some new comemnts and updated some existing ones
+ Add missing local for `disk' used in zfs_create_boot()
+ Use $disks instead of multiply-expanding $* in zfs_create_boot()
+ Pedantically unset variable holding geli(8) passphrase after use
+ Pedantically add double-quotes around zpool names and zfs datasets
+ Fix quotation expansion for zpool_cache entries of loader.conf(5)
+ Some limited whitespace changes

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259474 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Migrate the sendfile_sync struct to use a UMA zone rather than M_TEMP.

This allows it to be better tracked as well as being able to leverage
UMA for more interesting/useful behaviour at a later date.

Sponsored by:	Netflix, Inc.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259475 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Improve default ZFS disk layout (tested):
+ For GPT, always provision zfs# partition after swap [for resizability]
+ For MBR, always use a boot pool to relialy place root vdevs at EOD
NB: Fixes edge-cases where MBR combination failed boot (e.g. swap-less)
+ Generalize boot pool logic so it can be used for any scheme (namely MBR)
+ Update existing comments and some whitespace fixes
+ Change some variable names to make reading/debugging the code easier
  in zfs_create_boot() (namely prepend zroot_ or bootpool_ to property)
+ Because zroot vdevs are at EOD, no longer need to calculate partsize
  (vdev consumes remaining space after allocating swap)
+ Optimize processing of disks -- no reason to loop over the disks 3-4
  separate times when we can logically use a single loop to do everything

Discussed on:	-stable
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259476 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
fletcher4 is currently the default.

Discussed on:	-current
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259477 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
De-uglify the geli(8)-setup infobox by adding a newline.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259478 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add kern.geom.label.disk_ident.enable="0" to loader.conf(5).

Discussed on:	-current, -stable
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259479 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix a long-standing edge-case that would result in a ghosted `zroot' pool
and subsequent headaches caused by multiple pools with the same name.
Specifically, blast away any labels on the designated swap partition.
Problem was when you install to a given layout *with* swap and then turn
around and re-install the same layout *without* swap (we weren't doing a
labelclear for the swap device, so would end up with an "UNAVAIL" status
zroot pool that may only exist in the pool cache).

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259480 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Auto-enable 4k sector alignment when disk encryption is requested (it is
required in such a case). But don't prevent the user from pointing the
gun at his/her foot -- you can disable 4k alignment after enabling geli).

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259481 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f