Fix handling of shell special characters in beaglebone/deploy.

If the commit log message at HEAD included certain shell special
characters like " or $, the beaglebone/deploy script would create
an /etc/default/servod file that would blow up when starting servod.

This change fixes the deploy script to properly quote special
characters in the commit message.

BUG=chromium:236532
TEST=deploy a commit with this change and special characters in the commit message

Change-Id: I5cb58f12c76afec7a56745d6e97fbb13a2b89662
Reviewed-on: https://gerrit.chromium.org/gerrit/57183
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
diff --git a/beaglebone/deploy b/beaglebone/deploy
index 93ab3c8..8832fc1 100755
--- a/beaglebone/deploy
+++ b/beaglebone/deploy
@@ -42,9 +42,12 @@
   BOARD="$1"
 fi
 CONFIG_TMP=$(mktemp /tmp/hdctools.XXXXXX)
+# The string in REVISION will be interpreted by the shell, so we need
+# quote special characters.  Quote the string with single-quotes to
+# simplify things.
 cat <<END >$CONFIG_TMP
 BOARD="$BOARD"
-REVISION="$(git log -1 --oneline)"
+REVISION=$(printf %q "$(git log -1 --oneline)")
 END
 sudo mv $CONFIG_TMP $CONFIG_FILE