I run Yocto builds in gitlab CI, and sometimes I get this kind of error:
touch: setting times of '/builds/linux-bsp/distro/yocto/build/tmp-glibc/work/pcm62-oe-linux/pil-rootfs/1.0-r0/rootfs/usr/share/common-licenses/deif-kernel-module-lpddr4-6.5.2-rt8-00061-ga5ee5b82d6e5/GPL-2.0-only': Operation not permitted
touch: setting times of '/builds/linux-bsp/distro/yocto/build/tmp-glibc/work/pcm62-oe-linux/pil-rootfs/1.0-r0/rootfs/usr/share/common-licenses/generic_NCSA': Operation not permitted
WARNING: /builds/linux-bsp/distro/yocto/build/tmp-glibc/work/pcm62-oe-linux/pil-rootfs/1.0-r0/temp/run.reproducible_final_image_task.247046:155 exit 123 from 'xargs -0 touch -h --date=@$REPRODUCIBLE_TIMESTAMP_ROOTFS'
Whenever it happens I just need to do a rerun of the job.
Note that the error is: "Operation not permitted" not "permission denied".
This typically means, that it is seccomp which blocks an operation. Not something with file permissions!
However I have totally disabled seccomp in the runner!
security_opt = ["seccomp:unconfined"]
Why do I get this error, what causes this kind of error?
For the Yocto audience, there is two things which always is involved when I see this error:
- It is doing this operation: touch -h --date=@$REPRODUCIBLE_TIMESTAMP_ROOTFS'
- And it is always on a licence file!
I'm using Ubuntu 22.04.3 with a 5.15 kernel on the runner.