From 9665563145172cecb854c079a2149d991f94a7af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 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 --- 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 e18822d84..ceb303e06 100755 --- a/image-builder/image_builder.sh +++ b/image-builder/image_builder.sh @@ -374,7 +374,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"