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. .gitignore
  2. WATCHLISTS
  3. archive_build.sh
  4. archive_hwqual
  5. bash_completion
  6. bin/
  7. bootperf-bin/
  8. build_gpt.sh
  9. build_image
  10. build_kernel_image.sh
  11. call_autoserv.py
  12. check_control_files.sh
  13. check_deps
  14. chromeos_blacklist
  15. clean_loopback_devices
  16. common.sh
  17. create_esp.sh
  18. create_legacy_bootloader_templates.sh
  19. cros_deps_diff
  20. cros_download_latest_image
  21. cros_generate_breakpad_symbols
  22. cros_generate_deps_graphs
  23. cros_show_stacks
  24. dot_helper.py
  25. emit_gpt_scripts.sh
  26. enable_localaccount.sh
  27. enter_chroot.sh
  28. file_copy.py
  29. fixup_image_for_qemu.py
  30. generate_au_zip.py
  31. get_latest_image.sh
  32. get_package_list
  33. image_to_usb.sh
  34. image_to_vm.sh
  35. inherit-review-settings-ok
  36. lib/
  37. make_developer_script_runner.sh
  38. make_factory_package.sh
  39. mk_memento_images.sh
  40. mod_for_factory_scripts/
  41. mod_for_test_scripts/
  42. mod_image_for_recovery.sh
  43. mod_image_for_test.sh
  44. mount_gpt_image.sh
  45. remote_access.sh
  46. resize_stateful_partition.sh
  47. serve_factory_packages.py
  48. set_shared_user_password.sh
  49. ssh_test.sh
  50. start_devserver
  51. test_image
  52. update_bootloaders.sh
  53. update_kernel.sh
  54. upload_symbols
  55. verify_rootfs_chksum.sh