]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
make-flight: Support specifying a mini-os tree+revision
authorIan Campbell <ian.campbell@citrix.com>
Tue, 19 Jan 2016 12:48:08 +0000 (12:48 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 20 Jan 2016 16:43:40 +0000 (16:43 +0000)
This is useful for standalone or adhoc use as well as (presumably)
bisection.

There is no ap-* or cr-daily-* integration here because I didn't need
it (i.e. I'm not intending to create a new mini-os branch here).

In order to cope with Xen <= 4.5 where extras/mini-os exists but is
part of xen.git and not something cloned from elsewhere add a
$optional argument (itself optional) to dir_identify_vcs which if true
causes dir_identify_vcs to return 'none' instead of failing.

Previously dir_identify_vcs failed with:
    bash: line 5: fail: command not found
because the fail command is undefined. Instead echo fail and use that
to trigger the $optional handling.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/TestSupport.pm
mfi-common
ts-xen-build

index 9a90c2e589a3e498124430bbb5ec18f31e0f1c70..2141905d5a1dae5aaeb7f395e096472a04be45b1 100644 (file)
@@ -1319,21 +1319,24 @@ END
     store_vcs_revision($which, $rev, $vcs);
 }
 
-sub dir_identify_vcs ($$) {
-    my ($ho,$dir) = @_;
-    return target_cmd_output($ho, <<END);
+sub dir_identify_vcs ($$;$) {
+    my ($ho,$dir,$optional) = @_;
+    my $vcs = target_cmd_output($ho, <<END);
         set -e
         if ! test -e $dir; then echo none; exit 0; fi
         cd $dir
         (test -e .git && echo git) ||
         (test -d .hg && echo hg) ||
-        (echo >&2 'unable to determine vcs'; fail)
+        (echo >&2 'unable to determine vcs'; echo fail)
 END
+    die "unable to determine vcs" if !$optional && $vcs eq 'fail';
+    $vcs = 'none' if $vcs eq 'fail';
+    return $vcs;
 }
 
 sub store_revision ($$$;$) {
     my ($ho,$which,$dir,$optional) = @_;
-    my $vcs= dir_identify_vcs($ho,$dir);
+    my $vcs= dir_identify_vcs($ho,$dir,$optional);
     return if $optional && $vcs eq 'none';
     my $rev= vcs_dir_revision($ho,$dir,$vcs);
     store_vcs_revision($which,$rev,$vcs);
index b739c7d93f576789f95bb96982e760c4276f927a..a70557302cd8c5b201ba54496bdcda293d2b2117 100644 (file)
@@ -191,6 +191,7 @@ create_build_jobs () {
         tree_xen=$TREE_XEN                                                   \
         tree_seabios=$TREE_SEABIOS                                           \
         tree_ovmf=$TREE_OVMF                                                 \
+        tree_minios=$TREE_MINIOS                                             \
                 $RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars     \
                 $suite_runvars                                               \
                 host_hostflags=$build_hostflags                              \
@@ -198,7 +199,8 @@ create_build_jobs () {
                 revision_qemu=$REVISION_QEMU                                 \
                 revision_qemuu=$REVISION_QEMU_UPSTREAM                       \
                 revision_seabios=$REVISION_SEABIOS                           \
-                revision_ovmf=$REVISION_OVMF
+                revision_ovmf=$REVISION_OVMF                                 \
+                revision_minios=$REVISION_MINIOS
     done
 
     if [ x$want_prevxen = xy ] ; then
index bc4e41a5de46b39a9da772c9c301d3c7a4e19ed3..8f927296124dd8e0ee7e2b72ea8df420d0767beb 100755 (executable)
@@ -84,6 +84,12 @@ END
 END
                (nonempty($r{revision_ovmf}) ? <<END : '').
        echo >>.config OVMF_UPSTREAM_REVISION='$r{revision_ovmf}'
+END
+               (nonempty($r{tree_minios}) ? <<END : '').
+       echo >>.config MINIOS_UPSTREAM_URL='$r{tree_minios}'
+END
+               (nonempty($r{revision_minios}) ? <<END : '').
+       echo >>.config MINIOS_UPSTREAM_REVISION='$r{revision_minios}'
 END
                (nonempty($earlyprintk) ? <<END : '').
        echo >>.config CONFIG_EARLY_PRINTK=$earlyprintk
@@ -147,11 +153,13 @@ END
 
 sub collectversions () {
     my $tools="$builddir/xen/tools";
+    my $extras="$builddir/xen/extras";
     store_revision($ho, 'qemu', "$tools/ioemu-dir", 1);
     store_revision($ho, 'qemu', "$tools/qemu-xen-traditional-dir", 1);
     store_revision($ho, 'qemuu', "$tools/qemu-xen-dir", 1);
     store_revision($ho, 'seabios', "$tools/firmware/seabios-dir", 1);
     store_revision($ho, 'ovmf', "$tools/firmware/ovmf-dir", 1);
+    store_revision($ho, 'minios', "$extras/mini-os", 1);
 }
 
 sub divide () {