All of lore.kernel.org
 help / color / mirror / Atom feed
* [OSSTEST PATCH 00/10] UEFI and commissioning fixes
@ 2018-05-17 11:16 Ian Jackson
  2018-05-17 11:16 ` [OSSTEST PATCH 01/10] Osstest/TestSupport: Use right arch for UEFI grub setup Ian Jackson
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Ian Jackson @ 2018-05-17 11:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monné

From: Ian Jackson <Ian.Jackson@eu.citrix.com>

I am trying to commission some new hosts.  These patches fix problems
I encountered.  There are fixes to:

 * Better support UEFI x86 hosts.
 * Improve the commissioning instructions in README.dev.
 * Handle the new FreeBSD anointments system in make-*-flight in
   production (Executive) mode.

Ian Jackson (10):
  Osstest/TestSupport: Use right arch for UEFI grub setup
  Osstest/Debian: preseed: Force UEFI install regardless
  README.dev: Fix a typo
  README.dev: Discuss setting Firmware for UEFI machines
  README.dev: Make example commisioning runes use $hn variable
  Perl @INC path: fix a few more scripts to use BEGIN
  mg-anoint: Make readonly operations "work" in standalone mode
  mg-anoint: Support mg-anoint retrieve --tolerate-unprepared
  mfi-common: set_freebsd_runvars: Never set freebsd_distpath to
    `/amd64' etc.
  mfi-common: Fall back to anointed builds in Executive mode

 Osstest/Debian.pm           |  1 +
 Osstest/JobDB/Executive.pm  |  2 ++
 Osstest/JobDB/Standalone.pm |  2 ++
 Osstest/TestSupport.pm      |  4 ++--
 README.dev                  | 21 +++++++++++++--------
 mfi-common                  | 19 ++++++++++++++++---
 mg-anoint                   | 34 ++++++++++++++++++++++++++++++----
 ts-examine-hostprops-save   |  2 +-
 ts-freebsd-host-install     |  2 +-
 9 files changed, 68 insertions(+), 19 deletions(-)

-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [OSSTEST PATCH 01/10] Osstest/TestSupport: Use right arch for UEFI grub setup
  2018-05-17 11:16 [OSSTEST PATCH 00/10] UEFI and commissioning fixes Ian Jackson
