From nobody Fri Nov 22 19:24:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 171586801094356.1123757673181; Thu, 16 May 2024 07:00:10 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.723367.1128236 (Exim 4.92) (envelope-from ) id 1s7beE-0000Vh-FP; Thu, 16 May 2024 13:59:54 +0000 Received: by outflank-mailman (output) from mailman id 723367.1128236; Thu, 16 May 2024 13:59:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s7beE-0000V0-5n; Thu, 16 May 2024 13:59:54 +0000 Received: by outflank-mailman (input) for mailman id 723367; Thu, 16 May 2024 13:59:52 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s7beC-0006bS-N1 for xen-devel@lists.xenproject.org; Thu, 16 May 2024 13:59:52 +0000 Received: from fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9094c71b-138c-11ef-909d-e314d9c70b13; Thu, 16 May 2024 15:59:52 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 3D62D11400E9; Thu, 16 May 2024 09:59:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 16 May 2024 09:59:51 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 May 2024 09:59:49 -0400 (EDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9094c71b-138c-11ef-909d-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1715867991; x=1715954391; bh=+fHnK5t5dh ObVIi07JV7R8fbSKdAnIHiqOJTfPBBf/o=; b=xih3xk6iUC4oRz+Ikirrjztdz7 N8eXJSIh5k+/jg3O3zYpAjbiXc4CR3EmmJ/FQuioLz1+GjxfeqNYcrln3Vmpom5g /4mLHwvyxuYch0IWuoyxCgiVYbM+WDWESzDY7BSiwXFl2kYqhFoBKZTgGeW7l0Xf nNWyKa5JrLhdfLPSISdXT1znSyUr+On/KKrAsP62LMs0oK6ypwNDvfoJq/HDBdXV OMIwmv45bQxyLHxpdyu/ehyK236xsKZF7pTa8khMPwf1Az/zzvNeYnGI+YN0yHph rIls2xqlOPL3Otr+4/ygltYHCVTSBAGjDXwLK6Ofp+l4DRiaokBMLAsUB8Og== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1715867991; x= 1715954391; bh=+fHnK5t5dhObVIi07JV7R8fbSKdAnIHiqOJTfPBBf/o=; b=g dqtQML5KABpcZ5M6iT+EzKk5qgZeGkMKV5d5rNvX/p6owhz6F3w7v1GPqQW9ysRt xqSz3Fc1VpPKkHixdv8HUOScrBxrr2SVH+D3CgYwHvTC1uSTr5PJ1AYmgO2IGA57 8gc0ov1U96rnmvpKYFflCTHJaERDlTMEgjAuy2exNGX5qS/f5SCwGKsvrer8UtVv JdKT/oj/AFXZh8/ded4Od83+i8RePrHSoP9TyJ2re9VYxA/hoZIeDwr+fppMRp/7 z/YdnsibCMp1thSKVQWBFA3CWcMPr7XgYBvYE4iYNsI1Lc8Ngj6zqEfMesC1BAmX 0sBR1oQQPXpYBi3YQ4KYQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehuddgieelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghr vghkucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesih hnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefg ueduhefgvdefheehudejheefudevueeghfekhfehleegveduteeuiedugffgffenucevlh hushhtvghrufhiiigvpeefnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgv khesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm X-ME-Proxy: Feedback-ID: i1568416f:Fastmail From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Doug Goldstein , Stefano Stabellini Subject: [PATCH 11/12] automation: stubdom test with boot from CDROM Date: Thu, 16 May 2024 15:58:32 +0200 Message-ID: <4c08412876def58402f639b5cef2b9c7d5fffa96.1715867907.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1715868012281100010 Based on the initial stubdomain test add booting from CDOM. It's significantly different in terms of emulated devices (contrary to PV disk, the cdrom is backed by qemu), so test that path too. Schedule it on the AMD runner, as it has less tests right now. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- automation/build/alpine/3.19-arm64v8.dockerfile | 1 +- automation/gitlab-ci/build.yaml | 2 +- automation/gitlab-ci/test.yaml | 8 ++- automation/scripts/qubes-x86-64.sh | 58 +++++++++++----- automation/tests-artifacts/alpine/3.19.dockerfile | 3 +- 5 files changed, 56 insertions(+), 16 deletions(-) diff --git a/automation/build/alpine/3.19-arm64v8.dockerfile b/automation/b= uild/alpine/3.19-arm64v8.dockerfile index 12810f87ecc6..03a3f28ff686 100644 --- a/automation/build/alpine/3.19-arm64v8.dockerfile +++ b/automation/build/alpine/3.19-arm64v8.dockerfile @@ -49,3 +49,4 @@ RUN apk --no-cache add \ fakeroot \ sfdisk \ e2fsprogs \ + xorriso \ diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.y= aml index 134a01d03efa..f1e6a6144c90 100644 --- a/automation/gitlab-ci/build.yaml +++ b/automation/gitlab-ci/build.yaml @@ -324,10 +324,12 @@ alpine-3.19-rootfs-export: script: - mkdir binaries && cp /initrd.tar.gz binaries/initrd.tar.gz - cp /grub-core.img binaries/grub-core.img + - cp /grub-core-eltorito.img binaries/grub-core-eltorito.img artifacts: paths: - binaries/initrd.tar.gz - binaries/grub-core.img + - binaries/grub-core-eltorito.img tags: - x86_64 =20 diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index 76cc430ae00f..4e4dca91c26e 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -239,6 +239,14 @@ zen3p-pci-stubdom-x86-64-gcc-debug: - *x86-64-test-needs - alpine-3.19-gcc-debug =20 +zen3p-stubdom-hvm-cdboot-x86-64-gcc-debug: + extends: .zen3p-x86-64 + script: + - ./automation/scripts/qubes-x86-64.sh stubdom-hvm-cdboot 2>&1 | tee $= {LOGFILE} + needs: + - *x86-64-test-needs + - alpine-3.19-gcc-debug + qemu-smoke-dom0-arm64-gcc: extends: .qemu-arm64 script: diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-= x86-64.sh index 816c16fbab3e..b4f5c846ffe3 100755 --- a/automation/scripts/qubes-x86-64.sh +++ b/automation/scripts/qubes-x86-64.sh @@ -19,6 +19,7 @@ vif =3D [ "bridge=3Dxenbr0", ] disk =3D [ ] ' domU_disk_path=3D +domU_disk_type=3Ddisk =20 ### helper functions =20 @@ -27,27 +28,47 @@ build_domU_disk() { local initrd=3D"$2" local rootfs=3D"$3" local output=3D"$4" + local img_type=3D"$5" local grubcfg=3D"$rootfs/boot/grub2/grub.cfg" - local kernel_cmdline=3D"root=3D/dev/xvda1 console=3Dhvc0 earlyprintk= =3Dxen" + local kernel_cmdline =20 mkdir -p "$rootfs/boot/grub2" cp "$kernel" "$rootfs/boot/vmlinuz" + if [ "$img_type" =3D "disk" ]; then + kernel_cmdline=3D"root=3D/dev/xvda1 console=3Dhvc0 earlyprintk=3Dx= en" + elif [ "$img_type" =3D "cdrom" ]; then + kernel_cmdline=3D"root=3D/dev/sr0 console=3Dhvc0 earlyprintk=3Dxen" + fi echo "linux /boot/vmlinuz $kernel_cmdline" >> "$grubcfg" if [ -n "$initrd" ]; then cp "$initrd" "$rootfs/boot/initrd.img" echo "initrd /boot/initrd.img" >> "$grubcfg" fi echo "boot" >> "$grubcfg" - size=3D$(du -sm "$rootfs") - size=3D${size%% *} - # add 5M margin - size=3D$(( size + 5 )) - mke2fs -d "$rootfs" "$output.part1" ${size}m - cat "$rootfs/usr/lib/grub/i386-pc/boot_hybrid.img" binaries/grub-core.= img > "$output" - # align for the partition 1 start (2048 sectors) - truncate -s $((2048 * 512)) "$output" - cat "$output.part1" >> "$output" - echo ",,linux,*" | sfdisk "$output" + if [ "$img_type" =3D "disk" ]; then + size=3D$(du -sm "$rootfs") + size=3D${size%% *} + # add 5M margin + size=3D$(( size + 5 )) + mke2fs -d "$rootfs" "$output.part1" ${size}m + cat "$rootfs/usr/lib/grub/i386-pc/boot_hybrid.img" binaries/grub-c= ore.img > "$output" + # align for the partition 1 start (2048 sectors) + truncate -s $((2048 * 512)) "$output" + cat "$output.part1" >> "$output" + echo ",,linux,*" | sfdisk "$output" + elif [ "$img_type" =3D "cdrom" ]; then + cp binaries/grub-core-eltorito.img "$rootfs/boot/" + xorriso -as mkisofs \ + -o "$output" \ + -b boot/grub-core-eltorito.img \ + -no-emul-boot \ + -boot-load-size 4 \ + -boot-info-table \ + "$rootfs" + else + echo "Invalid img_type: $img_type" >&2 + return 1 + fi } =20 ### test: smoke test & smoke test PVH @@ -168,16 +189,22 @@ until grep -q \"^domU Welcome to Alpine Linux\" /var/= log/xen/console/guest-domU. done " =20 -### test: stubdom-hvm -elif [ "${test_variant}" =3D "stubdom-hvm" ]; then +### test: stubdom-hvm, stubdom-hvm-cdboot +elif [ "${test_variant}" =3D "stubdom-hvm" ] || [ "${test_variant}" =3D "s= tubdom-hvm-cdboot" ] ; then passed=3D"ping test passed" =20 + disk_opts=3D + if [ "${test_variant}" =3D "stubdom-hvm-cdboot" ]; then + disk_opts=3D",devtype=3Dcdrom" + domU_disk_type=3D"cdrom" + fi + domU_config=3D' type =3D "hvm" name =3D "domU" memory =3D 512 vif =3D [ "bridge=3Dxenbr0", ] -disk =3D [ "/srv/disk.img,format=3Draw,vdev=3Dxvda" ] +disk =3D [ "/srv/disk.img,format=3Draw,vdev=3Dxvda'"$disk_opts"'" ] device_model_version =3D "qemu-xen" device_model_stubdomain_override =3D 1 on_reboot =3D "destroy" @@ -229,7 +256,8 @@ if [ -n "$domU_disk_path" ]; then "binaries/bzImage" \ "" \ "rootfs" \ - "binaries/disk.img" + "binaries/disk.img" \ + "$domU_disk_type" else (cd rootfs; find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gz= ip > ../binaries/domU-rootfs.cpio.gz) fi diff --git a/automation/tests-artifacts/alpine/3.19.dockerfile b/automation= /tests-artifacts/alpine/3.19.dockerfile index cfb2cb30fb30..7632b694c3da 100644 --- a/automation/tests-artifacts/alpine/3.19.dockerfile +++ b/automation/tests-artifacts/alpine/3.19.dockerfile @@ -68,4 +68,5 @@ RUN \ cd / && \ tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr = var && \ # Prepare boot sector for HVM disk - grub-mkimage -o /grub-core.img -O i386-pc -p '(hd0,msdos1)/boot/grub2' b= oot part_msdos ext2 linux biosdisk configfile normal + grub-mkimage -o /grub-core.img -O i386-pc -p '(hd0,msdos1)/boot/grub2' b= oot part_msdos ext2 linux biosdisk configfile normal && \ + grub-mkimage -o /grub-core-eltorito.img -O i386-pc-eltorito -p '(cd)/boo= t/grub2' boot part_msdos ext2 linux biosdisk configfile normal iso9660 --=20 git-series 0.9.1