From 4b9fbceaa3f6db76736489d9d00b74a3967112d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
Date: Mon, 23 Mar 2020 17:08:28 +0100
Subject: [PATCH] image_builder: Force mount_dir to be created in $TMPDIR
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Immutable systems, as such Red Hat Core OS and Fedora Core OS, will not
allow mount_dir to be created in a location that's not read-write.
Let's ensure we use $TMPDIR (with /tmp as fallback) as base for mount_dir,
as it's a safe writable choice for any distro supported by kata.
Fixes: #437
Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com>
---
image-builder/image_builder.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/image-builder/image_builder.sh b/image-builder/image_builder.sh
index aa813d5..04c840c 100755
--- a/image-builder/image_builder.sh
+++ b/image-builder/image_builder.sh
@@ -372,7 +372,7 @@ create_rootfs_image() {
fi
info "Mounting root partition"
- readonly mount_dir=$(mktemp -d osbuilder-mount-dir.XXXX)
+ readonly mount_dir=$(mktemp -p ${TMPDIR:-/tmp} -d osbuilder-mount-dir.XXXX)
mount "${device}p1" "${mount_dir}"
OK "root partition mounted"
--
2.26.0.rc2