image: Convert cros_set_lsb_release to python

BUG=brillo:1010
TEST=manual; built image before and after change, compared
     the lsb-release files of each
CQ-DEPEND=CL:272517

Change-Id: I2430fa44f4427793c4555bcf32ac07d5495195e4
Reviewed-on: https://chromium-review.googlesource.com/272547
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Sheng-liang Song <ssl@chromium.org>
Commit-Queue: Steve Fung <stevefung@chromium.org>
Trybot-Ready: Steve Fung <stevefung@chromium.org>
Tested-by: Steve Fung <stevefung@chromium.org>
diff --git a/build_library/base_image_util.sh b/build_library/base_image_util.sh
index ff96696..e5b3f14 100755
--- a/build_library/base_image_util.sh
+++ b/build_library/base_image_util.sh
@@ -155,9 +155,24 @@
   run_ldconfig "${root_fs_dir}"
 
   # Set /etc/lsb-release on the image.
-  "${OVERLAY_CHROMEOS_DIR}/scripts/cros_set_lsb_release" \
-  --root="${root_fs_dir}" \
-  --board="${BOARD}"
+  local official_flag=
+  if [[ "${CHROMEOS_OFFICIAL:-0}" == "1" ]]; then
+    official_flag="--official"
+  fi
+
+  "${GCLIENT_ROOT}/chromite/bin/cros_set_lsb_release" \
+    --sysroot="${root_fs_dir}" \
+    --board="${BOARD}" \
+    --version_string="${CHROMEOS_VERSION_STRING}" \
+    --auserver="${CHROMEOS_VERSION_AUSERVER}" \
+    --devserver="${CHROMEOS_VERSION_DEVSERVER}" \
+    ${official_flag} \
+    --buildbot_build="${BUILDBOT_BUILD:-"N/A"}" \
+    --track="${CHROMEOS_VERSION_TRACK:-"developer-build"}" \
+    --branch_number="${CHROMEOS_BRANCH}" \
+    --build_number="${CHROMEOS_BUILD}" \
+    --chrome_milestone="${CHROME_BRANCH}" \
+    --patch_number="${CHROMEOS_PATCH}"
 
   # Create the boot.desc file which stores the build-time configuration
   # information needed for making the image bootable after creation with