Blob Blame History Raw
From 98ac62dec97ed2b27b1d6368a8ca7a16a8835525 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
Date: Fri, 17 Jan 2020 11:36:38 +0100
Subject: [PATCH] image_builder: Remove nsdax binary after its usage
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Leaving nsdax behind may create some isses for the distro packages
of kata-osbuilder, as every package would have to take care of purging
the file on each distro.

Knowing that, we better remove the file as part of the script, mainly
because the file is already regenerated everytime in any case.

Fixes: #394

Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com>
---
 image-builder/image_builder.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/image-builder/image_builder.sh b/image-builder/image_builder.sh
index 73f20f8..eaa8367 100755
--- a/image-builder/image_builder.sh
+++ b/image-builder/image_builder.sh
@@ -425,6 +425,7 @@ set_dax_header() {
 	# Issue: https://github.com/kata-containers/osbuilder/issues/240
 	gcc -O2 "${script_dir}/nsdax.gpl.c" -o "${script_dir}/nsdax"
 	"${script_dir}/nsdax" "${header_image}" "${dax_header_bytes}" "${dax_alignment_bytes}"
+	rm -f "${script_dir}/nsdax"
 	sync
 
 	touch "${dax_image}"