xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: ian.jackson@eu.citrix.com
Cc: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Subject: [PATCH OSSTEST v2 12/15] distros: support PV guest install from Debian netinst media.
Date: Mon, 28 Apr 2014 11:41:33 +0100	[thread overview]
Message-ID: <1398681696-2773-12-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1398681672.29700.55.camel@kazak.uk.xensource.com>

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 <ian.campbell@citrix.com>
---
 Osstest/Debian.pm    |  7 +++++--
 make-distros-flight  | 22 ++++++++++++++++++++
 ts-debian-di-install | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 84 insertions(+), 2 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index ad478ab..b149e8d 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -433,8 +433,6 @@ sub preseed_base ($$;@) {
     $extra_packages ||= '';
 
     my $preseed= (<<END);
-d-i mirror/suite string $suite
-
 d-i debian-installer/locale string en_GB
 d-i console-keymaps-at/keymap select gb
 d-i keyboard-configuration/xkb-keymap string en_GB
@@ -502,6 +500,11 @@ $xopts{ExtraPreseed}
 
 END
 
+    # For CDROM the suite is part of the image
+    $preseed .= <<END unless $xopts{CDROM};
+d-i mirror/suite string $suite
+END
+
     # deb http://ftp.debian.org/debian/ wheezy-backports main
     $preseed .= <<END if $xopts{EnableBackports};
 d-i apt-setup/local0/repository string http://$c{DebianMirrorHost}/$c{DebianMirrorSubpath} $suite-backports main
diff --git a/make-distros-flight b/make-distros-flight
index 244d582..a679c61 100755
--- a/make-distros-flight
+++ b/make-distros-flight
@@ -86,6 +86,19 @@ test_do_one_netboot () {
       all_hostflags=$most_hostflags
 }
 
+test_do_one_netinst () {
+  # Always pygrub since no pv-grub-menu on CD
+  job_create_test test-$xenarch$kern-$dom0arch-$domU-$cd-netinst \
+    test-debian-di xl $xenarch $dom0arch                        \
+      kernbuildjob=${bfi}build-$dom0arch-$kernbuild             \
+      debian_arch=$domU                                         \
+      debian_cd=$cd                                             \
+      debian_method=netinst                                     \
+      debian_bootloader=pygrub                                  \
+      all_hostflags=$most_hostflags
+
+}
+
 test_matrix_do_one () {
   case ${xenarch} in
   amd64) domUarches="amd64 i386";;
@@ -104,6 +117,15 @@ test_matrix_do_one () {
 
     done
 
+    for cd in current weekly ; do
+      case ${domU}_${dist} in
+      armhf_*) continue;; # No iso targets for armhf
+      *) ;;
+      esac
+
+      test_do_one_netinst
+
+    done
   done
 }
 
diff --git a/ts-debian-di-install b/ts-debian-di-install
index 5ed15e4..56feee6 100755
--- a/ts-debian-di-install
+++ b/ts-debian-di-install
@@ -46,6 +46,53 @@ sub prep () {
     target_cmd_root($ho, "umount $gho->{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");
+    open C, "curl $baseurl/MD5SUMS|" or die "curl: $!";
+    while(<C>) {
+	m/^[0-9a-f]{32}  (debian-.*-$props->{FileArch}-netinst)\.iso$/ or next;
+	$filebase = $1;
+	last;
+    }
+    close(C);
+
+    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, <<END, 3600);
+    cd $didir && jigdo-lite --noask $netinst_jigdo
+END
+    store_runvar("$gho->{Guest}_netinst_jigdo", $netinst_jigdo);
+
+    return (<<END, "\"file:$didir/$filebase.iso,xvdd:cdrom,r\",");
+bootloader = "pygrub"
+bootloader_args = ["--kernel=$props->{IsoPath}/vmlinuz", "--ramdisk=$props->{IsoPath}/initrd.gz"]
+END
+}
+
 sub setup_netboot($$$)
 {
     my ($didir, $arch, $suite) = @_;
@@ -111,6 +158,16 @@ END
 
 	$extra_disk = "";
     }
