mod_image_for_recovery.sh: preserve whitelisted files on stateful.

We want the recovery image to contain CRX files that will be used to preload
the CRX cache on the stateful partition. This change adds a whitelist
of files on the stateful partition to preserve when creating a recovery
image with --minimize_image (the normal case).

To do this, we have to increase the size of the recovery image's stateful
partition. This CL dynamically discovers the approximate smallest size that
will hold the files to preserve.

We will operate correctly if these CRX files are not on the recovery image,
but more bandwidth is used at first boot/first login. We chose to make
the recovery image larger because:

1) Testers use recovery to setup machines for testing. It will be much better
if they test images as close to customer experience as possible.

2) You are going to pay the bandwidth during recovery one way or
another (getting the image, or after boot). If you recover more than
one machine, then the total bandwidth usage is reduced. This might be
of particular importance to an institution that processes many
machines at once.

3) Recovery is sometimes used in the factory process. In particular,
it's sometimes run end of the factory process if there was something
odd with the machine in question. We want these files to always be
there when leaving factory.

BUG=chromium:288255
TEST=Built images, and inspected stateful.

Change-Id: I39090377ea4b1f68bcc16a127a88a79228680535
Reviewed-on: https://chromium-review.googlesource.com/169061
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
1 file changed