Fix build_image --factory_install to work again.

There were two bugs:
 1) The test [ ${ARCH} -eq "arm" ] was wrong because -eq is a
    numeric comparison operator, not legal on strings.
 2) Variable ${ARCH} was used before set.

The code change includes comment changes to clarify the reasons for
the code, and a future-proofing logic change.

Change-Id: I63f502cc33cf8a9a441b4b305fc49ed57d0a55b1

BUG=None
TEST=build_image --factory_install, and boot the resulting image

Review URL: http://codereview.chromium.org/6905119
(cherry picked from commit b290366b6e24ce85fdb6a3b9360cc862036b8d2f)

Change-Id: I06688bbc96dd4d8f2c61bc87f82d2be88b00a84f
Reviewed-on: http://gerrit.chromium.org/gerrit/664
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
1 file changed
tree: 5593e6363bdc2e8675437bec30a29300d56b8402
  1. bin/
  2. bootperf-bin/
  3. lib/
  4. mod_for_factory_scripts/
  5. mod_for_test_scripts/
  6. .gitignore
  7. archive_build.sh
  8. archive_hwqual
  9. bash_completion
  10. build_gpt.sh
  11. build_image
  12. build_kernel_image.sh
  13. call_autoserv.py
  14. check_control_files.sh
  15. check_deps
  16. chromeos_blacklist
  17. clean_loopback_devices
  18. common.sh
  19. create_esp.sh
  20. create_legacy_bootloader_templates.sh
  21. cros_deps_diff
  22. cros_download_latest_image
  23. cros_generate_breakpad_symbols
  24. cros_generate_deps_graphs
  25. cros_show_stacks
  26. dot_helper.py
  27. emit_gpt_scripts.sh
  28. enable_localaccount.sh
  29. enter_chroot.sh
  30. file_copy.py
  31. fixup_image_for_qemu.py
  32. generate_au_zip.py
  33. get_latest_image.sh
  34. get_package_list
  35. image_to_usb.sh
  36. image_to_vm.sh
  37. inherit-review-settings-ok
  38. make_developer_script_runner.sh
  39. make_factory_package.sh
  40. mk_memento_images.sh
  41. mod_image_for_recovery.sh
  42. mod_image_for_test.sh
  43. mount_gpt_image.sh
  44. remote_access.sh
  45. resize_stateful_partition.sh
  46. serve_factory_packages.py
  47. set_shared_user_password.sh
  48. ssh_test.sh
  49. start_devserver
  50. test_image
  51. update_bootloaders.sh
  52. update_kernel.sh
  53. upload_symbols
  54. verify_rootfs_chksum.sh
  55. WATCHLISTS