@ 2018-05-17 11:16 ` Ian Jackson
  2018-05-17 11:16 ` [OSSTEST PATCH 02/10] Osstest/Debian: preseed: Force UEFI install regardless Ian Jackson
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Ian Jackson @ 2018-05-17 11:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/TestSupport.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 6d5e667..983bb17 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -2646,8 +2646,8 @@ menuentry 'local' {
   insmod part_gpt
   insmod part_msdos
   set root=(hd0,gpt1)
-  echo "Chainloading (\${root})/EFI/BOOT/BOOTAA64.EFI"
-  chainloader (\${root})/EFI/BOOT/BOOTAA64.EFI
+  echo "Chainloading (\${root})/EFI/BOOT/BOOT$efi.EFI"
+  chainloader (\${root})/EFI/BOOT/BOOT$efi.EFI
   boot
 }
 END
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [OSSTEST PATCH 02/10] Osstest/Debian: preseed: Force UEFI install regardless
  2018-05-17 11:16 [OSSTEST PATCH 00/10] UEFI and commissioning fixes Ian Jackson
  2018-05-17 11:16 ` [OSSTEST PATCH 01/10] Osstest/TestSupport: Use right arch for UEFI grub setup Ian Jackson
@ 2018-05-17 11:16 ` Ian Jackson
  2018-05-17 11:16 ` [OSSTEST PATCH 03/10] README.dev: Fix a typo Ian Jackson
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Ian Jackson @ 2018-05-17 11:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

This suppresses:

   Partition disks
   ---------------

   This machine's firmware has started the installer in UEFI mode but it looks
   like there may be existing operating systems already installed using "BIOS
   compatibility mode". If you continue to install Debian in UEFI mode, it might
   be difficult to reboot the machine into any BIOS-mode operating systems later.

   If you wish to install in UEFI mode and don't care about keeping the ability to
   boot one of the existing systems, you have the option to force that here. If
   you wish to keep the option to boot an existing operating system, you should
   choose NOT to force UEFI installation here.
   Force UEFI installation?
     1: Yes      2: No
     Prompt: '?' for help>

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/Debian.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index b46d222..cbd10d3 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -1333,6 +1333,7 @@ d-i partman-auto/disk string $disk
 
 d-i partman-ext3/no_mount_point boolean false
 d-i partman-basicmethods/method_only boolean false
+d-i partman-efi/non_efi_system true
 
 d-i partman-auto/expert_recipe string					\\
 	boot-root ::							\\
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [OSSTEST PATCH 03/10] README.dev: Fix a typo
  2018-05-17 11:16 [OSSTEST PATCH 00/10] UEFI and commissioning fixes Ian Jackson
  2018-05-17 11:16 ` [OSSTEST PATCH 01/10] Osstest/TestSupport: Use right arch for UEFI grub setup Ian Jackson
  2018-05-17 11:16 ` [OSSTEST PATCH 02/10] Osstest/Debian: preseed: Force UEFI install regardless Ian Jackson
@ 2018-05-17 11:16 ` Ian Jackson
  2018-05-17 11:16 ` [OSSTEST PATCH 04/10] README.dev: Discuss setting Firmware for UEFI machines Ian Jackson
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Ian Jackson @ 2018-05-17 11:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 README.dev | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.dev b/README.dev
index 95fc66c..0f7fccd 100644
--- a/README.dev
+++ b/README.dev
@@ -30,8 +30,8 @@ Keeps running for the duration, so run it in a screen on the osstest VM.
 
 Or you can use mg-allocate.
 
-Commisioning a new machine
-==========================
+Commissioning a new machine
+===========================
 
 Firstly, arrange that it is hooked up to network, serial, and pdu.
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [OSSTEST PATCH 04/10] README.dev: Discuss setting Firmware for UEFI machines
  2018-05-17 11:16 [OSSTEST PATCH 00/10] UEFI and commissioning fixes Ian Jackson
                   ` (2 preceding siblings ...)
  2018-05-17 11:16 ` [OSSTEST PATCH 03/10] README.dev: Fix a typo Ian Jackson
@ 2018-05-17 11:16 ` Ian Jackson
  2018-05-17 11:16 ` [OSSTEST PATCH 05/10] README.dev: Make example commisioning runes use $hn variable Ian Jackson
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Ian Jackson @ 2018-05-17 11:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

This must occur before mknetbootdir, or mknetbootdir does not set
things up for UEFI booting.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 README.dev | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/README.dev b/README.dev
index 0f7fccd..a2b93e0 100644
--- a/README.dev
+++ b/README.dev
@@ -97,7 +97,11 @@ For example, one might need something like this:
 (Many of these things are not needed in Massachusetts as the ansible
 playbook will provide it via an autogenerated config file - see above.)
 
-Create the tftp directory:
+Set the firmware, if it's UEFI:
+
+ $ ./mg-hosts setprops albana{0,1} -- Firmware uefi
+
+Create the tftp directory (must be done after firmware is set):
 
  $ ./mg-hosts mknetbootdir mudcake{0,1}
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [OSSTEST PATCH 05/10] README.dev: Make example commisioning runes use $hn variable
  2018-05-17 11:16 [OSSTEST PATCH 00/10] UEFI and commissioning fixes Ian Jackson
                   ` (3 preceding siblings ...)
  2018-05-17 11:16 ` [OSSTEST PATCH 04/10] README.dev: Discuss setting Firmware for UEFI machines Ian Jackson
@ 2018-05-17 11:16 ` Ian Jackson
  2018-05-17 11:16 ` [OSSTEST PATCH 06/10] Perl @INC path: fix a few more scripts to use BEGIN Ian Jackson
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Ian Jackson @ 2018-05-17 11:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

This makes them better for cutting-and-pasting.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 README.dev | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/README.dev b/README.dev
index a2b93e0..441eee8 100644
--- a/README.dev
+++ b/README.dev
@@ -112,9 +112,10 @@ Firstly, a basic "host examination" that checks that we can install
 and boot Xen:
 
  $ basis=113124   # pick last good xen-unstable or osstest flight
- $ flight=`./make-hosts-flight play xen-unstable blessed-commission-mudcake commission-mudcake $basis`; echo $flight
+ $ hn=mudcake
+ $ flight=`./make-hosts-flight play xen-unstable blessed-commission-$hn commission-$hn $basis`; echo $flight
  113155
- $ ./mg-execute-flight -Bcommission-mudcake -Eian.jackson@citrix.com $flight
+ $ ./mg-execute-flight -Bcommission-$hn -Eian.jackson@citrix.com $flight
 
 This will email the specified address.  The examination should pass,
 completely.  If it does not then you may need to change the BIOS
@@ -130,8 +131,8 @@ right permissions set up.
 If that works, a more thorough test:
 
  $ basis=113124   # pick last good xen-unstable or osstest flight
- $ flight=`./cs-adjust-flight new:commission-mudcake copy $basis`; echo $flight
- $ ./mg-execute-flight -Bcommission-mudcake -Eian.jackson@citrix.com -f$basis $flight
+ $ flight=`./cs-adjust-flight new:commission-$hn copy $basis`; echo $flight
+ $ ./mg-execute-flight -Bcommission-$hn -Eian.jackson@citrix.com -f$basis $flight
 
 This should show no regressions.  (Or, at least, none that are a cause
 for concern.)
@@ -139,7 +140,7 @@ for concern.)
 For a new architecture, there may not be an existing flight with
 suitable jobs.  In that case, something like this can be useful:
 
- $ OSSTEST_BLESSING=commission-mudcake DAILY_BRANCH_PREEXEC_HOOK=false OSSTEST_BASELINES_ONLY=y ./cr-daily-branch xen-unstable
+ $ OSSTEST_BLESSING=commission-$hn DAILY_BRANCH_PREEXEC_HOOK=false OSSTEST_BASELINES_ONLY=y ./cr-daily-branch xen-unstable
 
 You'll need to fish the flight number out of the debug spew.
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [OSSTEST PATCH 06/10] Perl @INC path: fix a few more scripts to use BEGIN
  2018-05-17 11:16 [OSSTEST PATCH 00/10] UEFI and commissioning fixes Ian Jackson
                   ` (4 preceding siblings ...)
  2018-05-17 11:16 ` [OSSTEST PATCH 05/10] README.dev: Make example commisioning runes use $hn variable Ian Jackson
@ 2018-05-17 11:16 ` Ian Jackson
  2018-05-17 12:53   ` Roger Pau Monné
  2018-05-17 11:16 ` [OSSTEST PATCH 07/10] mg-anoint: Make readonly operations "work" in standalone mode Ian Jackson
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 16+ messages in thread
From: Ian Jackson @ 2018-05-17 11:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monné

