Add utility to set up device symlinks based on the boot device

We'd eventually like to be able to install an identical software build
for encore to either eMMC or external SD card and be able to boot it
without any modifications.  In order to do that, we'll need to be able
to find the system and userdata partitions at runtime by taking into
account the install location.

Early userspace has no way of discovering the boot location on its own,
so we modify the bootloader to pass this information on the kernel
command line.  fsfinder (this utility) will then parse the command line
to find the boot location and set up device symlinks appropriately.

To be of any use, fsfinder has to run before /system is available, so
to avoid the need to ship a statically linked shell or other interpreter
in early userspace, the implementation is in C and compiles to a
statically linked binary.
Make the early boot process boot-location-agnostic

Instead of using fixed block device names for /system and /data, let
fsfinder set up links for us based on the boot location.  This allows us
to run unmodified from both eMMC and external SD card.
Make the recovery boot-location-agnostic

Instead of using fixed block device names for /system and /data, let
fsfinder set up links for us based on the boot location.  This allows us
to run unmodified from both eMMC and external SD card and to do the
right thing in both cases.
Add script to configure vold based on boot location

On SD card installs, the first partition of the SD card is the FAT
filesystem used as the boot partition.  This leads vold, which searches
the SD card for the first recognized partition when given a partition
number of "auto", to identify /boot as the /sdcard partition.

Fix this by running a script which detects SD card installs and modifies
/fstab.encore to instruct vold to use the last partition on the SD card
in that case.
Configure vold based on boot location in recovery too

To ensure that configure_vold.sh runs before vold starts, we need to use
an init.rc file (postrecoveryboot.sh is run when recovery starts, after
all the various services are started).

We also need to edit the configure_vold.sh script to change the
interpreter location for the recovery (/sbin/sh as opposed to
/system/bin/sh), so we need some build system hackery as well.
Recovery: move fsfinder startup into init.rc

While it doesn't seem to be strictly necessary for fsfinder to be
complete before the recovery starts, it shouldn't hurt either, and it
may prevent some potential problems in cases where recovery has been
instructed to do something when it starts (flash an OTA package, for
example).
configure_vold.sh: clean up identifying last partition on SD card
Recovery: display whether operating on eMMC or SD on startup

Particularly with the new location-agnostic recoveries, it's possible to
get confused as to whether backups/restores, wipes, and (eventually) OTA
flashes will affect the eMMC or SD card.  Detect whether the recovery is
operating on eMMC or SD on startup and display this to the user to try
to avoid mixups.
Merge branch 'cm-11.0' of https://github.com/CyanogenMod/android_device_bn_encore into cd-4.4
recovery: block writes to eMMC partitions when managing SD install

Legacy OTA ROM updates attempt to format and/or mount the eMMC system
and boot partitions directly, instead of using the new
install-location-agnostic symlinks.  Users attempting to flash one of
these old OTAs using a recovery installed to SD card would therefore end
up modifying their eMMC, a potentially disastrous result.

Prevent this from happening by bind mounting /dev/null over the eMMC
system, boot, and userdata partition devices when recovery is managing
an SD card install.  This doesn't cause the OTA update to fail (it'll
dump all of its files to the rootfs, potentially causing an
out-of-memory situation), but it does prevent unexpected modification of
the eMMC.

If you actually need to work with the eMMC partitions from a SD card
recovery, run "/sbin/recovery_emmc_protect.sh stop" to disable this
protection.

Change-Id: Ie1d01ef869a217dbb2d0a9f0eefc4d06f97f15fd
recovery: fix reboot-to-recovery from within recovery

Fix two problems preventing reboot-to-recovery from working in recovery:

* /rom wasn't necessarily mounted before trying to write to /rom/bcb
* /system/bin was empty, so the commands in the shell script fragment
  weren't found

Change-Id: If30a87caa62190804e78ca76370856d427e0ea5a
Merge branch 'cm-11.0' of https://github.com/CyanogenMod/android_device_bn_encore into cd-4.4