update_kernel.sh: Do not copy firmwares to DUT, by default.

By default, running, in ~/trunk/src/scripts:
./update_kernel.sh DUT_IP

will upload to the DUT:
 1. kernel
 2. modules (/lib/modules/vX.Y.Z)
 3. firmware (/lib/firmware)

1+2 are necessary to get the kernel booting, but uploading firmwares
can lead to unintended breakage, as the firmwares are usually built
using other ebuilds (e.g graphics drivers, linux-firmware, etc),
leading to all sort of possible mismatches (outdated developer build
environment, accidental updating to too-recent firmware on old kernel).

BUG=chromium:689448
TEST=./update_kernel.sh DUT_IP does not upload firmware
TEST=./update_kernel.sh --firmware DUT_IP does upload firmware

Change-Id: Iff7ad52f9da0bf04375d9e2d9cbee0b4c03415d7
Reviewed-on: https://chromium-review.googlesource.com/439046
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
diff --git a/update_kernel.sh b/update_kernel.sh
index dd46baa..95d5087 100755
--- a/update_kernel.sh
+++ b/update_kernel.sh
@@ -24,6 +24,7 @@
 DEFINE_boolean syslinux $FLAGS_TRUE "Update the syslinux kernel"
 DEFINE_boolean bootonce $FLAGS_FALSE "Mark kernel partition as boot once"
 DEFINE_boolean remote_bootargs $FLAGS_FALSE "Use bootargs from running kernel on target"
+DEFINE_boolean firmware $FLAGS_FALSE "Also update firmwares (/lib/firmware)"
 
 ORIG_ARGS=("$@")
 
@@ -271,8 +272,12 @@
 
     copy_kernelmodules
 
-    echo "copying firmware"
-    remote_send_to /build/"${FLAGS_board}"/lib/firmware/ /lib/firmware/
+    if [[ ${FLAGS_firmware} -eq ${FLAGS_TRUE} ]]; then
+      echo "copying firmware"
+      remote_send_to /build/"${FLAGS_board}"/lib/firmware/ /lib/firmware/
+    else
+      info "Skipping update of firmware (per request)."
+    fi
   fi
 
   if [ ${FLAGS_vboot} -eq ${FLAGS_TRUE} ]; then