From 9d50f4f4a82bf4c4d0c6c9e349ab1aa2b77aa408 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 15 Nov 2018 12:06:56 -0800 Subject: [PATCH] Tweak bootloader handling for BLS Now the BLS stuff is enabled in Rawhide, we need to press 'down' a different number of times to reach the 'linux' line when editing the boot params (I really, really wish there was a better way to do this :<). It gets tricky as there are all sorts of cases here (support_server tests use a CURRREL disk image, and then there's upgrade tests)...I think this covers things for now. Signed-off-by: Adam Williamson --- lib/utils.pm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 49c527bc..2c0ba0e9 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -288,9 +288,27 @@ sub do_bootloader { # the count is 12. So we have to do something gross. my $presses = 2; if ($args{postinstall}) { - if (get_var('OFW') || (get_var('ARCH') eq 'aarch64' && get_var('TEST') ne 'support_server')) { + # we need to decide if BLS is in effect...this is fun + my $version = get_var("VERSION"); + # support_server uses a disk image of version CURRREL + $version = get_var("CURRREL") if (get_var('TEST') eq 'support_server'); + # use RAWREL to get a numeric version for Rawhide tests + $version = get_var("RAWREL") if ($version eq 'Rawhide'); + # for upgrade tests, assume 'effective' version is the + # starting version; if BLS migration is applied during + # upgrade this will get REALLY tricky as we'll need to + # switch halfway through... + $version = get_var("CURRREL") if (get_var("TEST") =~ m/^upgrade_/); + $version = get_var("PREVREL") if (get_var("TEST") =~ m/^upgrade_2/); + if ($version > 29) { + # this means 'BLS is active'; it seems that we always + # need 3 presses on all arches with BLS + $presses = 3; + } + elsif (get_var('OFW') || (get_var('ARCH') eq 'aarch64' && get_var('TEST') ne 'support_server')) { $presses = 12; - } else { + } + else { $presses = 13; } }