From patchwork Fri Apr 26 16:39:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 10919395 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DAA6A912 for ; Fri, 26 Apr 2019 16:42:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8F4428E17 for ; Fri, 26 Apr 2019 16:42:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBE6E28E04; Fri, 26 Apr 2019 16:42:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 094B728E04 for ; Fri, 26 Apr 2019 16:42:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hK3ul-00088L-MC; Fri, 26 Apr 2019 16:41:31 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hK3uj-00086I-St for xen-devel@lists.xenproject.org; Fri, 26 Apr 2019 16:41:29 +0000 X-Inumbo-ID: 23b47482-6842-11e9-843c-bc764e045a96 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 23b47482-6842-11e9-843c-bc764e045a96; Fri, 26 Apr 2019 16:41:28 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.60,398,1549929600"; d="scan'208";a="84519698" From: Ian Jackson To: Date: Fri, 26 Apr 2019 17:39:54 +0100 Message-ID: <20190426164002.22381-8-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190426164002.22381-1-ian.jackson@eu.citrix.com> References: <20190426164002.22381-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [OSSTEST PATCH 07/15] arch replumbing: Replace many $r{arch} with $[g]ho->{Arch} X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP No functional change with existing flights. But the effect is that now, generally, ts-* scripts and the support code will honour host_arch, if it is set, in preference to arch. This patch contains only replacements of $r{arch} with $ho->{Arch} or $gho->{Arch}. In fact, perhaps surprisingly, there were no locations where $gho was wanted rather than $ho (I have double checked this). Exceptions, where we left $r{arch} alone, are: * make-flight: a comment, which we are about to deal with; * ts-kernel-build: we are going to support cross building and $r{arch} is going to be the architecture of the kernel we want rather than of the build host. Signed-off-by: Ian Jackson --- Osstest/Debian.pm | 14 +++++++------- Osstest/TestSupport.pm | 4 ++-- ts-freebsd-build | 2 +- ts-host-install | 6 +++--- ts-memdisk-try-append | 2 +- ts-xen-build-prep | 4 ++-- ts-xen-install | 8 ++++---- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index 8abd6aed..911d8905 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -444,7 +444,7 @@ sub setupboot_grub2 ($$$$) { # Grub2 on jessie/stretch ARM* doesn't do multiboot, so we must chainload. my $need_uefi_chainload = get_host_property($ho, "firmware", "") eq "uefi" && - $ho->{Suite} =~ m/jessie|stretch/ && $r{arch} =~ m/^arm/; + $ho->{Suite} =~ m/jessie|stretch/ && $ho->{Arch} =~ m/^arm/; my $parsemenu= sub { my $f= bl_getmenu_open($ho, $rmenu, "$stash/$ho->{Name}--grub.cfg.1"); @@ -749,7 +749,7 @@ END sub preseed_microcode($$) { my ($ho,$sfx) = @_; - my $prop = "MicrocodeUpdate".ucfirst($r{arch}); + my $prop = "MicrocodeUpdate".ucfirst($ho->{Arch}); return unless $c{$prop}; logm("ucode=$prop $c{$prop}"); my $ucode = get_filecontents("$c{Images}/$c{$prop}"); @@ -1134,7 +1134,7 @@ sub di_installer_path ($) { # useable for constructing host paths as well as guest paths my ($ho) = @_; - return $ho->{Tftp}{DiBase}.'/'.$r{arch}.'/'. + return $ho->{Tftp}{DiBase}.'/'.$ho->{Arch}.'/'. ($ho->{DiVersion} // cfg_tftp_di_version($ho->{Suite})) .'-'.$ho->{Suite}; } @@ -1340,8 +1340,8 @@ END # Userland_setarch personality to restore using setarch my $kern_arch = $kern_arch_info->{Kernel_Debian}; if ($kern_arch && - $ho->{Flags}{"arch-$r{arch}"} && !$ho->{Flags}{"arch-$kern_arch"}) { - # We check the flag for $r{arch} because for various reasons + $ho->{Flags}{"arch-$ho->{Arch}"} && !$ho->{Flags}{"arch-$kern_arch"}) { + # We check the flag for $ho->{Arch} because for various reasons # it may not be set. For example, in standalone mode it is # currently not normally necessary to set any arch hostflags. # In that situation we bet that the kern arch can be used; @@ -1356,7 +1356,7 @@ END } if ($kern_arch) { my $setarch = "setarch $kern_arch_info->{Userland_setarch}"; - logm("Using $kern_arch kernel for $r{arch} userland ($setarch)"); + logm("Using $kern_arch kernel for $ho->{Arch} userland ($setarch)"); preseed_hook_command($ho, 'late_command', $sfx, <{Arch} kernels end up being the default so shuffle them # where update-grub will not find them for f in /boot/vmlinu*; do dpkg-divert --rename --divert "/boot/~disable~\${f##*/}" "\$f" diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 16c17e37..18617d98 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -2904,8 +2904,8 @@ sub setup_netboot_local_uefi ($) { # i386 is X64 because when we are trying to install i386 # on a UEFI box, it's actually an amd64-capable UEFI box # which expects a 64-bit EFI loader - die "EFI arch" unless $efi_archs{ $r{arch} }; - my $efi = $efi_archs{ $r{arch} }; + die "EFI arch" unless $efi_archs{ $ho->{Arch} }; + my $efi = $efi_archs{ $ho->{Arch} }; setup_netboot_bootcfg($ho, <{Arch} END # Build process as documented in the handbook: diff --git a/ts-host-install b/ts-host-install index 3c14f171..4bfa2f5e 100755 --- a/ts-host-install +++ b/ts-host-install @@ -61,7 +61,7 @@ our %timeout= qw(ReadPreseed 350 our $kern_arch_info; if ($build) { - if ($r{arch} eq 'i386') { + if ($ho->{Arch} eq 'i386') { $kern_arch_info = { Kernel_Debian => 'amd64', Userland_setarch => 'i386', @@ -262,7 +262,7 @@ END push @dicmdline, "domain=$c{TestHostDomain}"; push @dicmdline, get_host_property($ho, "install-append $ho->{Suite}", ''), - get_host_property($ho, "install-append $ho->{Suite} $r{arch}", ''); + get_host_property($ho, "install-append $ho->{Suite} $ho->{Arch}", ''); my $console = get_host_native_linux_console($ho); @@ -280,7 +280,7 @@ END push @hocmdline, get_host_property($ho, "linux-boot-append $ho->{Suite}", ''), - get_host_property($ho, "linux-boot-append $ho->{Suite} $r{arch}", ''); + get_host_property($ho, "linux-boot-append $ho->{Suite} $ho->{Arch}", ''); $xopts{ipappend} = $ipappend; setup_netboot_di($ho, $kernel, "/$initrd", \@dicmdline, \@hocmdline, diff --git a/ts-memdisk-try-append b/ts-memdisk-try-append index f6ec2fd5..ce39d5a7 100755 --- a/ts-memdisk-try-append +++ b/ts-memdisk-try-append @@ -23,7 +23,7 @@ arch=`perl -e ' use Osstest::TestSupport; tsreadconfig(); - print $r{arch} or die $!; + print $ho->{Arch} or die $!; '` case "$arch" in diff --git a/ts-xen-build-prep b/ts-xen-build-prep index c38ab36d..0f07648e 100755 --- a/ts-xen-build-prep +++ b/ts-xen-build-prep @@ -246,7 +246,7 @@ END if ($ho->{Suite} !~ m/lenny|squeeze/) { target_install_packages($ho, 'libfdt-dev'); } - if ($r{arch} eq 'amd64' && $ho->{Suite} !~ m/squeeze|lenny/) { + if ($ho->{Arch} eq 'amd64' && $ho->{Suite} !~ m/squeeze|lenny/) { target_install_packages($ho, 'libc6-dev-i386'); } } @@ -269,4 +269,4 @@ if (!$ho->{Flags}{'no-reinstall'}) { gitcache_setup($ho); } -host_shared_mark_ready($ho, "build-".$ho->{Suite}."-".$r{arch}); +host_shared_mark_ready($ho, "build-".$ho->{Suite}."-".$ho->{Arch}); diff --git a/ts-xen-install b/ts-xen-install index 9f78a75f..2d3c644d 100755 --- a/ts-xen-install +++ b/ts-xen-install @@ -64,7 +64,7 @@ sub packages () { if ($ho->{Suite} !~ m/lenny|squeeze/) { target_install_packages($ho, qw(libfdt1)); } - if ($r{arch} eq 'i386') { + if ($ho->{Arch} eq 'i386') { target_install_packages($ho, qw(libc6-xen)); } target_install_packages($ho, @{toolstack($ho)->{ExtraPackages}}) @@ -92,7 +92,7 @@ sub some_extradebs ($) { target_install_packages($ho, qw(rsync)) unless $rsync_installed++; target_putfile_root($ho,300, "$path/.", $ontarget, '-r'); } elsif ($path =~ m{\.deb$}) { - $path =~ s{_\.deb}{ "_$r{arch}.deb" }e; + $path =~ s{_\.deb}{ "_$ho->{Arch}.deb" }e; logm("$cfgvar: installing $path"); $ontarget = basename($path); $dpkgopts = '-iB'; @@ -115,7 +115,7 @@ sub extradebs () { # $c{ DebianExtraPackages___ } my $firmware = get_host_property($ho, "firmware", "bios"); - some_extradebs([ 'DebianExtraPackages', $firmware, $r{arch}, $suite ]); + some_extradebs([ 'DebianExtraPackages', $firmware, $ho->{Arch}, $suite ]); } sub extract () { @@ -193,7 +193,7 @@ sub setupboot () { my $xenhopt= "conswitch=x watchdog noreboot async-show-all"; my $cons= get_host_property($ho, 'XenSerialConsole', - $r{arch} =~ m/^arm/ ? 'dtuart' + $ho->{Arch} =~ m/^arm/ ? 'dtuart' : 'com1'); if ( $cons eq "com1" ) {