All of lore.kernel.org
 help / color / mirror / Atom feed
* [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes
@ 2018-05-23 16:15 Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 01/23] Osstest/Debian.pm: Remove a spurious `my $kernel' Ian Jackson
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 UTC (permalink / raw)
  To: xen-devel; +Cc: Julien Grall, 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.
 * Other bugfixes.

This now mostly works with the two new boxes, so I am going to push it
now and put the machines into service RSN.

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


Ian Jackson (23):
  Osstest/Debian.pm: Remove a spurious `my $kernel'.
  Osstest/TestSupport: Use right arch for UEFI grub setup
  Osstest/Debian: preseed: Force UEFI install regardless
  Osstest/Debian: Use X64 bootloader for UEFI i386
  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
  Debian: Pass $ho to debian_overlays
  Osstest/Debian: bootloader: Ignore `.config' files
  Osstest/Debian: bootloader: Understand multiboot2 syntax
  Debian.pm: debian_overlays: Do not make $func callback for nonexistent
    dirs
  Debian.pm: debian_overlays: Internal default for tarball name
  Debian.pm: debian_overlays: Allow local overlay to override supplied
    one
  Debian.pm: debian_overlays: Honour suite-specific overlays
  grub: Move 20_linux_xen to suite-specific overlays
  20_linux_xen: Use multiboot2 when Xen supports it
  ts-xen-install: Install additional .debs for UEFI
  freebsd: Expect a freebsd-10 hostflag for freebsd tests

 Osstest/Debian.pm                       |  40 ++++--
 Osstest/JobDB/Executive.pm              |   2 +
 Osstest/JobDB/Standalone.pm             |   2 +
 Osstest/TestSupport.pm                  |  11 +-
 README.dev                              |  21 +--
 make-flight                             |   2 +-
 mfi-common                              |  19 ++-
 mg-anoint                               |  34 ++++-
 overlay-jessie/etc/grub.d/20_linux_xen  | 226 ++++++++++++++++++++++++++++++++
 overlay-stretch/etc/grub.d/20_linux_xen | 226 ++++++++++++++++++++++++++++++++
 overlay-wheezy/etc/grub.d/20_linux_xen  | 220 +++++++++++++++++++++++++++++++
 overlay/etc/grub.d/20_linux_xen         | 220 -------------------------------
 production-config                       |   5 +
 ts-debian-fixup                         |   2 +-
 ts-examine-hostprops-save               |   2 +-
 ts-freebsd-host-install                 |   2 +-
 ts-xen-install                          |  11 ++
 17 files changed, 791 insertions(+), 254 deletions(-)
 create mode 100755 overlay-jessie/etc/grub.d/20_linux_xen
 create mode 100755 overlay-stretch/etc/grub.d/20_linux_xen
 create mode 100755 overlay-wheezy/etc/grub.d/20_linux_xen
 delete mode 100755 overlay/etc/grub.d/20_linux_xen

-- 
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] 24+ messages in thread

* [OSSTEST PATCH v2 01/23] Osstest/Debian.pm: Remove a spurious `my $kernel'.
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
@ 2018-05-23 16:15 ` Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 02/23] Osstest/TestSupport: Use right arch for UEFI grub setup Ian Jackson
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

This variable is not used, and is shadowed by the one which is
initialised a few lines later.  This produces a warning.

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

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index b46d222..eafc6cd 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -1063,7 +1063,6 @@ sub di_special_kernel ($$) {
     my $d_i = di_installer_path($ho);
     my $tp = $ho->{Tftp}{Path};
     foreach my $kp (keys %{ $ho->{Flags} }) {
-        my $kernel;
         # Backwards compatibility
         $kp = "need-kernel-deb-wheezy-backports" if $kp eq "need-kernel-deb-armmp";
         $kp =~ s/need-kernel-deb-$ho->{Suite}-// or next;
-- 
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] 24+ messages in thread

* [OSSTEST PATCH v2 02/23] Osstest/TestSupport: Use right arch for UEFI grub setup
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 01/23] Osstest/Debian.pm: Remove a spurious `my $kernel' Ian Jackson
@ 2018-05-23 16:15 ` Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 03/23] Osstest/Debian: preseed: Force UEFI install regardless Ian Jackson
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 UTC (permalink / raw)
  To: xen-devel; +Cc: Julien Grall, Ian Jackson

This table was erroneously never used.  Also, the value for arm64 is
wrong: it should be AA64.  We fix the table value, and substitute it
in, for no overall change on amd64.  On other arches we now do not
hardcode the wrong value.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Julien Grall <julien.grall@linaro.org>
---
 Osstest/TestSupport.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 6d5e667..8f798a3 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -2634,7 +2634,7 @@ sub setup_netboot_local_uefi ($) {
     my ($ho) = @_;
     my %efi_archs = qw(amd64 X64
                        arm32 ARM
-                       arm64 AARCH64
+                       arm64 AA64
                        i386  IA32);
     die "EFI arch" unless $efi_archs{ $r{arch} };
     my $efi = $efi_archs{ $r{arch} };
@@ -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] 24+ messages in thread

* [OSSTEST PATCH v2 03/23] Osstest/Debian: preseed: Force UEFI install regardless
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 01/23] Osstest/Debian.pm: Remove a spurious `my $kernel' Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 02/23] Osstest/TestSupport: Use right arch for UEFI grub setup Ian Jackson
@ 2018-05-23 16:15 ` Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 04/23] Osstest/Debian: Use X64 bootloader for UEFI i386 Ian Jackson
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 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 eafc6cd..2f5135d 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -1332,6 +1332,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] 24+ messages in thread

* [OSSTEST PATCH v2 04/23] Osstest/Debian: Use X64 bootloader for UEFI i386
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (2 preceding siblings ...)
  2018-05-23 16:15 ` [OSSTEST PATCH v2 03/23] Osstest/Debian: preseed: Force UEFI install regardless Ian Jackson
@ 2018-05-23 16:15 ` Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 05/23] README.dev: Fix a typo Ian Jackson
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

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

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 8f798a3..cebeb0d 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -2635,7 +2635,10 @@ sub setup_netboot_local_uefi ($) {
     my %efi_archs = qw(amd64 X64
                        arm32 ARM
                        arm64 AA64
-                       i386  IA32);
+                       i386  X64);
+    # i386 is X64 because when we are trying to install i386
+    # on a UEFI box, it's actually an amd64-capable UEFI box
+    # which expects a 64-bit EFI loader
     die "EFI arch" unless $efi_archs{ $r{arch} };
     my $efi = $efi_archs{ $r{arch} };
     setup_netboot_bootcfg($ho, <<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] 24+ messages in thread

* [OSSTEST PATCH v2 05/23] README.dev: Fix a typo
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (3 preceding siblings ...)
  2018-05-23 16:15 ` [OSSTEST PATCH v2 04/23] Osstest/Debian: Use X64 bootloader for UEFI i386 Ian Jackson
@ 2018-05-23 16:15 ` Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 06/23] README.dev: Discuss setting Firmware for UEFI machines Ian Jackson
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 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 ddfac30..de04b98 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] 24+ messages in thread

* [OSSTEST PATCH v2 06/23] README.dev: Discuss setting Firmware for UEFI machines
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (4 preceding siblings ...)
  2018-05-23 16:15 ` [OSSTEST PATCH v2 05/23] README.dev: Fix a typo Ian Jackson
@ 2018-05-23 16:15 ` Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 07/23] README.dev: Make example commisioning runes use $hn variable Ian Jackson
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 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 de04b98..a2e46f9 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] 24+ messages in thread

* [OSSTEST PATCH v2 07/23] README.dev: Make example commisioning runes use $hn variable
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (5 preceding siblings ...)
  2018-05-23 16:15 ` [OSSTEST PATCH v2 06/23] README.dev: Discuss setting Firmware for UEFI machines Ian Jackson
