Allow early initialization for factory test mode.

We want to allow some initialization procedure in startup stage (before
boot-services starts running UI) so we can customize UI default settings and
upstart jobs for factory test mode.

To do that, the is_factory_mode (which reports true for both factory test and
installer mode) must be divided into two new functions: is_factory_test_mode and
is_factory_installer_mode.

The new factory-init.conf job is executed when boot-services starts, and runs
initialization script if it is available.

BUG=chrome-os-partner:30239
TEST=Manual: Built a Link test image, boots in factory and non-factory mode.
     Built a factory installer image and boots correctly.

Change-Id: I153baecb8bc66fa0199e9fb8bcf3c50a543f1c2c
Reviewed-on: https://chromium-review.googlesource.com/206676
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
2 files changed