Three more files which missed out on
  dea987c5ab11 "PERLLIB, @INC: Use BEGIN { }"

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 mg-anoint                 | 2 +-
 ts-examine-hostprops-save | 2 +-
 ts-freebsd-host-install   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mg-anoint b/mg-anoint
index 837e608..b007ab4 100755
--- a/mg-anoint
+++ b/mg-anoint
@@ -63,7 +63,7 @@
 
 use strict qw(vars refs);
 use DBI;
-unshift @INC, qw(.);
+BEGIN { unshift @INC, qw(.); }
 use Osstest;
 use Osstest::TestSupport;
 use Osstest::Executive;
diff --git a/ts-examine-hostprops-save b/ts-examine-hostprops-save
index 188773f..55d2339 100755
--- a/ts-examine-hostprops-save
+++ b/ts-examine-hostprops-save
@@ -19,7 +19,7 @@ use strict qw(vars);
 use DBI;
 use POSIX;
 
-unshift @INC, qw(.);
+BEGIN { unshift @INC, qw(.); }
 use Osstest;
 use Osstest::TestSupport;
 
diff --git a/ts-freebsd-host-install b/ts-freebsd-host-install
index cac8be9..984bdf0 100755
--- a/ts-freebsd-host-install
+++ b/ts-freebsd-host-install
@@ -35,7 +35,7 @@ use strict qw(vars);
 use DBI;
 use POSIX;
 