@ 2018-05-23 16:15 ` Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 08/23] Perl @INC path: fix a few more scripts to use BEGIN Ian Jackson
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 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 a2e46f9..a8bfbb5 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] 24+ messages in thread

* [OSSTEST PATCH v2 08/23] Perl @INC path: fix a few more scripts to use BEGIN
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (6 preceding siblings ...)
  2018-05-23 16:15 ` [OSSTEST PATCH v2 07/23] README.dev: Make example commisioning runes use $hn variable Ian Jackson
@ 2018-05-23 16:15 ` Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 09/23] mg-anoint: Make readonly operations "work" in standalone mode Ian Jackson
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 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] 24+ messages in thread

* [OSSTEST PATCH v2 09/23] mg-anoint: Make readonly operations "work" in standalone mode
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (7 preceding siblings ...)
  2018-05-23 16:15 ` [OSSTEST PATCH v2 08/23] Perl @INC path: fix a few more scripts to use BEGIN Ian Jackson
@ 2018-05-23 16:15 ` Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 10/23] mg-anoint: Support mg-anoint retrieve --tolerate-unprepared Ian Jackson
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 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] 24+ messages in thread

* [OSSTEST PATCH v2 10/23] mg-anoint: Support mg-anoint retrieve --tolerate-unprepared
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (8 preceding siblings ...)
  2018-05-23 16:15 ` [OSSTEST PATCH v2 09/23] mg-anoint: Make readonly operations "work" in standalone mode Ian Jackson
@ 2018-05-23 16:15 ` Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 11/23] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc Ian Jackson
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 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] 24+ messages in thread

* [OSSTEST PATCH v2 11/23] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc.
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (9 preceding siblings ...)
  2018-05-23 16:15 ` [OSSTEST PATCH v2 10/23] mg-anoint: Support mg-anoint retrieve --tolerate-unprepared Ian Jackson
@ 2018-05-23 16:15 ` Ian Jackson
  2018-05-23 16:15 ` [OSSTEST PATCH v2 12/23] mfi-common: Fall back to anointed builds in Executive mode Ian Jackson
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 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] 24+ messages in thread

* [OSSTEST PATCH v2 12/23] mfi-common: Fall back to anointed builds in Executive mode
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (10 preceding siblings ...)
  2018-05-23 16:15 ` [OSSTEST PATCH v2 11/23] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc Ian Jackson
@ 2018-05-23 16:15 ` Ian Jackson
  2018-05-23 16:16 ` [OSSTEST PATCH v2 13/23] Debian: Pass $ho to debian_overlays Ian Jackson
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:15 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] 24+ messages in thread

* [OSSTEST PATCH v2 13/23] Debian: Pass $ho to debian_overlays
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (11 preceding siblings ...)
  2018-05-23 16:15 ` [OSSTEST PATCH v2 12/23] mfi-common: Fall back to anointed builds in Executive mode Ian Jackson
@ 2018-05-23 16:16 ` Ian Jackson
  2018-05-23 16:16 ` [OSSTEST PATCH v2 14/23] Osstest/Debian: bootloader: Ignore `.config' files Ian Jackson
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Osstest/Debian.pm | 6 +++---
 ts-debian-fixup   | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 2f5135d..019893d 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -813,8 +813,8 @@ echo COMPRESS=/usr/sbin/osstest-initramfs-gzip >> \\
 END
 }
 
-sub debian_overlays ($) {
-    my ($func) = @_;
+sub debian_overlays ($$) {
+    my ($ho, $func) = @_;
     $func->($c{OverlayLocal}, 'overlay-local.tar');
     $func->('overlay', 'overlay.tar');
 }
@@ -857,7 +857,7 @@ if [ -f /target$grub ] ; then
 fi
 END
 
-    debian_overlays(sub {
+    debian_overlays($ho, sub {
 	my ($srcdir, $tfilename) = @_;
 	preseed_hook_overlay($ho, $sfx, $srcdir, $tfilename);
     });
diff --git a/ts-debian-fixup b/ts-debian-fixup
index 52a7c5e..3e5cdb9 100755
--- a/ts-debian-fixup
+++ b/ts-debian-fixup
@@ -192,7 +192,7 @@ savecfg();
 ether();
 target_kernkind_check($gho);
 access();
-debian_overlays(\&overlay);
+debian_overlays($ho, \&overlay);
 console();
 filesystems();
 otherfixupcfg();
-- 
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] 24+ messages in thread

* [OSSTEST PATCH v2 14/23] Osstest/Debian: bootloader: Ignore `.config' files
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (12 preceding siblings ...)
  2018-05-23 16:16 ` [OSSTEST PATCH v2 13/23] Debian: Pass $ho to debian_overlays Ian Jackson
@ 2018-05-23 16:16 ` Ian Jackson
  2018-05-23 16:16 ` [OSSTEST PATCH v2 15/23] Osstest/Debian: bootloader: Understand multiboot2 syntax Ian Jackson
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

Some versions of the bootloader scripts will make menu entries for
`.config' files, containing the hypervisor config.  These should be
ignored.

