build: Handle custom boot images properly

When a pre-built image should be used, it should be stored in the
target files zip so that it can be used with external signing
processes.

Original-Change-Id: I2661af9ac58af30bb9314b552775046d3abf44e0
Change-Id: I10b3bd0bb33489b8ffb26d16d002f8dd6ff405ad
remove --block from build. Makes it impossible to edit .zip files before or
after flashing...

Change-Id: Icb77ddd42610d60fe1455fafbba107bff064685b
optipng -nc -nb -o7

Change-Id: I8a5ea2f89b7b65ace87dfd13eb95f97aa6f5cf77
forall_vanir: use repo forall environment, rather than sed slapchopping lines of the manifest

Change-Id: Iea71fd133f4fc04cf5a55ff0e9beb4274ad250bf
forall_vanir: prevent  partial matches

Change-Id: Ifb26f8427af7d41b65b751a56a2d105609d7d0c9
forall_vanir: one-liner-fy

Change-Id: I5357fb831b1c2b8d7f9be7fde10d439bd0e9382c
Merge "remove --block from build. Makes it impossible to edit .zip files before or after flashing..." into L5
build: Use project pathmap for recovery

Change-Id: I6339ac77b899a43db21261d587252b65cb58ad79
Merge branch 'cm' into HEAD
build: clean up otasigcheck

- Only mount and unmount /data if it was originally unmounted
- Don't use comparison hack, just check the result of the script

Change-Id: I4a22485d315cf91e95ce578907c49f5fa3a03222
ota: Let devices specify their own recovery-from-boot.p installer

Some devices apply transformations to the installed images, making
the sha1 checksums fail (or, worse, generating invalid images). If
"/system/etc/recovery-transform.sh" exists, run that instead, passing
the expected sizes and checksums as arguments in the form of

recovery-transform.sh <recovery_size> <recovery_sha1> <boot_size> <boot_sha1>

A direct emulation of the standard patcher could look like this, transformations
should be added as needed.

----------------
RECSIZE=$1
RECSHA1=$2
BOOTSIZE=$3
BOOTSHA1=$4

dd if=/dev/block/platform/msm_sdcc.1/by-name/recovery of=$C/recovery.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=$C/boot.img

if ! applypatch -c EMMC:$C/recovery.img:$RECSIZE:$RECSHA1; then
  log -t recovery "Installing new recovery image"
  applypatch -b /system/etc/recovery-resource.dat EMMC:$C/boot.img:$BOOTSIZE:$BOOTSHA1 EMMC:$C/recovery.img $RECSHA1 $RECSIZE $BOOTSHA1:/system/recovery-from-boot.p || exit 1
else
  log -t recovery "Recovery image already installed"
fi
----------------

Conflicts:
	tools/releasetools/ota_from_target_files

Change-Id: Ie601841ca1cdad6b8f3b16e593d2718a92e8ca09
Revert "Earlysquisher: optipng before blockimgdiff"

This reverts commit e26afe1d7c6588ddd6a5e1e8783f133af318f75a.

Change-Id: I6c624f6718cfe978fe4f16b2fe3cb1769de1700b
Merge "Revert "Earlysquisher: optipng before blockimgdiff"" into L5
Merge remote-tracking branch 'cm/cm-12.0' into HEAD
Merge remote-tracking branch 'upstream/L5' into L5