mod_image_for_recovery: Add --enable_serial parameter for pass-through

This patch adds an --enable_serial parameter to
mod_image_for_recovery.sh that will simply be passed through unchanged
to build_kernel_image.sh. This should never be set for official builds
but it useful to developers who are debugging the recovery initramfs,
since sometimes the recovery UI doesn't even come up and then it's nice
to have a UART to fall back to.

BUG=None
TEST=Called with --enable_serial=ttyS2, confirmed I get UART output on
Kevin.

Change-Id: I52269f76c2b95ffa51e3c63bc23f95bed39041e6
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1705381
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
diff --git a/mod_image_for_recovery.sh b/mod_image_for_recovery.sh
index 3be2271..1e29c44 100755
--- a/mod_image_for_recovery.sh
+++ b/mod_image_for_recovery.sh
@@ -48,6 +48,8 @@
   "log all commands to stdout" v
 DEFINE_boolean decrypt_stateful $FLAGS_FALSE \
   "request a decryption of the stateful partition (implies --nominimize_image)"
+DEFINE_string enable_serial "" \
+  "Enable serial output (same as build_kernel_image.sh). Example: ttyS0"
 
 # Parse command line
 FLAGS "$@" || exit 1
@@ -147,6 +149,7 @@
     --vmlinuz="$vmlinuz" \
     --working_dir="${IMAGE_DIR}" \
     --boot_args="noinitrd panic=60 cros_recovery kern_b_hash=$kern_hash" \
+    --enable_serial="${FLAGS_enable_serial}" \
     --keep_work \
     --keys_dir="${FLAGS_keys_dir}" \
     ${enable_rootfs_verification_flag} \