[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/9] automation: qemu-smoke-arm32.sh: Modify script to use ImageBuilder


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Fri, 23 Sep 2022 10:04:26 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=elVgYMLkUcavZyiFvELPr6QVQ/0eeYdOyU1DIRPP6BI=; b=B4mR/F7bsLzlL3hg03b1rGDliAoSh9snDnkm96tW51Q7T4Q6Js4E3IkK+YVZk0Y1ad/Vk6BYfnjUZEBV3zJDzH9wjfk1cBMATl9XZp+Fx6euadfwd7o6234F5hz90DRTM1DTel6j8HoIWVLWrflNsWXuf3A92wHxo6YAaS8kR5AEsmr+oy8ZbVXKCtypcuhDJ0wsjeddQLpQanZxOq6Eckb+8Ye9Y6nEMIfDs5kdG35zrHB2FZum3uJkMQDepgGwrAXPZ7fYr3ou8WrXntADiz/rsG4O1jKV8YJGW2JUYpgdb1Ov1GfUzfCJc19/+JeJED/KbsrYuvpfPOJzZCyylQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UMOnkmCIScaytb+ppBSjLWwOMwyQuEosvikM2Yoxdh7Q3H2FoAy2kDMkJOaFOZ9IRqz4RHVTwRppfLoyzAzJ7xb0nDeaUJaUreETlk7m9nIwYX/wUkUi9eCoB9zkdXBPWySChxDW6J0P+mJYrUJjgActZbwjsstsvV/+Z9Byif2NpV0zpSqao2SbpiteUlpULuUk+UtleQwyQTyY6FiMpcnflW7OZoRXRhJCExX8Gvl2PhtoxBlI4K5iaBT6rMKNY8Iku19Gyi5w970tK/lhNFTzswr5Kz0xOYd5Ywm0LOST1PFeMWu5tAJJFgGqwCLJUUWukB25wzT4usl7OldD3Q==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>
  • Delivery-date: Fri, 23 Sep 2022 08:04:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Stefano,

On 23/09/2022 00:13, Stefano Stabellini wrote:
> 
> 
> On Thu, 22 Sep 2022, Michal Orzel wrote:
>> Take an example from arm64 qemu test scripts and use ImageBuilder
>> to generate u-boot script automatically. Calculating the addresses
>> manually is quite error prone and also we will be able to benefit
>> from using ImageBuilder when adding domUs to this test in the future.
>>
>> Install and use u-boot from the debian package.
>> Modify the script so that binaries are loaded from u-boot via tftp.
> 
> Great patch! It makes the test a lot better!
> 
> 
>> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
>> ---
>>  automation/scripts/qemu-smoke-arm32.sh | 57 ++++++++++++--------------
>>  1 file changed, 27 insertions(+), 30 deletions(-)
>>
>> diff --git a/automation/scripts/qemu-smoke-arm32.sh 
>> b/automation/scripts/qemu-smoke-arm32.sh
>> index 530f3892fdd3..765facbe4d66 100755
>> --- a/automation/scripts/qemu-smoke-arm32.sh
>> +++ b/automation/scripts/qemu-smoke-arm32.sh
>> @@ -4,7 +4,9 @@ set -ex
>>
>>  export DEBIAN_FRONTENT=noninteractive
>>  apt-get -qy update
>> -apt-get -qy install --no-install-recommends device-tree-compiler \
>> +apt-get -qy install --no-install-recommends u-boot-qemu \
>> +                                            u-boot-tools \
>> +                                            device-tree-compiler \
>>                                              curl \
>>                                              cpio
>>
>> @@ -20,10 +22,6 @@ tar xvzf ../initrd.tar.gz
>>  find . | cpio -H newc -o | gzip > ../initrd.gz
>>  cd ..
>>
>> -kernel=`stat -L --printf="%s" vmlinuz`
>> -initrd=`stat -L --printf="%s" initrd.gz`
>> -
>> -# For Xen, we need a couple of more node. Dump the DT from QEMU and add them
>>  # XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
>>  curl -fsSLO 
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fqemu%2Fqemu%2Fraw%2Fv5.2.0%2Fpc-bios%2Fefi-virtio.rom&amp;data=05%7C01%7Cmichal.orzel%40amd.com%7Cd33d5c4c08934fac0cc208da9ce7a3fb%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637994815957091528%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=JuEapfYVLj5P3S5yY%2BAa47Nk4zgbdymjjsiUTmoTmyk%3D&amp;reserved=0
>>  ./qemu-system-arm \
>> @@ -36,31 +34,31 @@ curl -fsSLO 
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fqemu%2Fqemu%2Fraw%2Fv5.2.0%2Fpc-bios%2Fefi-virtio.rom&amp;data=05%7C01%7Cmichal.orzel%40amd.com%7Cd33d5c4c08934fac0cc208da9ce7a3fb%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637994815957091528%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=JuEapfYVLj5P3S5yY%2BAa47Nk4zgbdymjjsiUTmoTmyk%3D&amp;reserved=0
>>     -display none \
>>     -machine dumpdtb=virt.dtb
>>
>> -dtc -I dtb -O dts virt.dtb > virt.dts
>> +# ImageBuilder
>> +echo 'MEMORY_START="0x40000000"
>> +MEMORY_END="0x80000000"
>> +
>> +DEVICE_TREE="virt.dtb"
>> +XEN="xen"
>> +DOM0_KERNEL="vmlinuz"
>> +DOM0_RAMDISK="initrd.gz"
>> +DOM0_CMD="console=hvc0 earlyprintk clk_ignore_unused root=/dev/ram0 
>> rdinit=/bin/sh"
>> +XEN_CMD="console=dtuart dom0_mem=512M bootscrub=0"
> 
> This is missing dtuart=/pl011@9000000 compared to the original

