Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2955052pxu; Mon, 14 Dec 2020 15:50:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTfNbnlapnHgJKkvf8X4IJb5+0n4anFUztkksYRfgaKO2GHrgae5kFbPAiekI6RtkVrZzm X-Received: by 2002:a17:906:298c:: with SMTP id x12mr24472827eje.244.1607989832283; Mon, 14 Dec 2020 15:50:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607989832; cv=none; d=google.com; s=arc-20160816; b=cVXcXf5yd9KJs9iYKabdoQ2VHMJdk810g2nDS2GPD7EN7yjJMeMPdie+t81zikwM0K rGm6pQfMwyG0hqYAS+Rhx0vKaybf8VPYoAlZN12Ceu1dqp8wvMRAXn4CJ9SEYxDlzGax OYt8dJ5UDkI4rCD+kvLLLgglrPSNm6PqBl/xdV1kOmH5AiSfF4ZNRlFOn9Ap4hpvqH+W vO2Ra8sjIXLj1ye5inLHfrZv8eJ5dLSwNepxY0e2hdLXWhghYSqNebaJBkOHz3k6/7sN R391MvfnOYYnzhfjhNdtzmjChDUQ8W9QubGxjJkzlHHOPkB6kbcv+13zJH1GsmB9eyki 5RKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=4hYRK0ILTSCYcSFH1mh7Eq+Zb5BNjPoEXkhCqxA9qTE=; b=dK9Y5FxObnL6gnOtVSyo4la/ft509ypWW4KgSCTFOPmQD8fab61FdxhzpQceTudqVs HCovpcbY8I0yqflVYnJ4iuRtg6FlzxvYT7ozN9RR4AY/GhTSoBJRlELnR65aZHLlKjTY OKvZsYIDSroFqUHg8QHG7NUGDOpgx0hRZGhSRP9AqF7OdKEBic/yC68rsdqeI7v6T+XJ kMaAwUFcRDISfM+w81lBNhHwTOtnYumM414g4CyUoGHGvrmvwvPz4wrEwwTNC9e3qR2E 8NFyiYYM+gxuShiBHZjXei+2qL6SnHS3AQWduwdCGcGoYpPp3mZOM//cXhisrMqXF4bo muig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qh18si16373ejb.374.2020.12.14.15.50.09; Mon, 14 Dec 2020 15:50:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394492AbgLNRfE (ORCPT + 99 others); Mon, 14 Dec 2020 12:35:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:45342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731370AbgLNRez (ORCPT ); Mon, 14 Dec 2020 12:34:55 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Libo Chen , "Steven Rostedt (VMware)" Subject: [PATCH 5.4 23/36] ktest.pl: Fix incorrect reboot for grub2bls Date: Mon, 14 Dec 2020 18:28:07 +0100 Message-Id: <20201214172544.438579209@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201214172543.302523401@linuxfoundation.org> References: <20201214172543.302523401@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Libo Chen commit 271e0c9dce1b02a825b3cc1a7aa1fab7c381d44b upstream. This issue was first noticed when I was testing different kernels on Oracle Linux 8 which as Fedora 30+ adopts BLS as default. Even though a kernel entry was added successfully and the index of that kernel entry was retrieved correctly, ktest still wouldn't reboot the system into user-specified kernel. The bug was spotted in subroutine reboot_to where the if-statement never checks for REBOOT_TYPE "grub2bls", therefore the desired entry will not be set for the next boot. Add a check for "grub2bls" so that $grub_reboot $grub_number can be run before a reboot if REBOOT_TYPE is "grub2bls" then we can boot to the correct kernel. Link: https://lkml.kernel.org/r/20201121021243.1532477-1-libo.chen@oracle.com Cc: stable@vger.kernel.org Fixes: ac2466456eaa ("ktest: introduce grub2bls REBOOT_TYPE option") Signed-off-by: Libo Chen Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- tools/testing/ktest/ktest.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -2008,7 +2008,7 @@ sub reboot_to { if ($reboot_type eq "grub") { run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch)'"; - } elsif ($reboot_type eq "grub2") { + } elsif (($reboot_type eq "grub2") or ($reboot_type eq "grub2bls")) { run_ssh "$grub_reboot $grub_number"; } elsif ($reboot_type eq "syslinux") { run_ssh "$syslinux --once \\\"$syslinux_label\\\" $syslinux_path";