Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751841AbdIVEiN (ORCPT ); Fri, 22 Sep 2017 00:38:13 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33333 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750839AbdIVEiL (ORCPT ); Fri, 22 Sep 2017 00:38:11 -0400 X-Google-Smtp-Source: AOwi7QB6EbWNeTpTjdKNFkauLa+bk9JznlcWPU39v13fauR1kChyQNf2PAIiI8sHVAIIbLVmKcQOXg== Date: Fri, 22 Sep 2017 13:38:19 +0900 Message-ID: <87poaje4as.wl-satoru.takeuchi@gmail.com> From: Satoru Takeuchi To: linux-kernel@vger.kernel.org Cc: "Steven Rostedt (VMware)" Subject: [PATCH] ktest: take submenu into account User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.5 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1007 Lines: 36 grub-reboot selects the submenu's first menuentry (title is "1>0") rather than ktest's menuentry (title is "2") by mistake. === $ sudo cat /boot/grub/grub.cfg | grep -E "^menuentry|^submenu" ... menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option '...' { ... submenu 'Advanced options for Ubuntu' $menuentry_id_option '...' { ... menuentry 'ktest' { ... === Correct it by taking submenu entries into account in get_grub2_index(). Signed-off-by: Satoru Takeuchi --- tools/testing/ktest/ktest.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 0c8b61f..6cf135a 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -1821,7 +1821,7 @@ sub get_grub2_index { $grub_number++; $found = 1; last; - } elsif (/^menuentry\s/) { + } elsif (/^menuentry\s|^submenu\s/) { $grub_number++; } } -- 2.7.4