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

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

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
Tested-by: Hung-Te Lin <>
Reviewed-by: Gaurav Shah <>
Commit-Queue: Hung-Te Lin <>
2 files changed