toolbox: Avoid issues with non-regular files

Toolbox uses open() in order to check for existence of a file, instead
of using stat(). This breaks when using non-regular files such as FIFO,
because opening a FIFO for reading blocks until a writer is available.

Change-Id: I008d246d68f7ce56040f4b4c36e5ff4f9c34f4dc
Merge branch 'cm-11.0' of github.com:CyanogenMod/android_system_core into cm-11.0
init: update recovery when enabled in settings

Update the recovery image only if the option is enabled
under Developer options

This reverts commit 231e0a9e6a1da6fa4a188840f68af649669e417f.

Change-Id: I928f7ee8bb3eaf5581bb8225661d253ecca0c4ef
Merge branch 'cm-11.0' of github.com:CyanogenMod/android_system_core into cm-11.0
Change CM recovery install script filename [2/2]

This is part 2/2 to maintain backwards compatibility with CWM's
verify_root_and_recovery() function. CWM checks if install-recovery.sh
exists and has an executable flag set, then offers to disable the script
for the user. CM now controls this with the persist.sys.recovery_update
property which is configurable via settings, so we don't need to
double-check this.

This changes the name of the recovery install script to
install-cm-recovery.sh.

Change-Id: I275dd358b46c626dfcb8fe02c583a308d5a89c56
Merge branch 'cm-11.0' of github.com:CyanogenMod/android_system_core into cm-11.0
Merge branch 'cm-11.0' of https://github.com/temasek/android_system_core into HEAD