From patchwork Wed Nov 25 04:27:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 11930369 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 124FAC5519F for ; Wed, 25 Nov 2020 04:28:38 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D72820789 for ; Wed, 25 Nov 2020 04:28:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="QvEmcM+c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D72820789 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.37184.69475 (Exim 4.92) (envelope-from ) id 1khmPu-0001ty-9D; Wed, 25 Nov 2020 04:28:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 37184.69475; Wed, 25 Nov 2020 04:28:30 +0000 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" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khmPu-0001to-66; Wed, 25 Nov 2020 04:28:30 +0000 Received: by outflank-mailman (input) for mailman id 37184; Wed, 25 Nov 2020 04:28:29 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khmPt-0000sM-1D for xen-devel@lists.xenproject.org; Wed, 25 Nov 2020 04:28:29 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2735ef72-28c5-4302-9bb0-19c8cb949484; Wed, 25 Nov 2020 04:27:53 +0000 (UTC) Received: from sstabellini-ThinkPad-T480s.hsd1.ca.comcast.net (c-24-130-65-46.hsd1.ca.comcast.net [24.130.65.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9E25621D7A; Wed, 25 Nov 2020 04:27:52 +0000 (UTC) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khmPt-0000sM-1D for xen-devel@lists.xenproject.org; Wed, 25 Nov 2020 04:28:29 +0000 X-Inumbo-ID: 2735ef72-28c5-4302-9bb0-19c8cb949484 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2735ef72-28c5-4302-9bb0-19c8cb949484; Wed, 25 Nov 2020 04:27:53 +0000 (UTC) Received: from sstabellini-ThinkPad-T480s.hsd1.ca.comcast.net (c-24-130-65-46.hsd1.ca.comcast.net [24.130.65.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9E25621D7A; Wed, 25 Nov 2020 04:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606278472; bh=BsN+MdGSKW1XgXXksWV5TK4XWZsbUTOQRZGpT/TJoLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QvEmcM+cAnFDgFRTLrutIBjyVHt8PnS3FU8WH2usO8zBQ+Zf7Rmd5I8kN7TMma/cr /bWgWrb5p0MZHsOYegmtDqu3zvAVSksQyD9URIMzMummurZfyQbi+kD1N9X1SCQ0gd x0Zdx8UMiFsxo0ELEUVptNiLB15v0DoVLRawjamw= From: Stefano Stabellini To: andrew.cooper3@citrix.com, cardoe@cardoe.com, wl@xen.org Cc: sstabellini@kernel.org, xen-devel@lists.xenproject.org, Stefano Stabellini Subject: [PATCH v3 12/12] automation: add domU creation to dom0 alpine linux test Date: Tue, 24 Nov 2020 20:27:45 -0800 Message-Id: <20201125042745.31986-12-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Add a trivial Busybox based domU. Signed-off-by: Stefano Stabellini --- automation/scripts/qemu-alpine-arm64.sh | 47 ++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/automation/scripts/qemu-alpine-arm64.sh b/automation/scripts/qemu-alpine-arm64.sh index 7d1eb7d1b6..bd8965e6f1 100755 --- a/automation/scripts/qemu-alpine-arm64.sh +++ b/automation/scripts/qemu-alpine-arm64.sh @@ -8,10 +8,36 @@ apt-get -qy install --no-install-recommends qemu-system-aarch64 \ u-boot-tools \ device-tree-compiler \ cpio \ - curl + curl \ + busybox-static -mkdir -p binaries/rootfs -cd binaries/rootfs +# DomU Busybox +cd binaries +mkdir -p initrd +mkdir -p initrd/bin +mkdir -p initrd/sbin +mkdir -p initrd/etc +mkdir -p initrd/dev +mkdir -p initrd/proc +mkdir -p initrd/sys +mkdir -p initrd/lib +mkdir -p initrd/var +mkdir -p initrd/mnt +cp /bin/busybox initrd/bin/busybox +initrd/bin/busybox --install initrd/bin +echo "#!/bin/sh + +mount -t proc proc /proc +mount -t sysfs sysfs /sys +mount -t devtmpfs devtmpfs /dev +/bin/sh" > initrd/init +chmod +x initrd/init +cd initrd +find . | cpio --create --format='newc' | gzip > ../initrd.cpio.gz +cd .. + +mkdir -p rootfs +cd rootfs tar xvzf ../initrd.tar.gz mkdir proc mkdir run @@ -19,6 +45,15 @@ mkdir srv mkdir sys rm var/run cp -ar ../dist/install/* . +mv ../initrd.cpio.gz ./root +cp ../Image ./root +echo "name=\"test\" +memory=512 +vcpus=1 +kernel=\"/root/Image\" +ramdisk=\"/root/initrd.cpio.gz\" +extra=\"console=hvc0 root=/dev/ram0 rdinit=/bin/sh\" +" > root/test.cfg echo "#!/bin/bash export LD_LIBRARY_PATH=/usr/local/lib @@ -26,6 +61,8 @@ bash /etc/init.d/xencommons start xl list +xl create -c /root/test.cfg + " > etc/local.d/xen.start chmod +x etc/local.d/xen.start echo "rc_verbose=yes" >> etc/rc.conf @@ -68,7 +105,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf rm -f smoke.serial set +e echo " virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \ -timeout -k 1 480 \ +timeout -k 1 720 \ qemu-system-aarch64 \ -machine virtualization=true \ -cpu cortex-a57 -machine type=virt \ @@ -80,5 +117,5 @@ qemu-system-aarch64 \ -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& tee smoke.serial set -e -grep -q "Domain-0" smoke.serial || exit 1 +(grep -q "Domain-0" smoke.serial && grep -q "BusyBox" smoke.serial) || exit 1 exit 0