-unshift @INC, qw(.);
+BEGIN { unshift @INC, qw(.); }
 use Osstest;
 use Osstest::TestSupport;
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [OSSTEST PATCH 07/10] mg-anoint: Make readonly operations "work" in standalone mode
  2018-05-17 11:16 [OSSTEST PATCH 00/10] UEFI and commissioning fixes Ian Jackson
                   ` (5 preceding siblings ...)
  2018-05-17 11:16 ` [OSSTEST PATCH 06/10] Perl @INC path: fix a few more scripts to use BEGIN Ian Jackson
@ 2018-05-17 11:16 ` Ian Jackson
  2018-05-17 14:20   ` Roger Pau Monné
  2018-05-17 11:16 ` [OSSTEST PATCH 08/10] mg-anoint: Support mg-anoint retrieve --tolerate-unprepared Ian Jackson
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 16+ messages in thread
From: Ian Jackson @ 2018-05-17 11:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monné

This makes `mg-anoint' in standalone mode a view onto an empty set of
anointments.  So now it becomes ok to call mg-anoint in make-*-flight.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 Osstest/JobDB/Executive.pm  |  2 ++
 Osstest/JobDB/Standalone.pm |  2 ++
 mg-anoint                   | 20 +++++++++++++++++++-
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index a7a6696..fe8e7f6 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -409,4 +409,6 @@ sub jobdb_db_glob ($$) { #method
     return "LIKE E'$str'";
 }
 
+sub can_anoint ($) { return 1; }
+
 1;
diff --git a/Osstest/JobDB/Standalone.pm b/Osstest/JobDB/Standalone.pm
index d9a90fc..4f320cc 100644
--- a/Osstest/JobDB/Standalone.pm
+++ b/Osstest/JobDB/Standalone.pm
@@ -133,4 +133,6 @@ sub jobdb_db_glob ($) { #method
     return "GLOB '$str'";
 }
 
+sub can_anoint ($) { return 0; }
+
 1;
diff --git a/mg-anoint b/mg-anoint
index b007ab4..522cbdd 100755
--- a/mg-anoint
+++ b/mg-anoint
@@ -66,7 +66,6 @@ use DBI;
 BEGIN { unshift @INC, qw(.); }
 use Osstest;
 use Osstest::TestSupport;
-use Osstest::Executive;
 use IO::Handle;
 use Text::Glob qw(glob_to_regex);
 
@@ -93,6 +92,15 @@ END
 our $task_q;
 our $mostrecent_q;
 
