(factory-1020B) crosutils: fix factory install shim when booting with legacy EFI firmware

Cherry-Picked From: http://gerrit.chromium.org/gerrit/10013

Verified boot is not supported yet for USB+EFI boot, which is the case
of factory install shim.  We need to select normal boot in legacy boot
loaders when building factory install shim.

BUG=chrome-os-partner:6358
TEST=build_image --factory_install

Change-Id: I5ea797dc9f7a59b8a84a7728410064a5168030d5
Reviewed-on: http://gerrit.chromium.org/gerrit/10288
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Jay Kim <yongjaek@chromium.org>
diff --git a/build_library/base_image_util.sh b/build_library/base_image_util.sh
index 9e054d8..deacbff 100755
--- a/build_library/base_image_util.sh
+++ b/build_library/base_image_util.sh
@@ -202,8 +202,12 @@
   # use those templates to update the legacy boot partition (12/ESP)
   # on update.
   # (This script does not populate vmlinuz.A and .B needed by syslinux.)
+  # Factory install shims may be booted from USB by legacy EFI BIOS, which does
+  # not support verified boot yet (see create_legacy_bootloader_templates.sh)
+  # so rootfs verification is disabled if we are building with --factory_install
   local enable_rootfs_verification=
-  if [[ ${FLAGS_enable_rootfs_verification} -eq ${FLAGS_TRUE} ]]; then
+  if [[ ${FLAGS_enable_rootfs_verification} -eq ${FLAGS_TRUE} ]] &&
+     [[ ${FLAGS_factory_install} -eq ${FLAGS_FALSE} ]] ; then
     enable_rootfs_verification="--enable_rootfs_verification"
   fi