Received: by 2002:a17:90a:2044:0:0:0:0 with SMTP id n62csp1138999pjc; Thu, 9 May 2019 14:39:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyexatlwd767zb4zfwt5I875lWgtSuFww6DXy+86OO9XemWJgF9uq+/gQIkZWXylaIjfkA1 X-Received: by 2002:a62:d244:: with SMTP id c65mr8602169pfg.173.1557437971528; Thu, 09 May 2019 14:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557437971; cv=none; d=google.com; s=arc-20160816; b=O8CoTK6PJzKlKTl6Dot7eFSZgMYCX+JVfPttQyGW1rCRrInE9ZVOXEZYe+ImXlQvjt 8k1aRFT/8Jog6yDQzm87F/UIb4sGqbuI8t3vOYJR+gTNmk5YnF6Mz5CAOgQEG/MBaZLV epD9obpkX+NXV2l0wux+0USg8iYhwvd3j/0N4sEZBZQNA0WyLXHdBHo1HXDhfaQAKEHN VM4VeH3erbgxgKXe2Olgyrr+y8TJG2Guim3eM5WGaPj/YOhlrKIatn5FGjz0rYP1cwyY Vquc/dlVQ0EbEYoEp1ewENX7X8a07iVz1J8kpEr+P19l+Kq3tBa/AiGdQfyHsZYG80bj xBUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=8zQ0gjjO56euSFEObPWmsvfCTOikaJBtrG7VqVmrbEA=; b=0kA6qt5zrrju3mXRiSGp/4VRysXMQ1v5SXJMd0pT9B2fuuo1Ay4xzXs9VzqSum689i X1t5iSn/qpqt3zpCestiH9zE6V2Tr2hRAPahe/98zX67M4fAWhO9UokWso30YqPRNWWc o9g05hN2PBUsHe5JfOBiFNswqpih1vtn5GVBeJSh98/tCOdj9lpVyf0HFOf2nhIpWjk6 9RJsoZ07Cz3kAP6Py5U+SGmsUbcqrEEqDHBWOrCNYjjaZBkNkVqi4zebXmU3DG5U5g6g AQNk7hn38Ce46PbIEcTg6OcI1I7trwU+cDo5ANV21Yn9fLehxBystEt1oiBw2Ql+MYkR 0Tpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qyqu6ddU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si4858477plg.248.2019.05.09.14.39.15; Thu, 09 May 2019 14:39:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qyqu6ddU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727183AbfEIVhU (ORCPT + 99 others); Thu, 9 May 2019 17:37:20 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:34124 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727138AbfEIVhU (ORCPT ); Thu, 9 May 2019 17:37:20 -0400 Received: by mail-qk1-f196.google.com with SMTP id n68so2467692qka.1 for ; Thu, 09 May 2019 14:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8zQ0gjjO56euSFEObPWmsvfCTOikaJBtrG7VqVmrbEA=; b=qyqu6ddUoaH6iUCLVGk97KmMO9HJx61UZT/MfIzzTWR9hYY5vSHsCHVbOdX3RpO9T3 407flqe5QhFPkX2tmJxEjraU0dqKlgyAwXWGeLZV3D6lye7NP+YfXwDy8Zh42DI79OQ4 +9QccnfNXIXoPfk0oANdCpJSGMmXq+YV4r+yxXONgXI5mZkuzv8GyI5tmLj0R07lnElH uj6HrOxsp/OsbpY3jDJ0HM6Wg0s3m9mZ8az6eNXLc5OIG6e/jRX0rIGe8ZFbleVm50FX FWmQ+A3yzWCad8p9RCNkchOtdJYf8rbSUsq2Gtky4AUMgGzZGOdUg8xLoJtn7EXAQtKK az2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8zQ0gjjO56euSFEObPWmsvfCTOikaJBtrG7VqVmrbEA=; b=bLC8aZzFXlf1AoRvvqd5nYYUNU3iJUc11Ek5he4pmGg00JP+7d2WNyrAJSRWZD6EHx xXTZh+hgSV0JlEf8BOZJoXYTox7B6ZF6OQqDuRMnkAkLQTiUT2U9K3qdWPHuJqUpYBKO cZqVyH+lgCSEbfndAI7CipcFmRD4k807woZzOsaiatqskjdiPwL2J9VBHLKCHA6vf8GU rkHUsDp0XYWlUwC+S8/TrDRKAUMUDxEduB7yjvToQDgFa/oHmTrM5ZKJLbhuoUSjax/Z ZJANq2DBVGOAA0Wa7uKhSj4qyqSeFTgiTIb8bcYdPuOCzAY8LAkb4ayJx3ZERWxD0uKG WZCw== X-Gm-Message-State: APjAAAVE+RsnCit3lTjhYM0DdMqXqurayL4BOgDMsU5ARYwt5A53zzw+ xC30r2cSTfLFSbD5e/M04w== X-Received: by 2002:ae9:d881:: with SMTP id u123mr5521379qkf.294.1557437838893; Thu, 09 May 2019 14:37:18 -0700 (PDT) Received: from gabell.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id 76sm1899721qke.46.2019.05.09.14.37.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 14:37:18 -0700 (PDT) From: Masayoshi Mizuma To: Steven Rostedt Cc: Masayoshi Mizuma , Masayoshi Mizuma , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/6] ktest: introduce grub2bls REBOOT_TYPE option Date: Thu, 9 May 2019 17:36:44 -0400 Message-Id: <20190509213647.6276-4-msys.mizuma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190509213647.6276-1-msys.mizuma@gmail.com> References: <20190509213647.6276-1-msys.mizuma@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masayoshi Mizuma Fedora 30 introduces Boot Loader Specification (BLS), it changes around grub entry configuration. kernel entries aren't in grub.cfg. We can get the entries by "grubby --info=ALL" command. Introduce grub2bls as REBOOT_TYPE option for BLS. Signed-off-by: Masayoshi Mizuma --- tools/testing/ktest/ktest.pl | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index ff43f8336da1..df0c609c7c50 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -64,6 +64,7 @@ my %default = ( "STOP_TEST_AFTER" => 600, "MAX_MONITOR_WAIT" => 1800, "GRUB_REBOOT" => "grub2-reboot", + "GRUB_BLS_GET" => "grubby --info=ALL", "SYSLINUX" => "extlinux", "SYSLINUX_PATH" => "/boot/extlinux", "CONNECT_TIMEOUT" => 25, @@ -125,6 +126,7 @@ my $last_grub_menu; my $grub_file; my $grub_number; my $grub_reboot; +my $grub_bls_get; my $syslinux; my $syslinux_path; my $syslinux_label; @@ -295,6 +297,7 @@ my %option_map = ( "GRUB_MENU" => \$grub_menu, "GRUB_FILE" => \$grub_file, "GRUB_REBOOT" => \$grub_reboot, + "GRUB_BLS_GET" => \$grub_bls_get, "SYSLINUX" => \$syslinux, "SYSLINUX_PATH" => \$syslinux_path, "SYSLINUX_LABEL" => \$syslinux_label, @@ -440,7 +443,7 @@ EOF ; $config_help{"REBOOT_TYPE"} = << "EOF" Way to reboot the box to the test kernel. - Only valid options so far are "grub", "grub2", "syslinux", and "script". + Only valid options so far are "grub", "grub2", "grub2bls", "syslinux", and "script". If you specify grub, it will assume grub version 1 and will search in /boot/grub/menu.lst for the title \$GRUB_MENU @@ -454,6 +457,8 @@ $config_help{"REBOOT_TYPE"} = << "EOF" If you specify grub2, then you also need to specify both \$GRUB_MENU and \$GRUB_FILE. + If you specify grub2bls, then you also need to specify \$GRUB_MENU. + If you specify syslinux, then you may use SYSLINUX to define the syslinux command (defaults to extlinux), and SYSLINUX_PATH to specify the path to the syslinux install (defaults to /boot/extlinux). But you have to specify @@ -479,6 +484,9 @@ $config_help{"GRUB_MENU"} = << "EOF" menu must be a non-nested menu. Add the quotes used in the menu to guarantee your selection, as the first menuentry with the content of \$GRUB_MENU that is found will be used. + + For grub2bls, \$GRUB_MENU is searched on the result of \$GRUB_BLS_GET + command for the lines that begin with "title". EOF ; $config_help{"GRUB_FILE"} = << "EOF" @@ -695,7 +703,7 @@ sub get_mandatory_configs { } } - if ($rtype eq "grub") { + if (($rtype eq "grub") or ($rtype eq "grub2bls")) { get_mandatory_config("GRUB_MENU"); } @@ -1965,6 +1973,10 @@ sub get_grub_index { $command = "cat $grub_file"; $target = '^menuentry.*' . $grub_menu_qt; $skip = '^menuentry\s|^submenu\s'; + } elsif ($reboot_type eq "grub2bls") { + $command = $grub_bls_get; + $target = '^title=.*' . $grub_menu_qt; + $skip = '^title='; } else { return; } @@ -4324,7 +4336,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { if (!$buildonly) { $target = "$ssh_user\@$machine"; - if ($reboot_type eq "grub") { + if (($reboot_type eq "grub") or ($reboot_type eq "grub2bls")) { dodie "GRUB_MENU not defined" if (!defined($grub_menu)); } elsif ($reboot_type eq "grub2") { dodie "GRUB_MENU not defined" if (!defined($grub_menu)); -- 2.20.1