+sub empty_unless_can_anoint () {
+    return if $mjobdb->can_anoint();
+    exit 0;
+}
+sub fail_unless_can_anoint () {
+    return if $mjobdb->can_anoint();
+    die "anointments not supported in this mode ($c{JobDB})\n"
+}
+
 sub prep_queries {
     $task_q = $dbh_tests->prepare(<<END);
         SELECT taskid, refinfo FROM tasks WHERE type='anoint' AND refkey=?
@@ -121,6 +129,9 @@ sub cmd_prepare {
     }
     die "usage: mg-anoint prepare [OPTIONS] 'SCOPE DETAILS...' DESCRIPTION"
 	unless @ARGV==2 || $ARGV[0] =~ m/ /;
+
+    fail_unless_can_anoint();
+
     my ($refkey, $description) = @ARGV;
     my $dq = $dbh_tests->prepare(<<END);
         DELETE FROM tasks WHERE type='anoint' AND refkey=?
@@ -142,6 +153,7 @@ sub cmd_destroy {
     die unless @ARGV==1;
     die if $ARGV[0] =~ m/^-/;
     my ($refkey) = @ARGV;
+    fail_unless_can_anoint();
     my $rdq = $dbh_tests->prepare(<<END);
         DELETE FROM resources
               WHERE restype='share-flight'
@@ -178,6 +190,7 @@ sub cmd_anoint {
     die unless @ARGV==3;
     my ($refkey, $flight, $job) = @ARGV;
 
+    fail_unless_can_anoint();
     prep_queries();
 
     my $newflight_q = $dbh_tests->prepare(<<END);
@@ -285,6 +298,7 @@ sub cmd_retrieve {
     die if $ARGV[0] =~ m/^-/;
     my ($refkey) = @ARGV;
 
+    empty_unless_can_anoint();
     prep_queries();
 
     db_retry($dbh_tests, [], sub {
@@ -307,6 +321,8 @@ sub cmd_retrieve {
 sub cmd_list {
     die "no options to list" if @ARGV;
 
+    empty_unless_can_anoint();
+
     my $tq = $dbh_tests->prepare(<<END);
         SELECT *
           FROM tasks
@@ -347,6 +363,8 @@ sub cmd_list_prepared {
     my ($pat) = @ARGV;
     my $re = glob_to_regex $pat;
 
+    empty_unless_can_anoint();
+
     my $tq = $dbh_tests->prepare(<<END);
         SELECT *
           FROM tasks
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [OSSTEST PATCH 08/10] mg-anoint: Support mg-anoint retrieve --tolerate-unprepared
  2018-05-17 11:16 [OSSTEST PATCH 00/10] UEFI and commissioning fixes Ian Jackson
                   ` (6 preceding siblings ...)
  2018-05-17 11:16 ` [OSSTEST PATCH 07/10] mg-anoint: Make readonly operations "work" in standalone mode Ian Jackson
@ 2018-05-17 11:16 ` Ian Jackson
  2018-05-17 14:22   ` Roger Pau Monné
  2018-05-17 11:16 ` [OSSTEST PATCH 09/10] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc Ian Jackson
  2018-05-17 11:16 ` [OSSTEST PATCH 10/10] mfi-common: Fall back to anointed builds in Executive mode Ian Jackson
  9 siblings, 1 reply; 16+ messages in thread
From: Ian Jackson @ 2018-05-17 11:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monné

make-*-flight is going to want this.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 mg-anoint | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/mg-anoint b/mg-anoint
index 522cbdd..d09124b 100755
--- a/mg-anoint
+++ b/mg-anoint
@@ -15,10 +15,12 @@
 #        --allow-blessed=BLESSING,...       default is from `prepare'
 #        --allow-job-status=STATUS,...      default is only `pass'
 #
-#  ./mg-anoint retrieve REFKEY
+#  ./mg-anoint retrieve [--tolerate-unprepared] REFKEY
 #      => FLIGHT JOB
 #         if nothing anointed yet, prints nothing and exits 0
 #         if anointment not prepared, fails
+#      With --tolerate-unprepared, it is not an error if nothing is
+#      reported because the anointment has not been prepared.
 #
 #  ./mg-anoint list-prepared REFKEY-GLOB
 #      => possibly empty list of REFKEYs
@@ -294,6 +296,11 @@ END
 }    
 
 sub cmd_retrieve {
+    my $tolerate_unprepared;
+    if (@ARGV && $ARGV[0] eq '--tolerate-unprepared') {
+	shift @ARGV;
+	$tolerate_unprepared = 1;
+    }
     die unless @ARGV==1;
     die if $ARGV[0] =~ m/^-/;
     my ($refkey) = @ARGV;
@@ -305,7 +312,8 @@ sub cmd_retrieve {
         @o = ();
         $task_q->execute($refkey);
 	my ($task) = $task_q->fetchrow_array();
-	die "no such anointment kind \`$refkey'" unless defined $task;
+	die "no such anointment kind \`$refkey'"
+	    unless defined $task or $tolerate_unprepared;
 
 	$mostrecent_q->execute($task);
 	my $row = $mostrecent_q->fetchrow_hashref();
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [OSSTEST PATCH 09/10] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc.
  2018-05-17 11:16 [OSSTEST PATCH 00/10] UEFI and commissioning fixes Ian Jackson
                   ` (7 preceding siblings ...)
  2018-05-17 11:16 ` [OSSTEST PATCH 08/10] mg-anoint: Support mg-anoint retrieve --tolerate-unprepared Ian Jackson
@ 2018-05-17 11:16 ` Ian Jackson
  2018-05-17 14:26   ` Roger Pau Monné
  2018-05-17 11:16 ` [OSSTEST PATCH 10/10] mfi-common: Fall back to anointed builds in Executive mode Ian Jackson
  9 siblings, 1 reply; 16+ messages in thread
From: Ian Jackson @ 2018-05-17 11:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monné

Logically, the final branch of the if should be qualified with a check
for the emptiness of FreeBSDDist.  This is awkward in the current
structure, since we really want to do the distpath lookup only if
needed.  (This is not very important right now, but we are about to
add another case which will do a more-likely-to-bomb-out and
more-likely-to-block-on-the-db lookup.)  So refactor into `return'
style.  This lets us introduce local variables in each branch.

Now gate the final branch appropriately.  The overall result is that
if no useful FreeBSD build is found, we simply do not set the
freebsd_* runvars, rather than setting them to wrong values (eg,
`freebsd_distpath=/i386'.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 mfi-common | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/mfi-common b/mfi-common
index cef28ad..17b1b50 100644
--- a/mfi-common
+++ b/mfi-common
@@ -133,14 +133,19 @@ set_freebsd_runvars () {
     local envvar="FREEBSD_${arch^^}_BUILDJOB"
     if [ -n "${!envvar}" ]; then
         freebsd_runvars="freebsdbuildjob=${!envvar}"
-    elif [ -n "$FREEBSD_DIST" ] && [ -n "$FREEBSD_VERSION" ]; then
+        return
+    fi
+    if [ -n "$FREEBSD_DIST" ] && [ -n "$FREEBSD_VERSION" ]; then
         freebsd_runvars="freebsd_distpath=$FREEBSD_DIST/$arch \
                          freebsd_version=$FREEBSD_VERSION"
-    else
-        local distpath=`getconfig "FreeBSDDist"`
+        return
+    fi
+    local distpath=`getconfig "FreeBSDDist"`
+    if [ -n "$distpath" ]; then
         local version=`getconfig "FreeBSDVersion"`
         freebsd_runvars="freebsd_distpath=$distpath/$arch \
                          freebsd_version=$version"
+        return
     fi
 }
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [OSSTEST PATCH 10/10] mfi-common: Fall back to anointed builds in Executive mode
  2018-05-17 11:16 [OSSTEST PATCH 00/10] UEFI and commissioning fixes Ian Jackson
                   ` (8 preceding siblings ...)
  2018-05-17 11:16 ` [OSSTEST PATCH 09/10] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc Ian Jackson
@ 2018-05-17 11:16 ` Ian Jackson
  2018-05-17 14:29   ` Roger Pau Monné
  9 siblings, 1 reply; 16+ messages in thread
From: Ian Jackson @ 2018-05-17 11:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monné

Previously, `make-*-flight' would not work unless FREEBSD_*_BUILDJOB
was set.  Now we use the anointed values if we can find them.

If we can't, mg-anoint retrieve will print a warning.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 mfi-common | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/mfi-common b/mfi-common
index 17b1b50..fddd1ce 100644
--- a/mfi-common
+++ b/mfi-common
@@ -130,6 +130,8 @@ set_freebsd_runvars () {
     # 3. Config file FreeBSDDist, FreeBSDVersion: same as 2. except that
     # they are set on the config file.
     #
+    # 4. Look for an anointed build of FreeBSD `master' (Executive only)
+    #
     local envvar="FREEBSD_${arch^^}_BUILDJOB"
     if [ -n "${!envvar}" ]; then
         freebsd_runvars="freebsdbuildjob=${!envvar}"
@@ -147,6 +149,12 @@ set_freebsd_runvars () {
                          freebsd_version=$version"
         return
     fi
+    local anointment="freebsd build master $arch"
+    local flightjob=`./mg-anoint retrieve --tolerate-unprepared "$anointment"`
+    if [ -n "$flightjob" ]; then
+        freebsd_runvars="freebsdbuildjob=${flightjob/ /.}"
+        return
+    fi
 }
 
 create_build_jobs () {
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [OSSTEST PATCH 06/10] Perl @INC path: fix a few more scripts to use BEGIN
  2018-05-17 11:16 ` [OSSTEST PATCH 06/10] Perl @INC path: fix a few more scripts to use BEGIN Ian Jackson
@ 2018-05-17 12:53   ` Roger Pau Monné
  0 siblings, 0 replies; 16+ messages in thread
From: Roger Pau Monné @ 2018-05-17 12:53 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Thu, May 17, 2018 at 12:16:55PM +0100, Ian Jackson wrote:
> Three more files which missed out on
>   dea987c5ab11 "PERLLIB, @INC: Use BEGIN { }"
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OSSTEST PATCH 07/10] mg-anoint: Make readonly operations "work" in standalone mode
  2018-05-17 11:16 ` [OSSTEST PATCH 07/10] mg-anoint: Make readonly operations "work" in standalone mode Ian Jackson
@ 2018-05-17 14:20   ` Roger Pau Monné
  0 siblings, 0 replies; 16+ messages in thread
From: Roger Pau Monné @ 2018-05-17 14:20 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Thu, May 17, 2018 at 12:16:56PM +0100, Ian Jackson wrote:
> This makes `mg-anoint' in standalone mode a view onto an empty set of
> anointments.  So now it becomes ok to call mg-anoint in make-*-flight.
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OSSTEST PATCH 08/10] mg-anoint: Support mg-anoint retrieve --tolerate-unprepared
  2018-05-17 11:16 ` [OSSTEST PATCH 08/10] mg-anoint: Support mg-anoint retrieve --tolerate-unprepared Ian Jackson
@ 2018-05-17 14:22   ` Roger Pau Monné
  0 siblings, 0 replies; 16+ messages in thread
From: Roger Pau Monné @ 2018-05-17 14:22 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Thu, May 17, 2018 at 12:16:57PM +0100, Ian Jackson wrote:
> make-*-flight is going to want this.
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Just a style comment below.

> ---
>  mg-anoint | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/mg-anoint b/mg-anoint
> index 522cbdd..d09124b 100755
> --- a/mg-anoint
> +++ b/mg-anoint
> @@ -15,10 +15,12 @@
>  #        --allow-blessed=BLESSING,...       default is from `prepare'
>  #        --allow-job-status=STATUS,...      default is only `pass'
>  #
> -#  ./mg-anoint retrieve REFKEY
> +#  ./mg-anoint retrieve [--tolerate-unprepared] REFKEY
>  #      => FLIGHT JOB
>  #         if nothing anointed yet, prints nothing and exits 0
>  #         if anointment not prepared, fails
> +#      With --tolerate-unprepared, it is not an error if nothing is
> +#      reported because the anointment has not been prepared.
>  #
>  #  ./mg-anoint list-prepared REFKEY-GLOB
>  #      => possibly empty list of REFKEYs
> @@ -294,6 +296,11 @@ END
>  }    
>  
>  sub cmd_retrieve {
> +    my $tolerate_unprepared;
> +    if (@ARGV && $ARGV[0] eq '--tolerate-unprepared') {
> +	shift @ARGV;
> +	$tolerate_unprepared = 1;
> +    }

There seems to be a mix between hard and soft tabs in the chunk above
(and below).

Thanks.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OSSTEST PATCH 09/10] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc.
  2018-05-17 11:16 ` [OSSTEST PATCH 09/10] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc Ian Jackson
@ 2018-05-17 14:26   ` Roger Pau Monné
  0 siblings, 0 replies; 16+ messages in thread
From: Roger Pau Monné @ 2018-05-17 14:26 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Thu, May 17, 2018 at 12:16:58PM +0100, Ian Jackson wrote:
> Logically, the final branch of the if should be qualified with a check
> for the emptiness of FreeBSDDist.  This is awkward in the current
> structure, since we really want to do the distpath lookup only if
> needed.  (This is not very important right now, but we are about to
> add another case which will do a more-likely-to-bomb-out and
> more-likely-to-block-on-the-db lookup.)  So refactor into `return'
> style.  This lets us introduce local variables in each branch.
> 
> Now gate the final branch appropriately.  The overall result is that
> if no useful FreeBSD build is found, we simply do not set the
> freebsd_* runvars, rather than setting them to wrong values (eg,
> `freebsd_distpath=/i386'.
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OSSTEST PATCH 10/10] mfi-common: Fall back to anointed builds in Executive mode
  2018-05-17 11:16 ` [OSSTEST PATCH 10/10] mfi-common: Fall back to anointed builds in Executive mode Ian Jackson
@ 2018-05-17 14:29   ` Roger Pau Monné
  0 siblings, 0 replies; 16+ messages in thread
From: Roger Pau Monné @ 2018-05-17 14:29 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Thu, May 17, 2018 at 12:16:59PM +0100, Ian Jackson wrote:
> Previously, `make-*-flight' would not work unless FREEBSD_*_BUILDJOB
> was set.  Now we use the anointed values if we can find them.
> 
> If we can't, mg-anoint retrieve will print a warning.
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

LGTM

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-05-17 14:30 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17 11:16 [OSSTEST PATCH 00/10] UEFI and commissioning fixes Ian Jackson
2018-05-17 11:16 ` [OSSTEST PATCH 01/10] Osstest/TestSupport: Use right arch for UEFI grub setup Ian Jackson
2018-05-17 11:16 ` [OSSTEST PATCH 02/10] Osstest/Debian: preseed: Force UEFI install regardless Ian Jackson
2018-05-17 11:16 ` [OSSTEST PATCH 03/10] README.dev: Fix a typo Ian Jackson
2018-05-17 11:16 ` [OSSTEST PATCH 04/10] README.dev: Discuss setting Firmware for UEFI machines Ian Jackson
2018-05-17 11:16 ` [OSSTEST PATCH 05/10] README.dev: Make example commisioning runes use $hn variable Ian Jackson
2018-05-17 11:16 ` [OSSTEST PATCH 06/10] Perl @INC path: fix a few more scripts to use BEGIN Ian Jackson
2018-05-17 12:53   ` Roger Pau Monné
2018-05-17 11:16 ` [OSSTEST PATCH 07/10] mg-anoint: Make readonly operations "work" in standalone mode Ian Jackson
2018-05-17 14:20   ` Roger Pau Monné
2018-05-17 11:16 ` [OSSTEST PATCH 08/10] mg-anoint: Support mg-anoint retrieve --tolerate-unprepared Ian Jackson
2018-05-17 14:22   ` Roger Pau Monné
2018-05-17 11:16 ` [OSSTEST PATCH 09/10] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc Ian Jackson
2018-05-17 14:26   ` Roger Pau Monné
2018-05-17 11:16 ` [OSSTEST PATCH 10/10] mfi-common: Fall back to anointed builds in Executive mode Ian Jackson
2018-05-17 14:29   ` Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.