MFC r268232:
  The u-boot tarball needed for some boards, BEAGLEBONE for
  example, explicitly hard-code gcc(1) as the compiler.

  Partially revert r264703, which did a post-chroot install
  of gcc(1).  This was initially removed because gcc(1) fails
  to build usr.bin/dtc/ causing the xdev target to fail.  So
  this time, move the gcc(1) installation after xdev is built.

  This change is likely applicable to stable/10 arm build
  failures, as well.

Sponsored by:	The FreeBSD Foundation
MFC	r268125:

Small merges from OpenSolaris:

These have no effect on FreeBSD, in fact they are ifdef'ed,
but make easier future merges:

6699767 panic in spec_open()

6718877 crgetzoneid() use can cause problems when forking processes with
USDT providers in a non global zone
MFC	r268193, r268203:

Fix sed(1) usage: the -i extension is not an optional.
MFC r265206:

Ignore the error from pipespace_new when creating a pipe.

It can fail if pipe map is exhausted (as a result of too many pipes created),
but it is not fatal and could be provoked by unprivileged users. The only
consequence is worse performance with given pipe.
MFC r265247:
Request a non-exiting process in sysctl_kern_proc_{o,}filedesc

This fixes a race with exit1 freeing p_textvp.
MFC r267708:

do_dup: plug redundant adjustment of fd_lastfile

By that time it was already set by fdalloc, or was there in the first place
if fd is replaced.
MFC r267710:

fd: replace fd_nfiles with fd_lastfile where appropriate

fd_lastfile is guaranteed to be the biggest open fd, so when the intent
is to iterate over active fds or lookup one, there is no point in looking
beyond that limit.

Few places are left unpatched for now.
MFC r267755:

Don't take filedesc lock in fdunshare().

We can read refcnt safely and only care if it is equal to 1.

If it could suddenly change from 1 to something bigger the code would be
buggy even in the previous form and transitions from > 1 to 1 are equally racy
and harmless (we copy even though there is no need).
MFC r267760:
Tidy up fd-related functions called by do_execve

o assert in each one that fdp is not shared
o remove unnecessary NULL checks - all userspace processes have fdtables
and kernel processes cannot execve
o remove comments about the danger of fd_ofiles getting reallocated - fdtable
is not shared and fd_ofiles could be only reallocated if new fd was about to be
added, but if that was possible the code would already be buggy as setugidsafety
work could be undone
MFC r267947:

Check lower bound of cmsg_len.

If passed cm->cmsg_len was below cmsghdr size the experssion:
datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data;

would give negative result. However, in practice it would not
result in a crash because the kernel would try to obtain garbage fds
for given process and would error out with EBADF.

PR:		124908
Submitted by:	campbell mumble.net (modified a little)
MFC r268000:

Make sure to always clear p_fd for process getting rid of its filetable.

Filetable can be shared with other processes. Previous code failed to
clear the pointer for all but the last process getting rid of the table.
This is mostly cosmetics.

Get rid of 'This should happen earlier' comment. Clearing the pointer in
this place is fine as consumers can reliably check for files availability
by inspecting fd_refcnt and vnodes availabity by NULL-checking them.
MFC r268001:
Make fdunshare accept only td parameter.

Proc had to match the thread anyway and 2 parameters were inconsistent
with the rest.
MFH: r264781, r267669, r267670

Simplify reading pw.conf(5) by using getline(3)

Removed compatibility with pre FreeBSD 2.2 pw_mkdb command [1]
Fix some broken indentattion [1]

Fix changing the username [2]

PR:		189172 [1], 189173 [2]
Submitted by:	fullermd@over-yonder.net [1][2]
MFC r268002:

Call fdcloseexec right after fdunshare.

No functional changes.
MFC	r267745, r268268:
getopt(3): recognize option:: as GNU extension for "optional options".

Also ANSIfy a function declaration.

While here update the OpenBSD patch level in getopt_long.c as we
already have the corresponding change.

Obtained from:	NetBSD
MFC after:	2 weeks
MFC 267756:

Merge intermediate OpenBSD v1.25 changes (almost identical to ours)
to reduce diff and bump OpenBSD patch level to v1.26.
267622 Log:
  Rename vt(4) vga module to dismiss interference with syscons(4) vga module.
267623 Log:
  Remove stale link to deleted vt(4) xboxfb driver.
267624 Log:
  syscons(4) and vt(4) can be built together now.
267625 Log:
  Allow to disable syscons(4) if "hw.syscons.disable" kenv is set.
267626 Log:
  Suspend vt(4) initialization if "kern.vt.disable" kenv is set.
267965 by emaste@ Log:
  Use a common tunable to choose between vt(4)/sc(4)
  With this change and previous work from ray@ it will be possible to put
  both in GENERIC, and have one enabled by default, but allow the other to
  be selected via the loader.
  (The previous implementation had separate kern.vt.disable and
  hw.syscons.disable tunables, and would panic if both drivers were
  compiled in and neither was explicitly disabled.)
268175 by emaste@ Log:
  Fix vt(4) detection in kbdcontrol and vidcontrol
  As sc(4) and vt(4) coexist and are both enabled in GENERIC, the existence
  of a vt(4) sysctl is not sufficient to determine that vt(4) is in use.
  Reported by:  Trond Endrestøl
268045 by emaste@ Log:
  Add vt(4) to GENERIC and retire the separate VT config
  vt(4) and sc(4) can now coexist in the same kernel.  To choose the vt
  driver, set the loader tunable kern.vty=vt .

Sponsored by:	The FreeBSD Foundation
MFC r268049:
Fix ifconfig to show pltime and vltime with -L option,
again after usage change from time_second to time_uptime.

PR:		188520
Submitted by:	Guy Yur <guyyur__at__gmail.com>
MFC of r263873.

Pointed by:     Ivan Klymenko <fidaj@ukr.net>

Sponsored by:	The FreeBSD Foundation
Temporary disable build of vt_efifb vt(4) driver, not all parts of UEFI support
here yet.
This direct commit to STABLE-10, because HEAD already support UEFI FB.

Sponsored by:	The FreeBSD Foundation