Bug 966701

Summary: grub2-efi falls to 'grub command mode' when pressing esc
Product: [openSUSE] openSUSE Tumbleweed Reporter: Dominique Leuenberger <dimstar>
Component: BootloaderAssignee: Michael Chang <mchang>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: glin, nwr10cst-oslnx
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Dominique Leuenberger 2016-02-15 11:09:50 UTC
Discovered on openQA: https://openqa.opensuse.org/tests/121593/modules/first_boot/steps/1

When booting using 'regular' grub, 'ESC' just cancels the grub timeout. In grub2-efi, esc brings me back to the command prompt of grub2
Comment 1 Michael Chang 2016-02-17 09:22:11 UTC
Yes, I confirmed the problem.
Comment 2 Michael Chang 2016-02-19 04:27:52 UTC
It's because the config is loaded by configfile by it's parent config in ESP and pressing ESC will go back to it, which is command mode because the parent config does not have any menuentry.

A fix is to start a new normal mode from the grub.cfg in the system's /boot partition, in that way it won't go back to the parent where the normal mode rooted.

Here is the /boot/efi/opensuse/grub.cfg fixed the problem for me. 

 set btrfs_relative_path="yes"
 search --fs-uuid --set=root e8048408-27ab-4d44-ad40-1000c0253f83
 set prefix=(${root})/boot/grub2
 normal

Alternatively, to interrupt timeout you could use 'any key' to avoid side effects of using a defined key (like ESC, 'e' or 'c').
Comment 3 Michael Chang 2016-02-19 04:34:11 UTC
I think previous one is not good as normal mode is nested so that normal_exit wouldn't back to rescue mode in the first place. It'd be better to exit current normal mode and start a new one from rescue mode.

 set btrfs_relative_path="yes"
 search --fs-uuid --set=root e8048408-27ab-4d44-ad40-1000c0253f83
 set prefix=(${root})/boot/grub2
 normal_exit
 normal
Comment 4 Michael Chang 2016-03-09 07:27:44 UTC
Resolved Fixed as shim-install patch has submitted. Thanks.
Comment 7 Swamp Workflow Management 2016-06-23 11:08:54 UTC
openSUSE-RU-2016:1662-1: An update that has three recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 966701,968264,984391
CVE References: 
Sources used:
openSUSE Leap 42.1 (src):    shim-TW-0.9-10.1
Comment 8 Swamp Workflow Management 2016-07-07 13:09:04 UTC
SUSE-RU-2016:1755-1: An update that has three recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 917427,966701,968264
CVE References: 
Sources used:
SUSE Linux Enterprise Server 12-SP1 (src):    shim-0.9-4.1
SUSE Linux Enterprise Desktop 12-SP1 (src):    shim-0.9-4.1
Comment 9 Neil Rickert 2016-11-16 21:39:41 UTC
It looks to me as if this was only ever fixed for 42.1.  It was not fixed for Tumbleweed, and it appears to be back in 42.2.

Admittedly, it is a relatively minor problem.  But it should be fixed.  Or, at least, it should be closed with WONTFIX rather than FIXED, since the problem is still there.  The bug was originally reported for Tumbleweed, not for 42.1.
Comment 10 Michael Chang 2016-11-17 04:29:51 UTC
I wonder i(In reply to Neil Rickert from comment #9)
> It looks to me as if this was only ever fixed for 42.1.  It was not fixed
> for Tumbleweed, and it appears to be back in 42.2.

My tests with 42.2 GM image did not have the problem, would you please double check ?

For Tumbleweed, somehow the old shim package is still in use [1], so that the fix is missing, though the patch has been submitted to Factory since half a year ago. [2]

[1]
* Thu Dec 03 2015 jsegitz@novell.com
- acquired updated signature from Microsoft

[2]
Wed Mar  9 07:15:52 UTC 2016 - mchang@suse.com

- shim-install : fix typing ESC can escape to parent config which is
  in command mode and cannot return back (bsc#966701)
 
> Admittedly, it is a relatively minor problem.  But it should be fixed.  Or,
> at least, it should be closed with WONTFIX rather than FIXED, since the
> problem is still there.  The bug was originally reported for Tumbleweed, not
> for 42.1.

Needinfo Gary, I heard from him Tumbleweed is particularly difficult to update shim to latest signed one from Microsoft because the rolling release makes the binary changes all the time if new library and gcc versions introduced to factory.
Thanks.
Comment 11 Neil Rickert 2016-11-17 05:36:16 UTC
I rechecked 42_2.  You are right.  It is fixed there.

Thanks for looking.  Reclose if you want, now that I know what Tumbleweed still doesn't have the fix.

Maybe shim should be split into two packages, with the signed file in one package and everything else in the other package.
Comment 12 Gary Ching-Pang Lin 2016-11-17 06:26:20 UTC
(In reply to Michael Chang from comment #10)
> I wonder i(In reply to Neil Rickert from comment #9)
> > It looks to me as if this was only ever fixed for 42.1.  It was not fixed
> > for Tumbleweed, and it appears to be back in 42.2.
> 
> My tests with 42.2 GM image did not have the problem, would you please
> double check ?
> 
> For Tumbleweed, somehow the old shim package is still in use [1], so that
> the fix is missing, though the patch has been submitted to Factory since
> half a year ago. [2]
> 
> [1]
> * Thu Dec 03 2015 jsegitz@novell.com
> - acquired updated signature from Microsoft
> 
> [2]
> Wed Mar  9 07:15:52 UTC 2016 - mchang@suse.com
> 
> - shim-install : fix typing ESC can escape to parent config which is
>   in command mode and cannot return back (bsc#966701)
>  
> > Admittedly, it is a relatively minor problem.  But it should be fixed.  Or,
> > at least, it should be closed with WONTFIX rather than FIXED, since the
> > problem is still there.  The bug was originally reported for Tumbleweed, not
> > for 42.1.
> 
> Needinfo Gary, I heard from him Tumbleweed is particularly difficult to
> update shim to latest signed one from Microsoft because the rolling release
> makes the binary changes all the time if new library and gcc versions
> introduced to factory.
> Thanks.

Shim wasn't updated in Tumbleweed due to a mistake and I filed boo#1007238. In the future, we probably will use the shim binary from Leap for Tumbleweed.
Comment 13 Michael Chang 2017-03-03 09:42:52 UTC
According to comment#11, set resolved fixed.
Comment 14 Swamp Workflow Management 2019-05-14 10:13:44 UTC
This is an autogenerated message for OBS integration:
This bug (966701) was mentioned in
https://build.opensuse.org/request/show/702795 Factory / shim