From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST v8 04/14] distros: support booting Debian PV (d-i installed) guests with pvgrub. Date: Wed, 8 Jul 2015 13:30:52 +0100 Message-ID: <1436358662-12886-4-git-send-email-ian.campbell@citrix.com> References: <1436358648.23508.32.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1436358648.23508.32.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 This requires the use of the pv-grub-menu package which is in Jessie onwards. (it is in wheezy-backports which is the subject of a subsequent patch). The bootloader to use is specified via a runvar {Guest}_bootloader. Adjust make-distros-flight to use pvgrub for some subset of i386 and amd64 guests to get coverage. Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- v8: Added comment regarding new runvar. Since this was inspired by Ian's comment on "distros: support PV guest install from Debian netinst media I have retained the ack. v7: Move definition of $extra_packages variable to here which is its first usage. Use {Guest}_suite not {Guest}_dist as runvar to choose version. v3: Define and use arch_debian2xen and arch_xen2debian Avoid pv-grub-x86_64.gz on i386 dom0, we don't built it there. Fiddle with py vs pv grub stripy a bit. --- Osstest.pm | 7 +++++++ Osstest/Debian.pm | 4 +++- make-distros-flight | 20 +++++++++++++++++++- ts-debian-di-install | 18 ++++++++++++++---- 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/Osstest.pm b/Osstest.pm index 6535401..8f97dd2 100644 --- a/Osstest.pm +++ b/Osstest.pm @@ -39,6 +39,7 @@ BEGIN { db_begin_work db_prepare ensuredir get_filecontents_core_quiet system_checked nonempty visible_undef show_abs_time + %arch_debian2xen %arch_xen2debian ); %EXPORT_TAGS = ( ); @@ -54,6 +55,12 @@ scalar *main::DEBUG; # declaration prevents `Name "main::DEBUG" used only once' # scalar prevents `useless use of a variable in void context' +our %arch_debian2xen = qw(i386 x86_32 + amd64 x86_64 + armhf armhf); +our %arch_xen2debian; +$arch_xen2debian{$arch_debian2xen{$_}} = $_ foreach keys %arch_debian2xen; + #---------- static default config settings ---------- our %c = qw( diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index 2d49ff8..1edf49f 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -867,7 +867,9 @@ sub preseed_create_guest ($$;@) { my $suite= $xopts{Suite} || $c{DebianSuite}; - my $preseed_file= preseed_base($ho, $suite, $sfx, '', %xopts); + my $extra_packages = "pv-grub-menu" if $xopts{PvMenuLst}; + + my $preseed_file= preseed_base($ho, $suite, $sfx, $extra_packages, %xopts); $preseed_file.= (<_method: # Install method, currently only "netboot". +# - _bootloader: +# The PV bootloader to use when booting the guest. One of +# "pvgrub" or "pygrub". Default is "pygrub". # # For method="netboot": # # - _netboot_kernel: -# URL of the kernel to boot +# URL of the kernel to boot. # - _netboot_ramdisk: -# URL of the ramdisk to boot +# URL of the ramdisk to boot. # # If neither kernel nor ramdisk are specified then the current # TftpDiVersion of d-i will be used, and the runvars will be set to @@ -107,6 +110,8 @@ sub ginstall () { my $method= $r{"$gho->{Guest}_method"}; my $tmpdir= "/root/$flight-$job-di"; + my $bl= $r{"$gho->{Guest}_bootloader"}; + target_cmd_root($ho, <$suite); + $ps_url = preseed_create_guest($gho, '', Suite=>$suite, PvMenuLst=>($bl eq "pvgrub")); $extra_disk = ""; } @@ -162,7 +167,12 @@ END guest_await_shutdown($ho,$gho,3600); guest_destroy($gho); - my $blcfg = <