$CI_BUILDS_DIR is not correct since gitlab runner 13.12 on kubernetes
since gitlab 13.12 (I think), I am seeing on my kubernetes runners:
$ BUILD_DIR=$PWD
$ /app/vmctl start-kernel $BUILD_DIR/build/arch/x86/boot/bzImage -usb -device usb-host,vendorid=0x10c4,productid=0xea90
+ KERNEL=/builds/tmMj-gV1/2/bentiss/linux/build/arch/x86/boot/bzImage
+ shift
+ set -e
+ [[ x/builds/tmMj-gV1/2/bentiss/linux/build/arch/x86/boot/bzImage == x ]]
++ ls /app/initramfs-5.10.7-200.fc33.x86_64.img
++ sort
++ tail -1
+ INITRD=/app/initramfs-5.10.7-200.fc33.x86_64.img
+ do_start -kernel /builds/tmMj-gV1/2/bentiss/linux/build/arch/x86/boot/bzImage -initrd /app/initramfs-5.10.7-200.fc33.x86_64.img -append 'root=/dev/sda2 selinux=0 audit=0 rw console=tty0 console=ttyS0' -usb -device usb-host,vendorid=0x10c4,productid=0xea90
+ set -ex
+ [[ ! -e /app/image.raw ]]
+ xz -d -T0 /app/image.raw.xz
+ set +e
+ qemu-system-x86_64 -machine accel=kvm -smp 2 -m 1024 -drive format=raw,file=/app/image.raw -device virtio-net-pci,netdev=net0 -netdev user,id=net0,hostfwd=tcp::5555-:22 -display none -daemonize -kernel /builds/tmMj-gV1/2/bentiss/linux/build/arch/x86/boot/bzImage -initrd /app/initramfs-5.10.7-200.fc33.x86_64.img -append 'root=/dev/sda2 selinux=0 audit=0 rw console=tty0 console=ttyS0' -usb -device usb-host,vendorid=0x10c4,productid=0xea90 -serial file:/builds/bentiss/linux/console.out
qemu-system-x86_64: -serial file:/builds/bentiss/linux/console.out: Could not open '/builds/bentiss/linux/console.out': No such file or directory
qemu-system-x86_64: -serial file:/builds/bentiss/linux/console.out: could not connect serial device to character backend 'file:/builds/bentiss/linux/console.out'
As you can see, the PWD
is /builds/tmMj-gV1/2/bentiss/linux
when vmctl
starts qemu with -serial file:/builds/bentiss/linux/console.out
.
We extract the console.out
path with -serial file:$CI_BUILDS_DIR/$CI_PROJECT_PATH/console.out
, so it's likely a gitlab bug, but can we get a workaround for it?
Edited by Benjamin Tissoires