+    elsif ($method eq "netinst" )
+    {
+	my $cd = $r{"$gho->{Guest}_cd"};
+
+	logm("$method $cd/$arch");
+
+	($method_cfg,$extra_disk) = setup_netinst("/root/di", $arch, $cd);
+
+	$ps_url = preseed_create_guest($gho, '', CDROM=>1);
+    }
     else
     {
 	die "$method";
-- 
1.9.0

  parent reply	other threads:[~2014-04-28 10:41 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28 10:41 [PATCH OSSTEST v2 00/15] add distro domU testing flight Ian Campbell
2014-04-28 10:41 ` [PATCH OSSTEST v2 01/15] cr-external-linux: remove Ian Campbell
2014-05-02 11:19   ` Ian Jackson
2014-04-28 10:41 ` [PATCH OSSTEST v2 02/15] Build against liblzma to support .xz compressed kernels Ian Campbell
2014-05-02 11:19   ` Ian Jackson
2014-04-28 10:41 ` [PATCH OSSTEST v2 03/15] mg-debian-installer-update: grab Xen PV domU capable images too Ian Campbell
2014-05-02 11:22   ` Ian Jackson
2014-04-28 10:41 ` [PATCH OSSTEST v2 04/15] TestSupport: Add helper to fetch a URL on a host Ian Campbell
2014-05-02 11:25   ` Ian Jackson
2014-05-02 12:16     ` Ian Campbell
2014-04-28 10:41 ` [PATCH OSSTEST v2 05/15] TestSupport: Add helper to wait for a guest to shutdown Ian Campbell
2014-05-02 11:24   ` Ian Jackson
2014-04-28 10:41 ` [PATCH OSSTEST v2 06/15] TestSupport: allow overring of on_* in prepareguest_part_xencfg Ian Campbell
2014-05-02 11:26   ` Ian Jackson
2014-04-28 10:41 ` [PATCH OSSTEST v2 07/15] TestSupport: allow caller of prepareguest_part_xencfg to specify viftype Ian Campbell
2014-05-02 11:28   ` Ian Jackson
2014-05-02 12:21     ` Ian Campbell
2014-04-28 10:41 ` [PATCH OSSTEST v2 08/15] Debian: add preseed_create_guest helper Ian Campbell
2014-05-02 11:33   ` Ian Jackson
2014-05-02 12:23     ` Ian Campbell
2014-04-28 10:41 ` [PATCH OSSTEST v2 09/15] distros: add support for installing Debian PV guests via d-i, flight and jobs Ian Campbell
2014-05-02 11:46   ` Ian Jackson
2014-05-02 12:28     ` Ian Campbell
2014-05-02 14:14       ` Ian Jackson
2014-05-02 15:19         ` Ian Campbell
2014-04-28 10:41 ` [PATCH OSSTEST v2 10/15] distros: support booting Debian PV (d-i installed) guests with pvgrub Ian Campbell
2014-05-02 13:03   ` Ian Jackson
2014-05-02 13:18     ` Ian Campbell
2014-05-02 14:18       ` Ian Jackson
2014-05-02 15:22         ` Ian Campbell
2014-05-02 15:40           ` Ian Jackson
2014-04-28 10:41 ` [PATCH OSSTEST v2 11/15] distros: attempt pvgrub support for PV Wheezy too Ian Campbell
2014-05-02 13:11   ` Ian Jackson
2014-05-02 13:20     ` Ian Campbell
2014-05-02 14:19       ` Ian Jackson
2014-05-02 15:23         ` Ian Campbell
2014-04-28 10:41 ` Ian Campbell [this message]
2014-05-02 14:01   ` [PATCH OSSTEST v2 12/15] distros: support PV guest install from Debian netinst media Ian Jackson
2014-05-02 14:07     ` Ian Campbell
2014-05-02 14:20       ` Ian Jackson
2014-04-28 10:41 ` [PATCH OSSTEST v2 13/15] Test pygrub and pvgrub on the regular flights Ian Campbell
2014-05-02 14:02   ` Ian Jackson
2014-05-02 14:07     ` Ian Campbell
2014-04-28 10:41 ` [PATCH OSSTEST v2 14/15] distros: add branch infrastructure Ian Campbell
2014-05-02 14:04   ` Ian Jackson
2014-05-02 14:09     ` Ian Campbell
2014-05-02 14:30       ` Ian Jackson
2014-05-02 15:25         ` Ian Campbell
2014-04-28 10:41 ` [PATCH OSSTEST v2 15/15] distros: Run a flight over the weekend Ian Campbell
2014-05-02 14:05   ` Ian Jackson
2014-04-28 11:30 ` [PATCH OSSTEST v2 00/15] add distro domU testing flight Fabio Fantoni
2014-04-28 11:32   ` Ian Campbell
2014-04-28 12:59     ` Fabio Fantoni
2014-05-15  9:14 ` Ian Campbell
2014-05-16 17:08   ` Ian Jackson
2014-05-19  9:02     ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1398681696-2773-12-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).