Make sure we don't use the wrong section for esym.

If we have a randomdata section _before_ data, we need to skip it.
Map ramdisk area separately, so that it can be unmapped later.

ok drahn@
Rework ARM ldscript for tmpfsrd.

To be able to properly use tmpfsrd, we need to be able to control
ARM's PHDRs.  This change does the following things:

 - Split up the big PHDR into multiple ones.
 - Add a program header for rodata.
 - Remove some old defines.
 - Make sure the entry address for mkuboot is correct.
Use tmpfsrd on armv7.

- Modify the scripts to use tmpfs.
- Change kernel config to boot from tmpfsrd.
emit PT_BITRIG_TMPFS_RAMDISK

emit an empty PT_BITRIG_TMPFS_RAMDISK program header when compiling the
kernel, which can be used by rdconfig(8) to embed a ramdisk.

XXX requires bitrig-binutils-0.9.2p1 on amd64
XXX requires bitrig-binutils-2.24p1 on arm

ok patrick@
look for and use PT_BITRIG_TMPFS_RAMDISK slot

look for PT_BITRIG_TMPFS_RAMDISK's slot in the kernel's program header
table and use it instead of doing 'slot = ehdr->e_phnum++', which is
horrible (and wrong).

ok patrick@
set p_memsz to p_filesz; pointed out by patrick@

ok patrick@
Run ssh-keygen -A after non-default key generation.
Create checksums for all miniroots.
Fix a wrong comparison in the interrupt handler.

ok syl@
Write to the correct control module registers when configuring gpio pins.

Tested and ok joshe@
Add missing parts of the tiic driver.

Inspired by OpenBSD.
sets sync
Improved multi-platform miniroot creation.
Standard bsd kernels should not be part of MDSETS.

Otherwise those are installed twice.
Remove outdated flag RB_DFLTROOT.

ok pedro@
skip empty PT_BITRIG_TMPFS_RAMDISK segments on amd64

version 3.29 of the bootloader saw the addition of code to detect and
load PT_BITRIG_TMPFS_RAMDISK segments contained in the kernel image.
this code, however, did not check whether such segments were empty
before rounding up their size to PAGE_SIZE. with the introduction of
ldscripts for amd64 and arm, GENERIC kernels gained empty RAMDISK
stub segments for future use by rdconfig(8).

given that tmpfsrd is disabled in GENERIC,  this situation is not
problematic on its own. once it gets enabled, as is our plan to kill
RAMDISK kernels, tmpfsrd will detect and attach to these rounded-up
stub segments, a behaviour which, while harmless, is clearly unintended.

to address this situation, this change does:

- add the missing check for empty PT_BITRIG_TMPFS_RAMDISK segments to
  the bootloader.
- crank the bootloader version number.
- add a failback temporary check to tmpfsrd to check whether the size of
  the segment being attached to is larger than a page, in which case we
  don't attach. this is meant as a interim solution so 3.29 bootloaders
  can boot exactly the same kernels as 3.30, making transition smoother.

ok patrick@ natano@
fix integer type mismatches in tmpfs_snapshot.[ch]

in tmpfs_snapshot.[ch]:

- change the type of the offset variable passed through the stack of
  functions from off_t to uint64_t. this allows for consistency with
  ts_snap_sz, fixing a mismatch in tmpfs_snap_load_vnode().

- if we are going to truncate a value to int in tmpfs_snap_rdwr(),
  better do so explicitly.

- don't rely on external and unknown min(). it's almost always a trap:
  there's simply no such convenience in c without unintended side
  effects.

- add another explicit cast to int32 int TMPFS_TS_TO_TST(). XXX i'm not
  sure if this truncation to int32 (implicit or explicit) is correct.

- make it clear that tmpfs_snap_node_setsize() can only be called once
  per file, and take advantage of this fact to simplify the function a
  little bit, fixing integer type mismatches while at it.

ok natano@
fix integer type mismatches in tmpfs_vnops.c

in tmpfs_vnops.c:

- avoid MIN() and be extra strict with the handling of integer types in
  tmpfs_readlink(): ensure tn_size and uio_resid are within bounds
  before implicitly casting to int when calling uiomove().

- in tmpfs_write(), ensure uio_resid fits in an off_t. add a rather
  superfluous cast and avoid MIN().

- in tmpfs_read(), assert that uio_resid can fit into an off_t, and
  avoid another use of MIN() with integer types of different signedness.

- once likely just an interim solution, VNOVAL became a de-facto
  standard in the kernel to conote the absence of a valid value for at
  least 4 different types: uid_t, gid_t, mode_t and nlink_t. be clear
  about this peculiar nature of VNOVAL in tmpfs_setattr().

ok natano@
fix integer type mismatches in tmpfs_vfsops.c

in tmpfs_vfsops.c:

- explicitly truncate TMPFS_NODE_GEN() in tmpfs_vptofh().
- likewise, cast to unsigned int when assigning tm_nodes_max.

ok natano@