base_image_util: Call board-specific function

Some boards may require special procedures while building the base
image, having an optional function called board_finalize_base_image
makes it possible.

TEST=Build and deploy veyron_minnie-cheets

Change-Id: I1f8419ebe16ebcafa53db49499e605367aaea727
Commit-Ready: Nicolas Boichat <>
Tested-by: Nicolas Boichat <>
Reviewed-by: Mike Frysinger <>
diff --git a/build_library/ b/build_library/
index 3c8b6dd..6c7de6a 100755
--- a/build_library/
+++ b/build_library/
@@ -322,6 +322,11 @@
     create_dev_install_lists "${root_fs_dir}"
+  # Run board-specific build image function, if available.
+  if type board_finalize_base_image &>/dev/null; then
+    board_finalize_base_image
+  fi
   # Restore the extended attributes of necessary files.
   local selinux_config="${BOARD_ROOT}/etc/selinux/config"
   if [[ -e "${selinux_config}" ]]; then