Commit 7ea2adb0 authored by Emmanuele Bassi's avatar Emmanuele Bassi

tasks: Do not use tmpdir for the disk build

The default temporary directory could be a tmpfs volume, and it's
usually mounted noexec. There's no guarantee we can actually a task
into it. Instead, use a sub-directory in the work directory.
parent af5ab592
......@@ -119,7 +119,7 @@ const TaskBuildDisks = new Lang.Class({
}
// Not indented to avoid too much code motion
try {
let tmpdir_path = Gio.File.new_for_path(GLib.dir_make_tmp("continuous-XXXXXX"));
let tmpdir_path = this.workdir.get_child('tmp');
let mntdir = tmpdir_path.get_child('mnt-' + squashedName);
GSystem.file_ensure_directory(mntdir, true, cancellable);
let gfmnt = new GuestFish.GuestMount(diskPath, { partitionOpts: LibQA.DEFAULT_GF_PARTITION_OPTS,
......@@ -130,7 +130,7 @@ const TaskBuildDisks = new Lang.Class({
cancellable);
} finally {
gfmnt.umount(cancellable);
GSystem.shutil_rm_rf(tmpdir_path, cancellable);
GSystem.shutil_rm_rf(mntdir, cancellable);
}
// Assume previous disks have successfully installed a bootloader
if (!doCloneDisk) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment