Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nDOY1-0002O5-PG for mharc-grub-devel@gnu.org; Fri, 28 Jan 2022 05:32:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDOY0-0002Nh-UF for grub-devel@gnu.org; Fri, 28 Jan 2022 05:32:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDOXx-0000SV-HV for grub-devel@gnu.org; Fri, 28 Jan 2022 05:32:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643365920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+iPuWrmwPlkChKA8bRrlTPfEzmC5RG6KeoabonG7Muk=; b=WsaIu1iogTEiWpj1DJD+9diowTmgCbal3vllFDaCvn/KaST21nXySKmcqHM3dkXyCBu3CX hLITzMk7gElFbkVlWe5GnjsEIVDMpjFkD48elMz78NjvFcgyzQcC0t/0beeFQ1KUR3dW2F LID/PKPK2ritIDoqNfV7sFDNI+IUtEs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-427-VIOOlA_AMPOuIzJ8vQM2Ww-1; Fri, 28 Jan 2022 05:30:42 -0500 X-MC-Unique: VIOOlA_AMPOuIzJ8vQM2Ww-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AB37E1083F60 for ; Fri, 28 Jan 2022 10:30:41 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.193.191]) by smtp.corp.redhat.com (Postfix) with ESMTP id D15AB66E17; Fri, 28 Jan 2022 10:30:40 +0000 (UTC) From: Hans de Goede To: grub-devel@gnu.org Cc: Robbie Harwood , Hans de Goede Subject: [PATCH 1/2] normal/menu: Don't show "Booting `%s'" msg when auto-booting with TIMEOUT_STYLE_HIDDEN Date: Fri, 28 Jan 2022 11:30:32 +0100 Message-Id: <20220128103033.74343-2-hdegoede@redhat.com> In-Reply-To: <20220128103033.74343-1-hdegoede@redhat.com> References: <20220128103033.74343-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Received-SPF: pass client-ip=170.10.133.124; envelope-from=hdegoede@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.167, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2022 10:32:05 -0000 When the user has asked the menu code to be hidden/quiet and the current entry is being autobooted because the timeout has expired don't show the "Booting `%s'" msg. This is necessary to let flicker-free boots really be flicker free, otherwise the "Booting `%s'" msg will kick the EFI fb into text mode and show the msg, breaking the flicker-free experience. Signed-off-by: Hans de Goede --- grub-core/normal/menu.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c index 8397886fa..fa4871a62 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -573,13 +573,15 @@ print_countdown (struct grub_term_coordinate *pos, int n) entry to be executed is a result of an automatic default selection because of the timeout. */ static int -run_menu (grub_menu_t menu, int nested, int *auto_boot) +run_menu (grub_menu_t menu, int nested, int *auto_boot, int *notify_boot) { grub_uint64_t saved_time; int default_entry, current_entry; int timeout; enum timeout_style timeout_style; + *notify_boot = 1; + default_entry = get_entry_number (menu, "default"); /* If DEFAULT_ENTRY is not within the menu entries, fall back to @@ -654,6 +656,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) if (timeout == 0) { *auto_boot = 1; + *notify_boot = timeout_style != TIMEOUT_STYLE_HIDDEN; return default_entry; } @@ -807,12 +810,16 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) /* Callback invoked immediately before a menu entry is executed. */ static void -notify_booting (grub_menu_entry_t entry, - void *userdata __attribute__((unused))) +notify_booting (grub_menu_entry_t entry, void *userdata) { - grub_printf (" "); - grub_printf_ (N_("Booting `%s'"), entry->title); - grub_printf ("\n\n"); + int *notify_boot = userdata; + + if (*notify_boot) + { + grub_printf (" "); + grub_printf_ (N_("Booting `%s'"), entry->title); + grub_printf ("\n\n"); + } } /* Callback invoked when a default menu entry executed because of a timeout @@ -860,8 +867,9 @@ show_menu (grub_menu_t menu, int nested, int autobooted) int boot_entry; grub_menu_entry_t e; int auto_boot; + int notify_boot; - boot_entry = run_menu (menu, nested, &auto_boot); + boot_entry = run_menu (menu, nested, &auto_boot, ¬ify_boot); if (boot_entry < 0) break; @@ -873,7 +881,7 @@ show_menu (grub_menu_t menu, int nested, int autobooted) if (auto_boot) grub_menu_execute_with_fallback (menu, e, autobooted, - &execution_callback, 0); + &execution_callback, ¬ify_boot); else grub_menu_execute_entry (e, 0); if (autobooted) -- 2.33.1