recovery: Fix adb backup

Using http://goo.gl/6AQ3u might fail. The resulting backup
consists of a tarball of the filesystem being backed up,
but it might end up truncated, for reasons yet unknown.

Issuing adb backup data, for instance, causes recovery to
call tar, streaming it's stdout <a> through a socket <b>.
The adb client reads from <b> and copies what it to the
final backup file.

Somehow, sometimes, not all the content generated at <a> is
read at the adb client, which causes a truncated tar file
to result. I'm unsure why this happens: Doesn't <a> get
flushed before <b> is closed? Or is it that <b> is closed
with outstanding data in its buffers, which never make it
to the other side?

Either calling sync() or sleep() seems to remedy the issue,
but I'm not sure if sync() has any effect on sockets or
pipes. I also understand that sleeping for some time is not
the best solution to a race condition.

Therefore, I'm adding calls to sync() and sleep() and
waiting for reviews from someone who knows better how
these calls work.

Patch set 2: Remove sync() call

Change-Id: If4733066fdad809eb73e87c670f37acc4debe82d
Remove (un)mount option for datamedia partitions

When /sdcard is /data/media, it can be formatted but it cannot be
mounted/unmounted independently of /data (aside from creating or
destrying the symlink). This removes /sdcard from the mountable
volumes list, but leaves it as a formattable partition.

Change-Id: If59e4516a12da4589ffb0dbd19702f219260370e
Fix compiler warning: redefinition in extendedcommands.c

ITEM_APPLY_SDCARD is already defined in recovery_ui.h, fortunately
also as 1.

This suggestion comes from Phil3759.

Change-Id: I9ac370ca9640d61b6b96f60954d35f7aa458d75b
move "install zip from sideload" to installation submenu

* Also includes the below commit:

fix installation from internal sdcard

bug introduced in previous commit

Change-Id: If41d409801e9a58df9515ac783bf503f80909d3e

* I've done some minor changes to the original commit,
  which includes but is not limited to moving the
  "install zip from sideload" above "/sdcard/update.zip".

Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
Change-Id: I27a763a0d41085719a6c7d9c3b8a20fbcae4b072

Conflicts:
	extendedcommands.c
	recovery_ui.h
Fix the potential segmentation fault

Extral newline can trigger recovery segmentation fault
Test case:
host$ adb shell 'echo -en "--update_package=ota_update.zip\n--show_text\n\n" > /cache/recovery/command'
host$ adb reboot recovery

Change-Id: If1781c1f5ad94a273f1cb122b67cedd9fb562433
Signed-off-by: Jin Feng <jin88.feng@gmail.com>
recovery: use just the mount point instead of the full path

When resorting to using mount because a block device uses 'auto'
filesystem, we should use the mount point and not the full path.
This fixes an issue with nandroid to external sd on yuga.

Change-Id: Idbff944ea6d5af9112644c2ed46e23ea0a33e5ee
fix stat usage

Change-Id: Iab3290adca1602a23fc407d2b3f50b9aeac60389
Fix usage of stat vs statfs

Change-Id: Id59b79f079c587630f5f6ed0418a45f2b8cd99ff

Conflicts:
	nandroid.c