From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST v3 07/22] Refactor pxelinux configuration Date: Wed, 24 Jun 2015 16:32:26 +0100 Message-ID: <1435159961-22292-7-git-send-email-ian.campbell@citrix.com> References: <1435159944.28264.295.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1435159944.28264.295.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org The mechanism used to PXE boot can differ depending on the firmware type. Therefore refactor into Osstest::TestSupport and key off a new host property "firmware". Currently supported is "bios" (the default) and "uboot", both of which use pxelinux.cfg style files. The default for the firmware property is "bios", hence no change for any existing system (including those which use uboot, regardless of whether they are now configured with the firmware proprty or not) As part of this "setup_pxeboot" becomes "setup_pxeboot_di" since it is somewhat d-i specific. Signed-off-by: Ian Campbell --- v3: reorder setup_${firmware}_pxeboot to setup_pxeboot_${firmware} join $dicmd in setup_pxeboot instead of caller --- Osstest/TestSupport.pm | 49 +++++++++++++++++++++++++++++++++++++++++++++---- ts-host-install | 23 ++++++----------------- 2 files changed, 51 insertions(+), 21 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 66a0d81..512efd2 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -104,7 +104,7 @@ BEGIN { await_webspace_fetch_byleaf create_webfile file_link_contents get_timeout - setup_pxeboot setup_pxeboot_local host_pxefile + setup_pxeboot_di setup_pxeboot_local host_pxefile ether_prefix @@ -2098,16 +2098,34 @@ sub host_pxefile ($;$) { (join ",", sort keys %v)." ?"; } -sub setup_pxeboot ($$) { +sub setup_pxelinux_bootcfg ($$) { my ($ho, $bootfile) = @_; my $f= host_pxefile($ho); file_link_contents("$ho->{Tftp}{Path}$ho->{Tftp}{PxeDir}$f", $bootfile, "$ho->{Name}-pxelinux.cfg"); } -sub setup_pxeboot_local ($) { +# Systems using BIOS are configured to use pxelinux +sub setup_pxeboot_di_bios ($$$$$;%) { + my ($ho,$kern,$initrd,$dicmd,$hocmd,%xopts) = @_; + my $dtbs = "fdtdir $xopts{dtbs}" if $xopts{dtbs}; + setup_pxelinux_bootcfg($ho, <{Ether}", A END } - my $dtbs = ""; + my %xopts; + foreach my $kp (keys %{ $ho->{Flags} }) { # Backwards compatibility $kp = "need-kernel-deb-wheezy-backports" if $kp eq "need-kernel-deb-armmp"; $kp =~ s/need-kernel-deb-$ho->{Suite}-// or next; - $dtbs = "fdtdir /$d_i/$kp-dtbs" + $xopts{dtbs} = "/$d_i/$kp-dtbs" if -e "$ho->{Tftp}{Path}/$d_i/$kp-dtbs"; } @@ -284,21 +285,9 @@ END get_host_property($ho, "linux-boot-append $ho->{Suite}", ''), get_host_property($ho, "linux-boot-append $ho->{Suite} $r{arch}", ''); - my $dicmd= join ' ', @dicmdline; - my $hocmd= join ' ', @hocmdline; - - setup_pxeboot($ho, <