From 075a6c6d1b58d6fd81a3c65df61569ec10a59684 Mon Sep 17 00:00:00 2001 From: amin m Date: Fri, 6 Sep 2019 17:48:45 +0530 Subject: [PATCH] Replace hanging virt-copy-out commands Most often virt-copy-out just hangs on the LinuxFoundation Jenkins build slaves until timeout exceeds and Jenkins interrupts the build. Nested virtualization required by virt-copy-out (via qemu-kvm) seems not stable. This is purely a workaround for LF Jenkins. Example trace of the issue with virt-copy-out: /usr/libexec/qemu-kvm \ -global virtio-blk-pci.scsi=off \ -nodefconfig \ -enable-fips \ [...some output omitted...] KVM: entry failed, hardware error 0x0 EAX=00000000 EBX=00000000 ECX=00000000 EDX=000306a9 ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000 EIP=0000fff0 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0 ES =0000 00000000 0000ffff 00009300 CS =f000 ffff0000 0000ffff 00009b00 SS =0000 00000000 0000ffff 00009300 DS =0000 00000000 0000ffff 00009300 FS =0000 00000000 0000ffff 00009300 GS =0000 00000000 0000ffff 00009300 LDT=0000 00000000 0000ffff 00008200 TR =0000 00000000 0000ffff 00008b00 GDT= 00000000 0000ffff IDT= 00000000 0000ffff CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000 DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 DR6=00000000ffff0ff0 DR7=0000000000000400 EFER=0000000000000000 Code=00 66 89 d8 66 e8 14 a4 ff ff 66 83 c4 0c 66 5b 66 5e 66 c3 5b e0 00 f0 30 36 2f 32 33 2f 39 39 00 fc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Build timed out (after 120 minutes). Marking the build as failed. Change-Id: I0346abc3f28f0bf2687d0c2538c50dfd71e1d32c Signed-off-by: Tamas Lendvay --- build_step_create_install_cd.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build_step_create_install_cd.sh b/build_step_create_install_cd.sh index ee3fee6..78bafd3 100755 --- a/build_step_create_install_cd.sh +++ b/build_step_create_install_cd.sh @@ -79,8 +79,16 @@ popd pushd $tmp # Copy latest kernel and initrd-provisioning from boot dir -export LIBGUESTFS_BACKEND=direct -virt-copy-out -a $input_image /boot/ ./ +qemu-img convert $input_image guest-image.raw +myloop=$(sudo losetup -fP --show guest-image.raw) +mkdir mnt +sudo mount -o loop ${myloop}p1 mnt/ +sudo rsync -avA mnt/boot . +sudo chown -R $(id -u):$(id -g) boot +sudo umount mnt +sudo losetup -d ${myloop} +rm -f guest-image.raw + chmod u+w boot/ rm -f $iso_build_dir/isolinux/vmlinuz $iso_build_dir/isolinux/initrd.img KVER=`ls -lrt boot/vmlinuz-* |grep -v rescue |tail -n1 |awk -F 'boot/vmlinuz-' '{print $2}'` -- 2.16.6