UEFI and commissioning fixes
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.
Ian Jackson (10):
Osstest/TestSupport: Use right arch for UEFI grub setup Osstest/Debian: preseed: Force UEFI install regardless README.dev: Fix a typo
README.dev: Discuss setting Firmware for UEFI machines README.dev: Make example commisioning runes use $hn variable Perl @INC path: fix a few more scripts to use BEGIN
mg-anoint: Make readonly operations "work" in standalone mode
mg-anoint: Support mg-anoint retrieve --tolerate-unprepared
mfi-common: set_freebsd_runvars: Never set freebsd_distpath to
`/amd64' etc.
mfi-common: Fall back to anointed builds in Executive mode
Osstest/Debian.pm | 1 + Osstest/JobDB/Executive.pm | 2 ++ Osstest/JobDB/Standalone.pm | 2 ++ Osstest/TestSupport.pm | 4 ++-- README.dev | 21 +++++++++++++-------- mfi-common | 19 ++++++++++++++++--- mg-anoint | 34 ++++++++++++++++++++++++++++++---- ts-examine-hostprops-save | 2 +- ts-freebsd-host-install | 2 +- 9 files changed, 68 insertions(+), 19 deletions(-)
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 1/10 Osstest/TestSupport: Use right arch for UEFI grub setup
--- Osstest/TestSupport.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Osstest/TestSupport.pm +2 -2
@@ -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 2/10 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
@@ -1333,6 +1333,7 @@ d-i partman-auto/disk string $disk d-i partman-ext3/no_mount_point boolean false d-i partman-basicmethods/method_only boolean false +d-i partman-efi/non_efi_system true d-i partman-auto/expert_recipe string \\ boot-root :: \\
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 3/10 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 4/10 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 5/10 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 6/10 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
Re: [OSSTEST PATCH 06/10] Perl @INC path: fix a few more scripts to use BEGIN
Quoted 4 lines · Ian Jackson
Three more files which missed out on
dea987c5ab11"PERLLIB, @INC: Use BEGIN { }"Signed-off-by Ian Jackson <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 7/10 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
Re: [OSSTEST PATCH 07/10] mg-anoint: Make readonly operations "work" in standalone mode
Quoted 4 lines · Ian Jackson
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 <[email protected]>
Thanks.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 8/10 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
Re: [OSSTEST PATCH 08/10] mg-anoint: Support mg-anoint retrieve --tolerate-unprepared
Quoted 3 lines · Ian Jackson
make-*-flight is going to want this.
Signed-off-by Ian Jackson <[email protected]>
Just a style comment below.
Quoted 23 lines
--- mg-anoint | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)mg-anoint +3
-1@@ -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
mg-anoint END · line 303
Quoted 8 lines
mg-anoint +5
-0@@ -294,6 +296,11 @@ END } sub cmd_retrieve { + my $tolerate_unprepared; + if (@ARGV && $ARGV[0] eq '--tolerate-unprepared') { + shift @ARGV; + $tolerate_unprepared = 1; + }
There seems to be a mix between hard and soft tabs in the chunk above (and below).
Thanks.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 9/10 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
Re: [OSSTEST PATCH 09/10] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc.
Quoted 8 lines · Ian Jackson
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.
Quoted 6 lines
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 <[email protected]>
Thanks.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 10/10 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
Re: [OSSTEST PATCH 10/10] mfi-common: Fall back to anointed builds in Executive mode
Quoted 6 lines · Ian Jackson
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 <[email protected]>
LGTM
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel