UEFI and commissioning fixes
v2 cover UEFI and commissioning fixes
From: Ian Jackson <[email protected]>
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
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 1/23 Osstest/Debian.pm: Remove a spurious `my $kernel'.
This variable is not used, and is shadowed by the one which is initialised a few lines later. This produces a warning.
--- Osstest/Debian.pm | 1 - 1 file changed, 1 deletion(-)
Osstest/Debian.pm +0 -1
@@ -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;
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 2/23 Osstest/TestSupport: Use right arch for UEFI grub setup
In reply to Ian JacksonThis 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.
--- Osstest/TestSupport.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Osstest/TestSupport.pm +3 -3
@@ -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
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 3/23 Osstest/Debian: preseed: Force UEFI install regardless
In reply to Ian JacksonThis 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>
--- Osstest/Debian.pm | 1 + 1 file changed, 1 insertion(+)
Osstest/Debian.pm +1 -0
@@ -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 :: \\
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 4/23 Osstest/Debian: Use X64 bootloader for UEFI i386
In reply to Ian Jackson--- Osstest/TestSupport.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Osstest/TestSupport.pm +4 -1
@@ -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);
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 5/23 README.dev: Fix a typo
In reply to Ian Jackson--- README.dev | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
README.dev +2 -2
@@ -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.
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 6/23 README.dev: Discuss setting Firmware for UEFI machines
In reply to Ian JacksonThis must occur before mknetbootdir, or mknetbootdir does not set things up for UEFI booting.
--- README.dev | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
README.dev +5 -1
@@ -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}
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 8/23 Perl @INC path: fix a few more scripts to use BEGIN
In reply to Ian JacksonThree more files which missed out on
dea987c5ab11 "PERLLIB, @INC: Use BEGIN { }"
--- mg-anoint | 2 +- ts-examine-hostprops-save | 2 +- ts-freebsd-host-install | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
mg-anoint +1 -1
@@ -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;
ts-examine-hostprops-save +1 -1
@@ -19,7 +19,7 @@ use strict qw(vars); use DBI; use POSIX; -unshift @INC, qw(.); +BEGIN { unshift @INC, qw(.); } use Osstest; use Osstest::TestSupport;
ts-freebsd-host-install +1 -1
@@ -35,7 +35,7 @@ use strict qw(vars); use DBI; use POSIX; -unshift @INC, qw(.); +BEGIN { unshift @INC, qw(.); } use Osstest; use Osstest::TestSupport;
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 10/23 mg-anoint: Support mg-anoint retrieve --tolerate-unprepared
In reply to Ian Jacksonmake-*-flight is going to want this.
--- mg-anoint | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
mg-anoint +10 -2
@@ -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();
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 7/23 README.dev: Make example commisioning runes use $hn variable
In reply to Ian JacksonThis makes them better for cutting-and-pasting.
--- README.dev | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
README.dev +6 -5
@@ -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 [email protected] $flight + $ ./mg-execute-flight -Bcommission-$hn [email protected] $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 [email protected] -f$basis $flight + $ flight=`./cs-adjust-flight new:commission-$hn copy $basis`; echo $flight + $ ./mg-execute-flight -Bcommission-$hn [email protected] -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.
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 11/23 mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc.
In reply to Ian JacksonLogically, 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'.
--- mfi-common | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
mfi-common +8 -3
@@ -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 }
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 12/23 mfi-common: Fall back to anointed builds in Executive mode
In reply to Ian JacksonPreviously, `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.
--- mfi-common | 8 ++++++++ 1 file changed, 8 insertions(+)
mfi-common +8 -0
@@ -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 () {
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 13/23 Debian: Pass $ho to debian_overlays
In reply to Ian JacksonNo functional change.
--- Osstest/Debian.pm | 6 +++--- ts-debian-fixup | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
Osstest/Debian.pm +3 -3
@@ -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); });
ts-debian-fixup +1 -1
@@ -192,7 +192,7 @@ savecfg(); ether(); target_kernkind_check($gho); access(); -debian_overlays(\&overlay); +debian_overlays($ho, \&overlay); console(); filesystems(); otherfixupcfg();
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 14/23 Osstest/Debian: bootloader: Ignore `.config' files
In reply to Ian JacksonSome 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.)
--- Osstest/Debian.pm | 3 +++ 1 file changed, 3 insertions(+)
Osstest/Debian.pm +3 -0
@@ -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}..$.;".
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 15/23 Osstest/Debian: bootloader: Understand multiboot2 syntax
In reply to Ian JacksonWe are going to sometimes switch to the multiboot2 protocol, which has different directives with very similar effect.
--- Osstest/Debian.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Osstest/Debian.pm +5 -5
@@ -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; } }
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 16/23 Debian.pm: debian_overlays: Do not make $func callback for nonexistent dirs
In reply to Ian JacksonThis means that it is now OK not to have an `overlay-local'.
--- Osstest/Debian.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
Osstest/Debian.pm +13 -2
@@ -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 ($$$;@) {
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 17/23 Debian.pm: debian_overlays: Internal default for tarball name
In reply to Ian JacksonNo functional change.
--- Osstest/Debian.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Osstest/Debian.pm +2 -1
@@ -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 ($$$;@) {
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 18/23 Debian.pm: debian_overlays: Allow local overlay to override supplied one
In reply to Ian JacksonI think, no change with any reasonable configs.
--- Osstest/Debian.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Osstest/Debian.pm +1 -1
@@ -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 ($$$;@) {
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 19/23 Debian.pm: debian_overlays: Honour suite-specific overlays
In reply to Ian Jackson--- Osstest/Debian.pm | 3 +++ 1 file changed, 3 insertions(+)
Osstest/Debian.pm +3 -0
@@ -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 ($$$;@) {
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 21/23 20_linux_xen: Use multiboot2 when Xen supports it
In reply to Ian JacksonThis 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.
--- 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(-)
overlay-jessie/etc/grub.d/20_linux_xen +10 -4
@@ -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
overlay-stretch/etc/grub.d/20_linux_xen +10 -4
@@ -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
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 22/23 ts-xen-install: Install additional .debs for UEFI
In reply to Ian Jacksongrub2 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.
--- production-config | 5 +++++ ts-xen-install | 11 +++++++++++ 2 files changed, 16 insertions(+)
production-config +5 -0
@@ -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
ts-xen-install +11 -0
@@ -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();
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 23/23 freebsd: Expect a freebsd-10 hostflag for freebsd tests
In reply to Ian JacksonThis will allow us to exclude certain hosts. For example, right now, we have no support for booting FreeBSD on UEFI hosts.
--- make-flight | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
make-flight +1 -1
@@ -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 }
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 20/23 grub: Move 20_linux_xen to suite-specific overlays
In reply to Ian Jacksonstretch still needs some of this, in particular the XSM changes.
--- 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
overlay-jessie/etc/grub.d/20_linux_xen new file +220 -0
@@ -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
overlay-stretch/etc/grub.d/20_linux_xen new file +220 -0
220 lines not on this page · raw message
overlay-wheezy/etc/grub.d/20_linux_xen new file +220 -0
220 lines not on this page · raw message
overlay/etc/grub.d/20_linux_xen deleted +0 -220
220 lines not on this page · raw message
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v2 9/23 mg-anoint: Make readonly operations "work" in standalone mode
In reply to Ian JacksonThis 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.
--- Osstest/JobDB/Executive.pm | 2 ++ Osstest/JobDB/Standalone.pm | 2 ++ mg-anoint | 20 +++++++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-)
Osstest/JobDB/Executive.pm +2 -0
@@ -409,4 +409,6 @@ sub jobdb_db_glob ($$) { #method return "LIKE E'$str'"; } +sub can_anoint ($) { return 1; } + 1;
Osstest/JobDB/Standalone.pm +2 -0
@@ -133,4 +133,6 @@ sub jobdb_db_glob ($) { #method return "GLOB '$str'"; } +sub can_anoint ($) { return 0; } + 1;
mg-anoint +19 -1
@@ -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
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel