From: Ian Campbell Subject: [PATCH OSSTEST v3 15/19] distros: support PV guest install from Debian netinst media. Date: Mon, 1 Dec 2014 12:57:32 +0000 Message-ID: <1417438656-15451-15-git-send-email-ian.campbell@citrix.com> References: <1417438571.29138.22.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1417438571.29138.22.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 netinst media are iso images containing a base Debian install and some (image size dependent) additional tasks. On x86 the "multiarch" iso flavour contains a Xen capable kernel for both i386 and amd64 so use that. This adds support for two classes of ISO, the CD sized ones which are built nightly and the DVD sized ones which are built weekly. The images are downloaded using jigdo which sources the majority of the data from a local Debian mirror, for this reason I have not worried about the fact that the i386 and amd64 tests are downloading the same thing (adding a specific download job would require finding up to 4GB of scratch space for each flight). The ISOs booted using pygrub which can extract the kernel and initrd from a ISO image. The resulting guests are also booted with pygrub since the pv-grub-menu package is not available on the ISO images and we have pvgrub coverage from the netboot tests. Signed-off-by: Ian Campbell --- v3: - Indent jigdo-lite script line to improve readability - Wrap bootloader_args - Fetch URL on target, to get a timeout. Use wget since that is arranged to be present. - include bootloader in test name. --- Osstest/Debian.pm | 7 +++++-- make-distros-flight | 23 +++++++++++++++++++++ ts-debian-di-install | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 2 deletions(-) diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index dc01be5..25cacd2 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -492,8 +492,6 @@ sub preseed_base ($$;@) { $xopts{ExtraPreseed} ||= ''; my $preseed= <{Lvdev} ||:"); } +sub setup_netinst($$$) +{ + my ($didir, $arch, $cd) = @_; + my %arch_props = ( + amd64 => { PathArch => "multi-arch", FileArch => "amd64-i386", IsoPath => "/install.amd/xen" }, + i386 => { PathArch => "multi-arch", FileArch => "amd64-i386", IsoPath => "/install.386/xen" }, + armhf => { PathArch => "armhf", FileArch => "armhf", IsoPath => "/install.armhf" } + ); + my $props = $arch_props{$arch} or die "Unknown arch $arch"; + + target_install_packages($ho, qw(jigdo-file)); + + my $baseurl = $cd eq "current" ? + "http://cdimage.debian.org/debian-cd/current/$props->{PathArch}/jigdo-cd" : + "http://cdimage.debian.org/cdimage/weekly-builds/$props->{PathArch}/jigdo-cd"; + + my $filebase; + + # Use the MD5SUMs file as an index + logm("Fetch index from $baseurl/MD5SUMS"); + my $idx = target_cmd_output_root($ho, "wget --quiet -O - $baseurl/MD5SUMS"); + foreach (split /\n/, $idx) { + m/^[0-9a-f]{32} (debian-.*-$props->{FileArch}-netinst)\.iso$/ or next; + $filebase = $1; + last; + } + + die unless $filebase; + + logm("Downloading $baseurl/$filebase.jigdo"); + # Jigdo seems to use /etc/apt/sources.list or something, so this + # just works using the already configured mirror without + # additional configuration, which is good because there doesn't + # seem to be any support for such things, at least in Squeeze. + my $netinst_jigdo = "$baseurl/$filebase.jigdo"; + target_cmd_root($ho, <{Guest}_netinst_jigdo", $netinst_jigdo); + + return (<{IsoPath}/vmlinuz", + "--ramdisk=$props->{IsoPath}/initrd.gz"] +END +} + sub setup_netboot($$$) { my ($didir, $arch, $suite) = @_; @@ -115,6 +162,16 @@ END $extra_disk = ""; } + elsif ($method eq "netinst" ) + { + my $cd = $r{"$gho->{Guest}_cd"}; + + logm("$method $cd/$arch"); + + ($method_cfg,$extra_disk) = setup_netinst($tmpdir, $arch, $cd); + + $ps_url = preseed_create_guest($gho, '', CDROM=>1); + } else { die "$method"; -- 2.1.1