update_program_fw: Add --bug and attribution

Add --bug and autogenerate attribution to commit message.
BUG=none
TEST=regenerate puff f/w configs.

Change-Id: I85bb190cecd0e5b5f893ad4064dd50cfa2e7eaf7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2265706
Tested-by: Andrew McRae <amcrae@chromium.org>
Auto-Submit: Andrew McRae <amcrae@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
diff --git a/contrib/update_program_fw b/contrib/update_program_fw
index 112c8a3..465603a 100755
--- a/contrib/update_program_fw
+++ b/contrib/update_program_fw
@@ -37,6 +37,7 @@
 DEFINE_string board "${DEFAULT_BOARD}" "Which board (program) the firmware is for" b
 DEFINE_integer release 0  "The firmware release to update to" r
 DEFINE_string project "${DEFAULT_PROJECT}" "Which projects this release is for (defaults to all)" p
+DEFINE_string bug "none" "The bug to reference in the CL e.g b:12345"
 DEFINE_string skip "${DEFAULT_SKIP}" "Skip these projects" s
 DEFINE_string reviewer "${DEFAULT_REVIEWER}" "The reviewer to send the CLs to (optional)"
 
@@ -55,6 +56,8 @@
 BRANCH=""
 PROGRAM_CL=""
 PROGRAM="program.star"
+BASENAME=$(basename "$0")
+COMMAND="${BASENAME} $@"
 #
 # Common functions
 #
@@ -230,7 +233,9 @@
   git commit -q -F - <<EOF
 ${FLAGS_board}: Update firmware to ${FLAGS_release}
 
-BUG=none
+Autogenerated by: ${COMMAND}
+
+BUG=${FLAGS_bug}
 TEST=FAFT tests on ${FLAGS_board}
 EOF
   if ! repo upload -y "--ht=${BRANCH}" --cbr . > "${TEMPDIR}/upload.output" 2>&1 ;then
@@ -262,7 +267,9 @@
     git commit -q -F - <<EOF
 ${PROJ}: Update firmware to ${FLAGS_release}
 
-BUG=none
+Autogenerated by: ${COMMAND}
+
+BUG=${FLAGS_bug}
 TEST=FAFT tests on ${FLAGS_board}
 EOF
     if ! repo upload -y "--ht=${BRANCH}" --cbr . > "${TEMPDIR}/upload.${PROJ}.output" 2>&1 ;then
@@ -339,7 +346,9 @@
   git commit -q -F - <<EOF
 ${FLAGS_board}: Update firmware to ${FLAGS_release}
 
-BUG=none
+Autogenerated by: ${COMMAND}
+
+BUG=${FLAGS_bug}
 TEST=FAFT tests on ${FLAGS_board}
 
 ${PROG_CQD}