Browse Source

image: Protect shared deploy directory usage

Image deployment directory is shared between the targets with the same
machine name, but there was no any protection when copy bootables with
the same file names. So building multiconfig qemuamd64 targets can fail
with:

ERROR: mc:qemuamd64-buster-tgz:isar-image-base-1.0-r0 do_copy_boot_files:
Execution of 'tmp/work/debian-buster-amd64/isar-image-base-qemuamd64-targz-img/1.0-r0/temp/run.do_copy_boot_files.31554' failed with exit code 1:
cp: cannot create regular file 'tmp/deploy/images/qemuamd64/isar-image-base-debian-buster-qemuamd64-initrd.img': File exists

This is caused by initrd file creation by the multiple
do_copy_boot_files instances.
To fix the issue additional lock introduced.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
Anton Mikanovich 3 years ago
parent
commit
d158150853
1 changed files with 1 additions and 0 deletions
  1. 1 0
      meta/classes/image.bbclass

+ 1 - 0
meta/classes/image.bbclass

@@ -139,6 +139,7 @@ EOF
 }
 
 do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}"
+do_copy_boot_files[lockfiles] += "${DEPLOY_DIR_IMAGE}/isar.lock"
 do_copy_boot_files() {
     kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz])"
     if [ ! -f "$kernel" ]; then