Actually this is not needed because we always have stdout-path defined in 
chosen to point to /pl011@...
but I can add this.

> 
> 
>> +NUM_DOMUS=0
>> +
>> +LOAD_CMD="tftpb"
>> +BOOT_CMD="bootm"
> 
> "bootm" because "booti" is not available on arm32, right?

Exactly.
> 
> 
>> +UBOOT_SOURCE="boot.source"
>> +UBOOT_SCRIPT="boot.scr"' > config
>>
>> -cat >> virt.dts << EOF
>> -/ {
>> -     chosen {
>> -             #address-cells = <0x2>;
>> -             #size-cells = <0x2>;
>> -             stdout-path = "/pl011@9000000";
>> -        xen,xen-bootargs = "console=dtuart dtuart=/pl011@9000000 
>> dom0_mem=512M bootscrub=0";
>> -             xen,dom0-bootargs = "console=tty0 console=hvc0 earlyprintk 
>> clk_ignore_unused root=/dev/ram0 rdinit=/bin/sh";
>> -             dom0 {
>> -                     compatible = "xen,linux-zimage", 
>> "xen,multiboot-module";
>> -                     reg = <0x0 0x1000000 0x0 $kernel>;
>> -             };
>> -        dom0-ramdisk {
>> -                     compatible = "xen,linux-initrd", 
>> "xen,multiboot-module";
>> -                     reg = <0x0 0x3200000 0x0 $initrd>;
>> -             };
>> -     };
>> -};
>> -EOF
>> -dtc -I dts -O dtb virt.dts > virt.dtb
>> +rm -rf imagebuilder
>> +git clone 
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.com%2FViryaOS%2Fimagebuilder&amp;data=05%7C01%7Cmichal.orzel%40amd.com%7Cd33d5c4c08934fac0cc208da9ce7a3fb%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637994815957091528%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=i5N8DXMjn%2F80mdXtc%2FwDGJw6ImUrUAjOg0SJp9CkRdQ%3D&amp;reserved=0
>> +bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
>>
>>  rm -f smoke.serial
>>  set +e
>> +echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
>>  timeout -k 1 240 \
>>  ./qemu-system-arm \
>>     -machine virt \
>> @@ -70,11 +68,10 @@ timeout -k 1 240 \
>>     -serial stdio \
>>     -monitor none \
>>     -display none \
>> -   -dtb virt.dtb \
>>     -no-reboot \
>> -   -kernel ./xen \
>> -   -device loader,file=./vmlinuz,addr=0x1000000 \
>> -   -device loader,file=./initrd.gz,addr=0x3200000 |& tee smoke.serial
>> +   -device virtio-net-pci,netdev=n0 \
>> +   -netdev user,id=n0,tftp=./ \
>> +   -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& tee smoke.serial
>>
>>  set -e
>>  (grep -q "^/ #" smoke.serial) || exit 1
>> --
>> 2.25.1
>>

~Michal



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.