(It is not clear to me, given our 20_linux_xen hack, whether this is
in fact an upstream bug, or a bug in 20_linux_xen.)

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

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 019893d..97d451f 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -476,6 +476,9 @@ sub setupboot_grub2 ($$$$) {
 		} elsif ($entry->{Hv} =~ m/xen-syms/) {
 		    logm("(skipping entry at $entry->{StartLine}..$.;".
 			 " is xen-syms)");
+		} elsif ($entry->{Hv} =~ m/\.config$/) {
+		    logm("(skipping entry at $entry->{StartLine}..$.;".
+			 " is .config)");
 		} elsif (defined $want_kernver &&
 			 $entry->{KernVer} ne $want_kernver) {
 		    logm("(skipping entry at $entry->{StartLine}..$.;".
-- 
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] 24+ messages in thread

* [OSSTEST PATCH v2 15/23] Osstest/Debian: bootloader: Understand multiboot2 syntax
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (13 preceding siblings ...)
  2018-05-23 16:16 ` [OSSTEST PATCH v2 14/23] Osstest/Debian: bootloader: Ignore `.config' files Ian Jackson
@ 2018-05-23 16:16 ` Ian Jackson
  2018-05-23 16:16 ` [OSSTEST PATCH v2 16/23] Debian.pm: debian_overlays: Do not make $func callback for nonexistent dirs Ian Jackson
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

We are going to sometimes switch to the multiboot2 protocol, which has
different directives with very similar effect.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Osstest/Debian.pm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 97d451f..0185761 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -512,27 +512,27 @@ sub setupboot_grub2 ($$$$) {
                 $entry->{Hv}= $1;
                 $entry->{Chainload} = 1;
             }
-            if (m/^\s*multiboot\s*(?:\/boot)?\/(xen\-[0-9][-+.0-9a-z]*\S+)/) {
+            if (m/^\s*multiboot2?\s*(?:\/boot)?\/(xen\-[0-9][-+.0-9a-z]*\S+)/) {
                 die unless $entry;
                 $entry->{Hv}= $1;
                 $entry->{Chainload} = 0;
             }
-            if (m/^\s*multiboot\s*(?:\/boot)?\/(vmlinu[xz]-(\S+))\s+(.*)/) {
+            if (m/^\s*multiboot2?\s*(?:\/boot)?\/(vmlinu[xz]-(\S+))\s+(.*)/) {
                 die unless $entry;
                 $entry->{KernOnly}= $1;
                 $entry->{KernVer}= $2;
                 $entry->{KernOpts}= $3;
             }
-            if (m/^\s*module\s*(?:\/boot)?\/(vmlinu[xz]-(\S+))\s+(.*)/) {
+            if (m/^\s*module2?\s*(?:\/boot)?\/(vmlinu[xz]-(\S+))\s+(.*)/) {
                 die unless $entry;
                 $entry->{KernDom0}= $1;
                 $entry->{KernVer}= $2;
                 $entry->{KernOpts}= $3;
             }
-            if (m/^\s*module\s*(?:\/boot)?\/(initrd\S+)/) {
+            if (m/^\s*module2?\s*(?:\/boot)?\/(initrd\S+)/) {
                 $entry->{Initrd}= $1;
             }
-	    if (m/^\s*module\s*\/(xenpolicy\S+)/) {
+	    if (m/^\s*module2\s*\/(xenpolicy\S+)/) {
                 $entry->{Xenpolicy}= $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] 24+ messages in thread

* [OSSTEST PATCH v2 16/23] Debian.pm: debian_overlays: Do not make $func callback for nonexistent dirs
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (14 preceding siblings ...)
  2018-05-23 16:16 ` [OSSTEST PATCH v2 15/23] Osstest/Debian: bootloader: Understand multiboot2 syntax Ian Jackson
@ 2018-05-23 16:16 ` Ian Jackson
  2018-05-23 16:16 ` [OSSTEST PATCH v2 17/23] Debian.pm: debian_overlays: Internal default for tarball name Ian Jackson
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

This means that it is now OK not to have an `overlay-local'.

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

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 0185761..125d499 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -818,8 +818,19 @@ END
 
 sub debian_overlays ($$) {
     my ($ho, $func) = @_;
-    $func->($c{OverlayLocal}, 'overlay-local.tar');
-    $func->('overlay', 'overlay.tar');
+    # calls $func->($local_dir, $tarball_leafname);
+    my $maybe = sub {
+	my ($local_dir, $tarball_leafname) = @_;
+	if (stat $local_dir) {
+	    $func->($local_dir, $tarball_leafname);
+	} elsif ($! == ENOENT) {
+	    # ok
+	} else {
+	    die "debian_overlays cannot check $local_dir: $!";
+	}
+    };
+    $maybe->($c{OverlayLocal}, 'overlay-local.tar');
+    $maybe->('overlay', 'overlay.tar');
 }
 
 sub preseed_base ($$$;@) {
-- 
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] 24+ messages in thread

* [OSSTEST PATCH v2 17/23] Debian.pm: debian_overlays: Internal default for tarball name
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (15 preceding siblings ...)
  2018-05-23 16:16 ` [OSSTEST PATCH v2 16/23] Debian.pm: debian_overlays: Do not make $func callback for nonexistent dirs Ian Jackson
@ 2018-05-23 16:16 ` Ian Jackson
  2018-05-23 16:16 ` [OSSTEST PATCH v2 18/23] Debian.pm: debian_overlays: Allow local overlay to override supplied one Ian Jackson
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Osstest/Debian.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 125d499..8e72405 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -821,6 +821,7 @@ sub debian_overlays ($$) {
     # calls $func->($local_dir, $tarball_leafname);
     my $maybe = sub {
 	my ($local_dir, $tarball_leafname) = @_;
+	$tarball_leafname //= "$local_dir.tar";
 	if (stat $local_dir) {
 	    $func->($local_dir, $tarball_leafname);
 	} elsif ($! == ENOENT) {
@@ -830,7 +831,7 @@ sub debian_overlays ($$) {
 	}
     };
     $maybe->($c{OverlayLocal}, 'overlay-local.tar');
-    $maybe->('overlay', 'overlay.tar');
+    $maybe->('overlay');
 }
 
 sub preseed_base ($$$;@) {
-- 
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] 24+ messages in thread

* [OSSTEST PATCH v2 18/23] Debian.pm: debian_overlays: Allow local overlay to override supplied one
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (16 preceding siblings ...)
  2018-05-23 16:16 ` [OSSTEST PATCH v2 17/23] Debian.pm: debian_overlays: Internal default for tarball name Ian Jackson
@ 2018-05-23 16:16 ` Ian Jackson
  2018-05-23 16:16 ` [OSSTEST PATCH v2 19/23] Debian.pm: debian_overlays: Honour suite-specific overlays Ian Jackson
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

I think, no change with any reasonable configs.

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

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 8e72405..b9891b6 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -830,8 +830,8 @@ sub debian_overlays ($$) {
 	    die "debian_overlays cannot check $local_dir: $!";
 	}
     };
-    $maybe->($c{OverlayLocal}, 'overlay-local.tar');
     $maybe->('overlay');
+    $maybe->($c{OverlayLocal}, 'overlay-local.tar');
 }
 
 sub preseed_base ($$$;@) {
-- 
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] 24+ messages in thread

* [OSSTEST PATCH v2 19/23] Debian.pm: debian_overlays: Honour suite-specific overlays
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (17 preceding siblings ...)
  2018-05-23 16:16 ` [OSSTEST PATCH v2 18/23] Debian.pm: debian_overlays: Allow local overlay to override supplied one Ian Jackson
@ 2018-05-23 16:16 ` Ian Jackson
  2018-05-23 16:16 ` [OSSTEST PATCH v2 20/23] grub: Move 20_linux_xen to " Ian Jackson
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

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

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index b9891b6..16b47c5 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -830,8 +830,11 @@ sub debian_overlays ($$) {
 	    die "debian_overlays cannot check $local_dir: $!";
 	}
     };
+    my $suite = $ho->{Suite};
     $maybe->('overlay');
+    $maybe->("overlay-$suite");
     $maybe->($c{OverlayLocal}, 'overlay-local.tar');
+    $maybe->("$c{OverlayLocal}-$suite", 'overlay-local-$suite.tar');
 }
 
 sub preseed_base ($$$;@) {
-- 
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] 24+ messages in thread

* [OSSTEST PATCH v2 20/23] grub: Move 20_linux_xen to suite-specific overlays
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (18 preceding siblings ...)
  2018-05-23 16:16 ` [OSSTEST PATCH v2 19/23] Debian.pm: debian_overlays: Honour suite-specific overlays Ian Jackson
@ 2018-05-23 16:16 ` Ian Jackson
  2018-05-23 16:16 ` [OSSTEST PATCH v2 21/23] 20_linux_xen: Use multiboot2 when Xen supports it Ian Jackson
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

stretch still needs some of this, in particular the XSM changes.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 overlay-jessie/etc/grub.d/20_linux_xen  | 220 ++++++++++++++++++++++++++++++++
 overlay-stretch/etc/grub.d/20_linux_xen | 220 ++++++++++++++++++++++++++++++++
 overlay-wheezy/etc/grub.d/20_linux_xen  | 220 ++++++++++++++++++++++++++++++++
 overlay/etc/grub.d/20_linux_xen         | 220 --------------------------------
 4 files changed, 660 insertions(+), 220 deletions(-)
 create mode 100755 overlay-jessie/etc/grub.d/20_linux_xen
 create mode 100755 overlay-stretch/etc/grub.d/20_linux_xen
 create mode 100755 overlay-wheezy/etc/grub.d/20_linux_xen
 delete mode 100755 overlay/etc/grub.d/20_linux_xen

diff --git a/overlay-jessie/etc/grub.d/20_linux_xen b/overlay-jessie/etc/grub.d/20_linux_xen
new file mode 100755
index 0000000..aaead1b
--- /dev/null
+++ b/overlay-jessie/etc/grub.d/20_linux_xen
@@ -0,0 +1,220 @@
+#! /bin/sh
+
+# Copied from the identically named file in grub-common 1.99-27+deb7u2.
+# This version fixes GRUB bug #43420.
+
+set -e
+
+# grub-mkconfig helper script.
+# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
+#
+# GRUB is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GRUB is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+
+prefix="/usr"
+exec_prefix="${prefix}"
+datarootdir="${prefix}/share"
+
+. "${datarootdir}/grub/grub-mkconfig_lib"
+
+export TEXTDOMAIN=grub
+export TEXTDOMAINDIR="${datarootdir}/locale"
+
+CLASS="--class gnu-linux --class gnu --class os --class xen"
+
+if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
+  OS=GNU/Linux
+else
+  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
+fi
+
+# loop-AES arranges things so that /dev/loop/X can be our root device, but
+# the initrds that Linux uses don't like that.
+case ${GRUB_DEVICE} in
+  /dev/loop/*|/dev/loop[0-9])
+    GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
+    # We can't cope with devices loop-mounted from files here.
+    case ${GRUB_DEVICE} in
+      /dev/*) ;;
+      *) exit 0 ;;
+    esac
+  ;;
+esac
+
+if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
+    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
+    || uses_abstraction "${GRUB_DEVICE}" lvm; then
+  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+else
+  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+fi
+
+# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.
+if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE}" ]; then
+  GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX_XEN_REPLACE}"
+fi
+if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" ]; then
+  GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}"
+fi
+
+if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ] \
+    || [ "x`stat -f --printf=%T /`" = xbtrfs ]; then
+  rootsubvol="`make_system_path_relative_to_its_root /`"
+  rootsubvol="${rootsubvol#/}"
+  if [ "x${rootsubvol}" != x ]; then
+    GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
+  fi
+fi
+
+linux_entry ()
+{
+  os="$1"
+  version="$2"
+  xen_version="$3"
+  recovery="$4"
+  args="$5"
+  xen_args="$6"
+  xsm="$7"
+  # If user wants to enable XSM support, make sure there's
+  # corresponding policy file.
+  if ${xsm} ; then
+      xenpolicy=`echo xenpolicy-$xen_version`
+      if test ! -e "${xen_dirname}/${xenpolicy}" ; then
+	  return
+      fi
+      xen_args=`echo $xen_args flask=enforcing`
+      if ${recovery} ; then
+	  title="$(gettext_quoted "%s, with Xen %s (XSM enabled) and Linux %s (recovery mode)")"
+      else
+	  title="$(gettext_quoted "%s, with Xen %s (XSM enabled) and Linux %s")"
+      fi
+  else
+      xenpolicy=""
+      if ${recovery} ; then
+	  title="$(gettext_quoted "%s, with Xen %s and Linux %s (recovery mode)")"
+      else
+	  title="$(gettext_quoted "%s, with Xen %s and Linux %s")"
+      fi
+  fi
+  printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${xen_version}" "${version}"
+  if ! ${recovery} ; then
+      save_default_entry | sed -e "s/^/\t/"
+  fi
+
+  if [ -z "${prepare_boot_cache}" ]; then
+    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
+  fi
+  printf '%s\n' "${prepare_boot_cache}"
+  xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
+  lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
+  cat << EOF
+	echo	'$xmessage'
+	multiboot	${rel_xen_dirname}/${xen_basename} placeholder ${xen_args}
+	echo	'$lmessage'
+	module	${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
+EOF
+  if test -n "${initrd}" ; then
+    message="$(gettext_printf "Loading initial ramdisk ...")"
+    cat << EOF
+	echo	'$message'
+	module	${rel_dirname}/${initrd}
+EOF
+  fi
+  if test -n "${xenpolicy}" ; then
+    message="$(gettext_printf "Loading XSM policy ...")"
+    cat << EOF
+	echo	'$message'
+	module	${rel_dirname}/${xenpolicy}
+EOF
+  fi
+  cat << EOF
+}
+EOF
+}
+
+linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
+    if grub_file_is_not_garbage "$i"; then
+    	basename=$(basename $i)
+	version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
+	dirname=$(dirname $i)
+	config=
+	for j in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
+	    if test -e "${j}" ; then
+		config="${j}"
+		break
+	    fi
+	done
+        if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then echo -n "$i " ; fi
+    fi
+    done`
+if [ "x${linux_list}" = "x" ] ; then
+    exit 0
+fi
+xen_list=`for i in /boot/xen[-.]*; do
+        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+      done`
+prepare_boot_cache=
+
+while [ "x${xen_list}" != "x" ] ; do
+    list="${linux_list}"
+    current_xen=`version_find_latest $xen_list`
+    xen_basename=`basename ${current_xen}`
+    xen_dirname=`dirname ${current_xen}`
+    rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname`
+    xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"`
+    echo "submenu \"Xen ${xen_version}\" {"
+    while [ "x$list" != "x" ] ; do
+	linux=`version_find_latest $list`
+	echo "Found linux image: $linux" >&2
+	basename=`basename $linux`
+	dirname=`dirname $linux`
+	rel_dirname=`make_system_path_relative_to_its_root $dirname`
+	version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
+	alt_version=`echo $version | sed -e "s,\.old$,,g"`
+	linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+
+	initrd=
+	for i in "initrd.img-${version}" "initrd-${version}.img" \
+	    "initrd-${version}" "initrd.img-${alt_version}" \
+	    "initrd-${alt_version}.img" "initrd-${alt_version}" \
+	    "initramfs-genkernel-${version}" \
+	    "initramfs-genkernel-${alt_version}" ; do
+	    if test -e "${dirname}/${i}" ; then
+		initrd="$i"
+		break
+	    fi
+	done
+	if test -n "${initrd}" ; then
+	    echo "Found initrd image: ${dirname}/${initrd}" >&2
+	else
+    # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
+	    linux_root_device_thisversion=${GRUB_DEVICE}
+	fi
+
+	linux_entry "${OS}" "${version}" "${xen_version}" false \
+	    "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}" false
+	linux_entry "${OS}" "${version}" "${xen_version}" false \
+	    "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}" true
+	if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
+	    linux_entry "${OS}" "${version}" "${xen_version}" true \
+		"single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}" false
+	    linux_entry "${OS}" "${version}" "${xen_version}" true \
+		"single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}" true
+	fi
+
+	list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
+    done
+    echo "}"
+    xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $current_xen | tr '\n' ' '`
+done
diff --git a/overlay-stretch/etc/grub.d/20_linux_xen b/overlay-stretch/etc/grub.d/20_linux_xen
new file mode 100755
index 0000000..aaead1b
--- /dev/null
+++ b/overlay-stretch/etc/grub.d/20_linux_xen
@@ -0,0 +1,220 @@
+#! /bin/sh
+
+# Copied from the identically named file in grub-common 1.99-27+deb7u2.
+# This version fixes GRUB bug #43420.
+
+set -e
+
+# grub-mkconfig helper script.
+# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
+#
+# GRUB is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GRUB is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+
+prefix="/usr"
+exec_prefix="${prefix}"
+datarootdir="${prefix}/share"
+
+. "${datarootdir}/grub/grub-mkconfig_lib"
+
+export TEXTDOMAIN=grub
+export TEXTDOMAINDIR="${datarootdir}/locale"
+
+CLASS="--class gnu-linux --class gnu --class os --class xen"
+
+if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
+  OS=GNU/Linux
+else
+  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
+fi
+
+# loop-AES arranges things so that /dev/loop/X can be our root device, but
+# the initrds that Linux uses don't like that.
+case ${GRUB_DEVICE} in
+  /dev/loop/*|/dev/loop[0-9])
+    GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
+    # We can't cope with devices loop-mounted from files here.
+    case ${GRUB_DEVICE} in
+      /dev/*) ;;
+      *) exit 0 ;;
+    esac
+  ;;
+esac
+
+if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
+    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
+    || uses_abstraction "${GRUB_DEVICE}" lvm; then
+  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+else
+  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+fi
+
+# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.
+if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE}" ]; then
+  GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX_XEN_REPLACE}"
+fi
+if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" ]; then
+  GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}"
+fi
+
+if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ] \
+    || [ "x`stat -f --printf=%T /`" = xbtrfs ]; then
+  rootsubvol="`make_system_path_relative_to_its_root /`"
+  rootsubvol="${rootsubvol#/}"
+  if [ "x${rootsubvol}" != x ]; then
+    GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
+  fi
+fi
+
+linux_entry ()
+{
+  os="$1"
+  version="$2"
+  xen_version="$3"
+  recovery="$4"
+  args="$5"
+  xen_args="$6"
+  xsm="$7"
+  # If user wants to enable XSM support, make sure there's
+  # corresponding policy file.
+  if ${xsm} ; then
+      xenpolicy=`echo xenpolicy-$xen_version`
+      if test ! -e "${xen_dirname}/${xenpolicy}" ; then
+	  return
+      fi
+      xen_args=`echo $xen_args flask=enforcing`
+      if ${recovery} ; then
+	  title="$(gettext_quoted "%s, with Xen %s (XSM enabled) and Linux %s (recovery mode)")"
+      else
+	  title="$(gettext_quoted "%s, with Xen %s (XSM enabled) and Linux %s")"
+      fi
+  else
+      xenpolicy=""
+      if ${recovery} ; then
+	  title="$(gettext_quoted "%s, with Xen %s and Linux %s (recovery mode)")"
+      else
+	  title="$(gettext_quoted "%s, with Xen %s and Linux %s")"
+      fi
+  fi
+  printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${xen_version}" "${version}"
+  if ! ${recovery} ; then
+      save_default_entry | sed -e "s/^/\t/"
+  fi
+
+  if [ -z "${prepare_boot_cache}" ]; then
+    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
+  fi
+  printf '%s\n' "${prepare_boot_cache}"
+  xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
+  lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
+  cat << EOF
+	echo	'$xmessage'
+	multiboot	${rel_xen_dirname}/${xen_basename} placeholder ${xen_args}
+	echo	'$lmessage'
+	module	${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
+EOF
+  if test -n "${initrd}" ; then
+    message="$(gettext_printf "Loading initial ramdisk ...")"
+    cat << EOF
+	echo	'$message'
+	module	${rel_dirname}/${initrd}
+EOF
+  fi
+  if test -n "${xenpolicy}" ; then
+    message="$(gettext_printf "Loading XSM policy ...")"
+    cat << EOF
+	echo	'$message'
+	module	${rel_dirname}/${xenpolicy}
+EOF
+  fi
+  cat << EOF
+}
+EOF
+}
+
+linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
+    if grub_file_is_not_garbage "$i"; then
+    	basename=$(basename $i)
+	version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
+	dirname=$(dirname $i)
+	config=
+	for j in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
+	    if test -e "${j}" ; then
+		config="${j}"
+		break
+	    fi
+	done
+        if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then echo -n "$i " ; fi
+    fi
+    done`
+if [ "x${linux_list}" = "x" ] ; then
+    exit 0
+fi
+xen_list=`for i in /boot/xen[-.]*; do
+        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+      done`
+prepare_boot_cache=
+
+while [ "x${xen_list}" != "x" ] ; do
+    list="${linux_list}"
+    current_xen=`version_find_latest $xen_list`
+    xen_basename=`basename ${current_xen}`
+    xen_dirname=`dirname ${current_xen}`
+    rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname`
+    xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"`
+    echo "submenu \"Xen ${xen_version}\" {"
+    while [ "x$list" != "x" ] ; do
+	linux=`version_find_latest $list`
+	echo "Found linux image: $linux" >&2
+	basename=`basename $linux`
+	dirname=`dirname $linux`
+	rel_dirname=`make_system_path_relative_to_its_root $dirname`
+	version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
+	alt_version=`echo $version | sed -e "s,\.old$,,g"`
+	linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+
+	initrd=
+	for i in "initrd.img-${version}" "initrd-${version}.img" \
+	    "initrd-${version}" "initrd.img-${alt_version}" \
+	    "initrd-${alt_version}.img" "initrd-${alt_version}" \
+	    "initramfs-genkernel-${version}" \
+	    "initramfs-genkernel-${alt_version}" ; do
+	    if test -e "${dirname}/${i}" ; then
+		initrd="$i"
+		break
+	    fi
+	done
+	if test -n "${initrd}" ; then
+	    echo "Found initrd image: ${dirname}/${initrd}" >&2
+	else
+    # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
+	    linux_root_device_thisversion=${GRUB_DEVICE}
+	fi
+
+	linux_entry "${OS}" "${version}" "${xen_version}" false \
+	    "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}" false
+	linux_entry "${OS}" "${version}" "${xen_version}" false \
+	    "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}" true
+	if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
+	    linux_entry "${OS}" "${version}" "${xen_version}" true \
+		"single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}" false
+	    linux_entry "${OS}" "${version}" "${xen_version}" true \
+		"single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}" true
+	fi
+
+	list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
+    done
+    echo "}"
+    xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $current_xen | tr '\n' ' '`
+done
diff --git a/overlay-wheezy/etc/grub.d/20_linux_xen b/overlay-wheezy/etc/grub.d/20_linux_xen
new file mode 100755
index 0000000..aaead1b
--- /dev/null
+++ b/overlay-wheezy/etc/grub.d/20_linux_xen
@@ -0,0 +1,220 @@
+#! /bin/sh
+
+# Copied from the identically named file in grub-common 1.99-27+deb7u2.
+# This version fixes GRUB bug #43420.
+
+set -e
+
+# grub-mkconfig helper script.
+# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
+#
+# GRUB is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GRUB is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+
+prefix="/usr"
+exec_prefix="${prefix}"
+datarootdir="${prefix}/share"
+
+. "${datarootdir}/grub/grub-mkconfig_lib"
+
+export TEXTDOMAIN=grub
+export TEXTDOMAINDIR="${datarootdir}/locale"
+
+CLASS="--class gnu-linux --class gnu --class os --class xen"
+
+if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
+  OS=GNU/Linux
+else
+  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
+fi
+
+# loop-AES arranges things so that /dev/loop/X can be our root device, but
+# the initrds that Linux uses don't like that.
+case ${GRUB_DEVICE} in
+  /dev/loop/*|/dev/loop[0-9])
+    GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
+    # We can't cope with devices loop-mounted from files here.
+    case ${GRUB_DEVICE} in
+      /dev/*) ;;
+      *) exit 0 ;;
+    esac
+  ;;
+esac
+
+if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
+    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
+    || uses_abstraction "${GRUB_DEVICE}" lvm; then
+  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+else
+  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+fi
+
+# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.
+if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE}" ]; then
+  GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX_XEN_REPLACE}"
+fi
+if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" ]; then
+  GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}"
+fi
+
+if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ] \
+    || [ "x`stat -f --printf=%T /`" = xbtrfs ]; then
+  rootsubvol="`make_system_path_relative_to_its_root /`"
+  rootsubvol="${rootsubvol#/}"
+  if [ "x${rootsubvol}" != x ]; then
+    GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
+  fi
+fi
+
+linux_entry ()
+{
+  os="$1"
+  version="$2"
+  xen_version="$3"
+  recovery="$4"
+  args="$5"
+  xen_args="$6"
+  xsm="$7"
+  # If user wants to enable XSM support, make sure there's
+  # corresponding policy file.
+  if ${xsm} ; then
+      xenpolicy=`echo xenpolicy-$xen_version`
+      if test ! -e "${xen_dirname}/${xenpolicy}" ; then
+	  return
+      fi
+      xen_args=`echo $xen_args flask=enforcing`
+      if ${recovery} ; then
+	  title="$(gettext_quoted "%s, with Xen %s (XSM enabled) and Linux %s (recovery mode)")"
+      else
+	  title="$(gettext_quoted "%s, with Xen %s (XSM enabled) and Linux %s")"
+      fi
+  else
+      xenpolicy=""
+      if ${recovery} ; then
+	  title="$(gettext_quoted "%s, with Xen %s and Linux %s (recovery mode)")"
+      else
+	  title="$(gettext_quoted "%s, with Xen %s and Linux %s")"
+      fi
+  fi
+  printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${xen_version}" "${version}"
+  if ! ${recovery} ; then
+      save_default_entry | sed -e "s/^/\t/"
+  fi
+
+  if [ -z "${prepare_boot_cache}" ]; then
+    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
+  fi
+  printf '%s\n' "${prepare_boot_cache}"
+  xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
+  lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
+  cat << EOF
+	echo	'$xmessage'
+	multiboot	${rel_xen_dirname}/${xen_basename} placeholder ${xen_args}
+	echo	'$lmessage'
+	module	${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
+EOF
+  if test -n "${initrd}" ; then
+    message="$(gettext_printf "Loading initial ramdisk ...")"
+    cat << EOF
+	echo	'$message'
+	module	${rel_dirname}/${initrd}
+EOF
+  fi
+  if test -n "${xenpolicy}" ; then
+    message="$(gettext_printf "Loading XSM policy ...")"
+    cat << EOF
+	echo	'$message'
+	module	${rel_dirname}/${xenpolicy}
+EOF
+  fi
+  cat << EOF
+}
+EOF
+}
+
+linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
+    if grub_file_is_not_garbage "$i"; then
+    	basename=$(basename $i)
+	version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
+	dirname=$(dirname $i)
+	config=
+	for j in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
+	    if test -e "${j}" ; then
+		config="${j}"
+		break
+	    fi
+	done
+        if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then echo -n "$i " ; fi
+    fi
+    done`
+if [ "x${linux_list}" = "x" ] ; then
+    exit 0
+fi
+xen_list=`for i in /boot/xen[-.]*; do
+        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+      done`
+prepare_boot_cache=
+
+while [ "x${xen_list}" != "x" ] ; do
+    list="${linux_list}"
+    current_xen=`version_find_latest $xen_list`
+    xen_basename=`basename ${current_xen}`
+    xen_dirname=`dirname ${current_xen}`
+    rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname`
+    xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"`
+    echo "submenu \"Xen ${xen_version}\" {"
+    while [ "x$list" != "x" ] ; do
+	linux=`version_find_latest $list`
+	echo "Found linux image: $linux" >&2
+	basename=`basename $linux`
+	dirname=`dirname $linux`
+	rel_dirname=`make_system_path_relative_to_its_root $dirname`
+	version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
+	alt_version=`echo $version | sed -e "s,\.old$,,g"`
+	linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+
+	initrd=
+	for i in "initrd.img-${version}" "initrd-${version}.img" \
+	    "initrd-${version}" "initrd.img-${alt_version}" \
+	    "initrd-${alt_version}.img" "initrd-${alt_version}" \
+	    "initramfs-genkernel-${version}" \
+	    "initramfs-genkernel-${alt_version}" ; do
+	    if test -e "${dirname}/${i}" ; then
+		initrd="$i"
+		break
+	    fi
+	done
+	if test -n "${initrd}" ; then
+	    echo "Found initrd image: ${dirname}/${initrd}" >&2
+	else
+    # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
+	    linux_root_device_thisversion=${GRUB_DEVICE}
+	fi
+
+	linux_entry "${OS}" "${version}" "${xen_version}" false \
+	    "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}" false
+	linux_entry "${OS}" "${version}" "${xen_version}" false \
+	    "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}" true
+	if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
+	    linux_entry "${OS}" "${version}" "${xen_version}" true \
+		"single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}" false
+	    linux_entry "${OS}" "${version}" "${xen_version}" true \
+		"single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}" true
+	fi
+
+	list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
+    done
+    echo "}"
+    xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $current_xen | tr '\n' ' '`
+done
diff --git a/overlay/etc/grub.d/20_linux_xen b/overlay/etc/grub.d/20_linux_xen
deleted file mode 100755
index aaead1b..0000000
--- a/overlay/etc/grub.d/20_linux_xen
+++ /dev/null
@@ -1,220 +0,0 @@
-#! /bin/sh
-
-# Copied from the identically named file in grub-common 1.99-27+deb7u2.
-# This version fixes GRUB bug #43420.
-
-set -e
-
-# grub-mkconfig helper script.
-# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
-#
-# GRUB is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# GRUB is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
-
-prefix="/usr"
-exec_prefix="${prefix}"
-datarootdir="${prefix}/share"
-
-. "${datarootdir}/grub/grub-mkconfig_lib"
-
-export TEXTDOMAIN=grub
-export TEXTDOMAINDIR="${datarootdir}/locale"
-
-CLASS="--class gnu-linux --class gnu --class os --class xen"
-
-if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
-  OS=GNU/Linux
-else
-  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
-  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
-fi
-
-# loop-AES arranges things so that /dev/loop/X can be our root device, but
-# the initrds that Linux uses don't like that.
-case ${GRUB_DEVICE} in
-  /dev/loop/*|/dev/loop[0-9])
-    GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
-    # We can't cope with devices loop-mounted from files here.
-    case ${GRUB_DEVICE} in
-      /dev/*) ;;
-      *) exit 0 ;;
-    esac
-  ;;
-esac
-
-if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
-    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
-    || uses_abstraction "${GRUB_DEVICE}" lvm; then
-  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
-else
-  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
-fi
-
-# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.
-if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE}" ]; then
-  GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX_XEN_REPLACE}"
-fi
-if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" ]; then
-  GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}"
-fi
-
-if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ] \
-    || [ "x`stat -f --printf=%T /`" = xbtrfs ]; then
-  rootsubvol="`make_system_path_relative_to_its_root /`"
-  rootsubvol="${rootsubvol#/}"
-  if [ "x${rootsubvol}" != x ]; then
-    GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
-  fi
-fi
-
-linux_entry ()
-{
-  os="$1"
-  version="$2"
-  xen_version="$3"
-  recovery="$4"
-  args="$5"
-  xen_args="$6"
-  xsm="$7"
-  # If user wants to enable XSM support, make sure there's
-  # corresponding policy file.
-  if ${xsm} ; then
-      xenpolicy=`echo xenpolicy-$xen_version`
-      if test ! -e "${xen_dirname}/${xenpolicy}" ; then
-	  return
-      fi
-      xen_args=`echo $xen_args flask=enforcing`
-      if ${recovery} ; then
-	  title="$(gettext_quoted "%s, with Xen %s (XSM enabled) and Linux %s (recovery mode)")"
-      else
-	  title="$(gettext_quoted "%s, with Xen %s (XSM enabled) and Linux %s")"
-      fi
-  else
-      xenpolicy=""
-      if ${recovery} ; then
-	  title="$(gettext_quoted "%s, with Xen %s and Linux %s (recovery mode)")"
-      else
-	  title="$(gettext_quoted "%s, with Xen %s and Linux %s")"
-      fi
-  fi
-  printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${xen_version}" "${version}"
-  if ! ${recovery} ; then
-      save_default_entry | sed -e "s/^/\t/"
-  fi
-
-  if [ -z "${prepare_boot_cache}" ]; then
-    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
-  fi
-  printf '%s\n' "${prepare_boot_cache}"
-  xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
-  lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
-  cat << EOF
-	echo	'$xmessage'
-	multiboot	${rel_xen_dirname}/${xen_basename} placeholder ${xen_args}
-	echo	'$lmessage'
-	module	${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
-EOF
-  if test -n "${initrd}" ; then
-    message="$(gettext_printf "Loading initial ramdisk ...")"
-    cat << EOF
-	echo	'$message'
-	module	${rel_dirname}/${initrd}
-EOF
-  fi
-  if test -n "${xenpolicy}" ; then
-    message="$(gettext_printf "Loading XSM policy ...")"
-    cat << EOF
-	echo	'$message'
-	module	${rel_dirname}/${xenpolicy}
-EOF
-  fi
-  cat << EOF
-}
-EOF
-}
-
-linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
-    if grub_file_is_not_garbage "$i"; then
-    	basename=$(basename $i)
-	version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
-	dirname=$(dirname $i)
-	config=
-	for j in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
-	    if test -e "${j}" ; then
-		config="${j}"
-		break
-	    fi
-	done
-        if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then echo -n "$i " ; fi
-    fi
-    done`
-if [ "x${linux_list}" = "x" ] ; then
-    exit 0
-fi
-xen_list=`for i in /boot/xen[-.]*; do
-        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
-      done`
-prepare_boot_cache=
-
-while [ "x${xen_list}" != "x" ] ; do
-    list="${linux_list}"
-    current_xen=`version_find_latest $xen_list`
-    xen_basename=`basename ${current_xen}`
-    xen_dirname=`dirname ${current_xen}`
-    rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname`
-    xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"`
-    echo "submenu \"Xen ${xen_version}\" {"
-    while [ "x$list" != "x" ] ; do
-	linux=`version_find_latest $list`
-	echo "Found linux image: $linux" >&2
-	basename=`basename $linux`
-	dirname=`dirname $linux`
-	rel_dirname=`make_system_path_relative_to_its_root $dirname`
-	version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
-	alt_version=`echo $version | sed -e "s,\.old$,,g"`
-	linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
-
-	initrd=
-	for i in "initrd.img-${version}" "initrd-${version}.img" \
-	    "initrd-${version}" "initrd.img-${alt_version}" \
-	    "initrd-${alt_version}.img" "initrd-${alt_version}" \
-	    "initramfs-genkernel-${version}" \
-	    "initramfs-genkernel-${alt_version}" ; do
-	    if test -e "${dirname}/${i}" ; then
-		initrd="$i"
-		break
-	    fi
-	done
-	if test -n "${initrd}" ; then
-	    echo "Found initrd image: ${dirname}/${initrd}" >&2
-	else
-    # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
-	    linux_root_device_thisversion=${GRUB_DEVICE}
-	fi
-
-	linux_entry "${OS}" "${version}" "${xen_version}" false \
-	    "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}" false
-	linux_entry "${OS}" "${version}" "${xen_version}" false \
-	    "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}" true
-	if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
-	    linux_entry "${OS}" "${version}" "${xen_version}" true \
-		"single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}" false
-	    linux_entry "${OS}" "${version}" "${xen_version}" true \
-		"single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}" true
-	fi
-
-	list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
-    done
-    echo "}"
-    xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $current_xen | tr '\n' ' '`
-done
-- 
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] 24+ messages in thread

* [OSSTEST PATCH v2 21/23] 20_linux_xen: Use multiboot2 when Xen supports it
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (19 preceding siblings ...)
  2018-05-23 16:16 ` [OSSTEST PATCH v2 20/23] grub: Move 20_linux_xen to " Ian Jackson
@ 2018-05-23 16:16 ` Ian Jackson
  2018-05-23 16:16 ` [OSSTEST PATCH v2 22/23] ts-xen-install: Install additional .debs for UEFI Ian Jackson
  2018-05-23 16:16 ` [OSSTEST PATCH v2 23/23] freebsd: Expect a freebsd-10 hostflag for freebsd tests Ian Jackson
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

This is necessary for UEFI.  The patch is similar in spirit to the
upstream commit
  http://git.savannah.gnu.org/cgit/grub.git/commit/?id=b4d709b6ee789cdaf3fa7a80fd90c721a16f48c2

A backport of that commit to Debian buster was requested in
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=898947
so hopefully this will not be necessary after stretch.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 overlay-jessie/etc/grub.d/20_linux_xen  | 14 ++++++++++----
 overlay-stretch/etc/grub.d/20_linux_xen | 14 ++++++++++----
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/overlay-jessie/etc/grub.d/20_linux_xen b/overlay-jessie/etc/grub.d/20_linux_xen
index aaead1b..885f204 100755
--- a/overlay-jessie/etc/grub.d/20_linux_xen
+++ b/overlay-jessie/etc/grub.d/20_linux_xen
@@ -118,24 +118,30 @@ linux_entry ()
   printf '%s\n' "${prepare_boot_cache}"
   xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
   lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
+  xen_loader=multiboot
+  xen_module=module
+  if grub-file --is-x86-multiboot2 $current_xen; then
+    xen_loader=multiboot2
+    xen_module=module2
+  fi
   cat << EOF
 	echo	'$xmessage'
-	multiboot	${rel_xen_dirname}/${xen_basename} placeholder ${xen_args}
+	$xen_loader	${rel_xen_dirname}/${xen_basename} placeholder ${xen_args}
 	echo	'$lmessage'
-	module	${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
+	$xen_module	${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
 EOF
   if test -n "${initrd}" ; then
     message="$(gettext_printf "Loading initial ramdisk ...")"
     cat << EOF
 	echo	'$message'
-	module	${rel_dirname}/${initrd}
+	$xen_module	${rel_dirname}/${initrd}
 EOF
   fi
   if test -n "${xenpolicy}" ; then
     message="$(gettext_printf "Loading XSM policy ...")"
     cat << EOF
 	echo	'$message'
-	module	${rel_dirname}/${xenpolicy}
+	$xen_module	${rel_dirname}/${xenpolicy}
 EOF
   fi
   cat << EOF
diff --git a/overlay-stretch/etc/grub.d/20_linux_xen b/overlay-stretch/etc/grub.d/20_linux_xen
index aaead1b..885f204 100755
--- a/overlay-stretch/etc/grub.d/20_linux_xen
+++ b/overlay-stretch/etc/grub.d/20_linux_xen
@@ -118,24 +118,30 @@ linux_entry ()
   printf '%s\n' "${prepare_boot_cache}"
   xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
   lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
+  xen_loader=multiboot
+  xen_module=module
+  if grub-file --is-x86-multiboot2 $current_xen; then
+    xen_loader=multiboot2
+    xen_module=module2
+  fi
   cat << EOF
 	echo	'$xmessage'
-	multiboot	${rel_xen_dirname}/${xen_basename} placeholder ${xen_args}
+	$xen_loader	${rel_xen_dirname}/${xen_basename} placeholder ${xen_args}
 	echo	'$lmessage'
-	module	${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
+	$xen_module	${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
 EOF
   if test -n "${initrd}" ; then
     message="$(gettext_printf "Loading initial ramdisk ...")"
     cat << EOF
 	echo	'$message'
-	module	${rel_dirname}/${initrd}
+	$xen_module	${rel_dirname}/${initrd}
 EOF
   fi
   if test -n "${xenpolicy}" ; then
     message="$(gettext_printf "Loading XSM policy ...")"
     cat << EOF
 	echo	'$message'
-	module	${rel_dirname}/${xenpolicy}
+	$xen_module	${rel_dirname}/${xenpolicy}
 EOF
   fi
   cat << EOF
-- 
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] 24+ messages in thread

* [OSSTEST PATCH v2 22/23] ts-xen-install: Install additional .debs for UEFI
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (20 preceding siblings ...)
  2018-05-23 16:16 ` [OSSTEST PATCH v2 21/23] 20_linux_xen: Use multiboot2 when Xen supports it Ian Jackson
@ 2018-05-23 16:16 ` Ian Jackson
  2018-05-23 16:16 ` [OSSTEST PATCH v2 23/23] freebsd: Expect a freebsd-10 hostflag for freebsd tests Ian Jackson
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

grub2 from stretch cannot boot Xen under UEFI.  But that from buster
can, and it can be simply installed, even on jessie.  So do that.

I have copied the binaries for 2.02+dfsg1-4 to
images/grub2-uefi-amd64-2018-04-01 in Massachusetts.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 production-config |  5 +++++
 ts-xen-install    | 11 +++++++++++
 2 files changed, 16 insertions(+)

diff --git a/production-config b/production-config
index e1c437b..aa414d0 100644
--- a/production-config
+++ b/production-config
@@ -106,6 +106,11 @@ MicrocodeUpdateI386 microcode.x86.2015-06-12.cpio
 # Update with ./mg-netgrub-loader-update
 TftpGrubVersion XXXX-XX-XX
 
+ExtraDebs_uefi_i386_jessie   2018-04-01
+ExtraDebs_uefi_amd64_jessie  2018-04-01
+ExtraDebs_uefi_i386_stretch  2018-04-01
+ExtraDebs_uefi_amd64_stretch 2018-04-01
+
 XenUsePath /usr/groups/xencore/systems/bin/xenuse
 XenUseUser osstest
 
diff --git a/ts-xen-install b/ts-xen-install
index fa7d7db..a9f8631 100755
--- a/ts-xen-install
+++ b/ts-xen-install
@@ -72,6 +72,16 @@ sub packages () {
         if toolstack($ho)->{ExtraPackages};
 }
 
+sub extradebs () {
+    my $firmware = get_host_property($ho, "firmware", "bios");
+    my $version = $c{ "ExtraDebs_${firmware}_$r{arch}_$ho->{Suite}" };
+    return unless $version;
+    target_install_packages($ho, 'rsync');
+    my $extradebs = "$c{Images}/extradebs-$firmware-$r{arch}-$version";
+    target_putfile_root($ho,300, "$extradebs/.", 'extradebs', '-r');
+    target_cmd_root($ho,"dpkg --force-confold -iGROEB extradebs </dev/null",300);
+}
+
 sub extract () {
     my @parts = ('', 'kern', 'xen');
     push @parts, 'libvirt' if $r{toolstack} eq "libvirt";
@@ -369,6 +379,7 @@ if ($checkmode) {
     $ho= $hos[0];
     
     packages();
+    extradebs();
     extract();
     forbidden();
     adjustconfig();
-- 
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] 24+ messages in thread

* [OSSTEST PATCH v2 23/23] freebsd: Expect a freebsd-10 hostflag for freebsd tests
  2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
                   ` (21 preceding siblings ...)
  2018-05-23 16:16 ` [OSSTEST PATCH v2 22/23] ts-xen-install: Install additional .debs for UEFI Ian Jackson
@ 2018-05-23 16:16 ` Ian Jackson
  22 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-05-23 16:16 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monné

This will allow us to exclude certain hosts.  For example, right now,
we have no support for booting FreeBSD on UEFI hosts.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 make-flight | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/make-flight b/make-flight
index 6b53c94..22dedf2 100755
--- a/make-flight
+++ b/make-flight
@@ -262,7 +262,7 @@ do_freebsd_tests () {
                         test-freebsd xl $xenarch $dom0arch \
                         freebsd_arch=$freebsdarch \
  freebsd_image=${FREEBSD_IMAGE_PREFIX-FreeBSD-10.1-CUSTOM-}$freebsdarch${FREEBSD_IMAGE_SUFFIX--20150525.raw.xz} \
-                        all_hostflags=$most_hostflags
+                        all_hostflags=$most_hostflags,freebsd-10
 
   done
 }
-- 
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] 24+ messages in thread

end of thread, other threads:[~2018-05-23 16:20 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23 16:15 [OSSTEST PATCH v2 00/23] UEFI and commissioning fixes Ian Jackson
2018-05-23 16:15 ` [OSSTEST PATCH v2 01/23] Osstest/Debian.pm: Remove a spurious `my $kernel' Ian Jackson
2018-05-23 16:15 ` [OSSTEST PATCH v2 02/23] Osstest/TestSupport: Use right arch for UEFI grub setup Ian Jackson
2018-05-23 16:15 ` [OSSTEST PATCH v2 03/23] Osstest/Debian: preseed: Force UEFI install regardless Ian Jackson
2018-05-23 16:15 ` [OSSTEST PATCH v2 04/23] Osstest/Debian: Use X64 bootloader for UEFI i386 Ian Jackson
2018-05-23 16:15 ` [OSSTEST PATCH v2 05/23] README.dev: Fix a typo Ian Jackson
2018-05-23 16:15 ` [OSSTEST PATCH v2 06/23] README.dev: Discuss setting Firmware for UEFI machines Ian Jackson
2018-05-23 16:15 ` [OSSTEST PATCH v2 07/23] README.dev: Make example commisioning runes use $hn variable Ian Jackson
2018-05-23 16:15 ` [OSSTEST PATCH v2 08/23] Perl @INC path: fix a few more scripts to use BEGIN Ian Jackson
2018-05-23 16:15 ` [OSSTEST PATCH v2 09/23] mg-anoint: Make readonly operations "work" in standalone mode Ian Jackson
2018-05-23 16:15 ` [OSSTEST PATCH v2 10/23] mg-anoint: Support mg-anoint retrieve --tolerate-unprepared Ian Jackson
2018-05-23 16:15 ` [OSSTEST PATCH v2 11/23] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc Ian Jackson
2018-05-23 16:15 ` [OSSTEST PATCH v2 12/23] mfi-common: Fall back to anointed builds in Executive mode Ian Jackson
2018-05-23 16:16 ` [OSSTEST PATCH v2 13/23] Debian: Pass $ho to debian_overlays Ian Jackson
2018-05-23 16:16 ` [OSSTEST PATCH v2 14/23] Osstest/Debian: bootloader: Ignore `.config' files Ian Jackson
2018-05-23 16:16 ` [OSSTEST PATCH v2 15/23] Osstest/Debian: bootloader: Understand multiboot2 syntax Ian Jackson
2018-05-23 16:16 ` [OSSTEST PATCH v2 16/23] Debian.pm: debian_overlays: Do not make $func callback for nonexistent dirs Ian Jackson
2018-05-23 16:16 ` [OSSTEST PATCH v2 17/23] Debian.pm: debian_overlays: Internal default for tarball name Ian Jackson
2018-05-23 16:16 ` [OSSTEST PATCH v2 18/23] Debian.pm: debian_overlays: Allow local overlay to override supplied one Ian Jackson
2018-05-23 16:16 ` [OSSTEST PATCH v2 19/23] Debian.pm: debian_overlays: Honour suite-specific overlays Ian Jackson
2018-05-23 16:16 ` [OSSTEST PATCH v2 20/23] grub: Move 20_linux_xen to " Ian Jackson
2018-05-23 16:16 ` [OSSTEST PATCH v2 21/23] 20_linux_xen: Use multiboot2 when Xen supports it Ian Jackson
2018-05-23 16:16 ` [OSSTEST PATCH v2 22/23] ts-xen-install: Install additional .debs for UEFI Ian Jackson
2018-05-23 16:16 ` [OSSTEST PATCH v2 23/23] freebsd: Expect a freebsd-10 hostflag for freebsd tests Ian Jackson

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.