From 2139deee56ea9ef96f6b1ce0d4f2a437d3648cc5 Mon Sep 17 00:00:00 2001 From: Zac Mrowicki Date: Mon, 25 Oct 2021 17:58:23 +0000 Subject: [PATCH] Makefile: Add disk image files to TUF repo during `cargo make repo` This change adds the disk image files, if they exist, to the targets that are linked into the TUF repository during the `cargo make repo` target. When the image files are in the repo, we can download them with `tuftool` which can simplify the process of creating AMIs at a different time or from a different machine. --- Makefile.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile.toml b/Makefile.toml index 6489b983d60..6bc3d76e8b5 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -612,6 +612,14 @@ done # modules for a given release. LINK_REPO_TARGETS=("--link-target ${BUILDSYS_KMOD_KIT_PATH}") +# Include the root and data disk images in the repo if they exist +os_disk_img="${BUILDSYS_OUTPUT_DIR}/${BUILDSYS_NAME_FULL}.img.lz4" +data_disk_img="${BUILDSYS_OUTPUT_DIR}/${BUILDSYS_NAME_FULL}-data.img.lz4" +if [ -s "${os_disk_img}" ] && [ -s "${data_disk_img}" ]; then + LINK_REPO_TARGETS+=("--link-target ${os_disk_img}") + LINK_REPO_TARGETS+=("--link-target ${data_disk_img}") +fi + # Ensure we link an OVA if an OVF template exists (in which case we should have # built an OVA) if [ -s "${BUILDSYS_OVF_TEMPLATE}" ]; then