scripts: Pass BOARD parameter to build_dlc

To be able to add licensing information to DLCs, the callers of
build_dlc have to provide the BOARD name.

BUG=chromium:911228
TEST=Create OS image before and after the change and verify
about_os_credits.html hasn't changed. Deploy dummy-dlc and verify a new
LICENSE file containning the license info is in
/run/imageloader/dummy-dlc/dummy-package/LICENSE.

Cq-Depend: chromium:2023772, chromium:2023857
Change-Id: I7c170db5bb2753415eecc8a1a380bf59cfbb276a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/2129955
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
Reviewed-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Commit-Queue: Andrew Lassalle <andrewlassalle@chromium.org>
Tested-by: Andrew Lassalle <andrewlassalle@chromium.org>
diff --git a/build_image b/build_image
index 9075304..d8950a3 100755
--- a/build_image
+++ b/build_image
@@ -222,7 +222,8 @@
 move_image "${BUILD_DIR}" "${OUTPUT_DIR}"
 
 # Copy DLC images to the output_root directory.
-build_dlc --sysroot="${BOARD_ROOT}" --install-root-dir="${OUTPUT_DIR}/dlc"
+build_dlc --sysroot="${BOARD_ROOT}" --install-root-dir="${OUTPUT_DIR}/dlc" \
+  --board="${BOARD}"
 
 # Create a named symlink.
 LINK_NAME="${FLAGS_output_root}/${BOARD}/${FLAGS_symlink}"
diff --git a/build_library/base_image_util.sh b/build_library/base_image_util.sh
index d1dcc5e..5f3cd68 100755
--- a/build_library/base_image_util.sh
+++ b/build_library/base_image_util.sh
@@ -482,7 +482,8 @@
   fi
 
   # Generate DLCs and copy their metadata to the rootfs.
-  build_dlc --sysroot="${BOARD_ROOT}" --rootfs="${root_fs_dir}"
+  build_dlc --sysroot="${BOARD_ROOT}" --rootfs="${root_fs_dir}" \
+    --board="${BOARD}"
 
   restore_fs_contexts "${BOARD_ROOT}" "${root_fs_dir}" "${stateful_fs_dir}"
 
diff --git a/build_library/test_image_util.sh b/build_library/test_image_util.sh
index a90768f..38c2c11 100755
--- a/build_library/test_image_util.sh
+++ b/build_library/test_image_util.sh
@@ -46,7 +46,7 @@
   # hold DLC(s) that dlcservice will leverage for testing/provisioning.
   build_dlc --sysroot="${BOARD_ROOT}" \
     --install-root-dir="${root_fs_dir}/var/cache/dlc-images" \
-    --preload --rootfs="${root_fs_dir}"
+    --preload --rootfs="${root_fs_dir}" --board="${BOARD}"
 
   unmount_image
   trap - EXIT