Bug 1182891 - [Build 91.1] openQA test fails in grub_test - fails boot to the system after installing on uefi
[Build 91.1] openQA test fails in grub_test - fails boot to the system after ...
Status: RESOLVED DUPLICATE of bug 1183073
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: Installation
Leap 15.3
Other Other
: P3 - Medium : Normal (vote)
: ---
Assigned To: Michael Chang
Jiri Srain
https://openqa.opensuse.org/tests/165...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-03-02 07:26 UTC by Max Lin
Modified: 2021-04-20 12:25 UTC (History)
7 users (show)

See Also:
Found By: openQA
Services Priority:
Business Priority:
Blocker: Yes
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Lin 2021-03-02 07:26:15 UTC
## Observation

openQA test in scenario opensuse-15.3-DVD-x86_64-install_only@uefi-usb fails in
[grub_test](https://openqa.opensuse.org/tests/1651341/modules/grub_test/steps/7)

After installing from usb, reboot the machine, entering the installed system via "Boot from harddisk" on installer fails to work.

## Test suite description
set HDDSIZE=40 as required for ppc64le (failed w/o it on https://openqa.opensuse.org/tests/390330#step/install_and_reboot/21


## Reproducible

Fails since (at least) Build [90.1](https://openqa.opensuse.org/tests/1649226)


## Expected result

Last good: [85.2](https://openqa.opensuse.org/tests/1641629) (or more recent)


## Further details

Always latest result in this scenario: [latest](https://openqa.opensuse.org/tests/latest?arch=x86_64&distri=opensuse&flavor=DVD&machine=uefi-usb&test=install_only&version=15.3)
Comment 1 Guillaume GARDET 2021-03-02 08:15:46 UTC
aarch64 is also affected: https://openqa.opensuse.org/tests/1651107#step/grub_test/5
Comment 2 Max Lin 2021-03-02 08:38:18 UTC
Looks not only happened on usb but any scenario that "boot from hard disk" via dvd on uefi.
Comment 3 Michael Chang 2021-03-02 08:57:33 UTC
(In reply to Max Lin from comment #2)
> Looks not only happened on usb but any scenario that "boot from hard disk"
> via dvd on uefi.

The "boot from hard disk" falls through to the uefi menu rather than loading grub from the installed device. On aarch64 the uefi menu even failed to start.

A related issue for aarch64 is also tracked at https://bugzilla.suse.com/show_bug.cgi?id=1182776.
Comment 5 Michael Chang 2021-03-03 02:28:00 UTC
It is regression in the grub.cfg ...

> mount openSUSE-Leap-15.3-DVD-x86_64-Build90.1-Media.iso /tmp/mnt1
> mount /tmp/mnt1/boot/x86_64/efi /tmp/mnt2
> cat /tmp/mnt2/EFI/BOOT/grub.cfg
> ...
> menuentry "Boot from Hard Disk" --class opensuse --class gnu-linux --class gnu --class os {
>   if search --no-floppy --file /efi/boot/fallback.efi --set ; then
>     for os in opensuse sles caasp ; do
>       if [ -f /efi/$os/grub.efi ] ; then
>         chainloader /efi/$os/grub.efi
>       fi
>     done
>   fi
>   exit
> }

It will always go to 'exit' even though the search and chainloader command are successful. There seems to have misunderstanding to how the chainloader command worked. It doesn't perform 'boot' immediately, instead it loads image to memory and return to caller script. The image will be booted after the boot command, or the control reaches the bottom of the menu entry's executing block ...

That is it should be modified like this ...

> menuentry "Boot from Hard Disk" --class opensuse --class gnu-linux --class gnu --class os {
>   if search --no-floppy --file /efi/boot/fallback.efi --set ; then
>     for os in opensuse sles caasp ; do
>       if [ -f /efi/$os/grub.efi ] ; then
>         chainloader /efi/$os/grub.efi
>         boot
>       fi
>     done
>   fi
>   exit
> }

or ...

> menuentry "Boot from Hard Disk" --class opensuse --class gnu-linux --class gnu --class os {
>   if search --no-floppy --file /efi/boot/fallback.efi --set ; then
>     for os in opensuse sles caasp ; do
>       if [ -f /efi/$os/grub.efi ] ; then
>         chainloader /efi/$os/grub.efi
>       else
>         exit
>     done
>   else
>     exit
> }

.. if you want to add 'exit' as fallback when no suse distro found

Hi Steffen,

Would you please help to have a look ?
Thanks.
Comment 6 Andreas Färber 2021-03-03 08:45:38 UTC
(In reply to Michael Chang from comment #5)
> or ...
> 
> > menuentry "Boot from Hard Disk" --class opensuse --class gnu-linux --class gnu --class os {
> >   if search --no-floppy --file /efi/boot/fallback.efi --set ; then
> >     for os in opensuse sles caasp ; do
> >       if [ -f /efi/$os/grub.efi ] ; then
> >         chainloader /efi/$os/grub.efi
> >       else
> >         exit
> >     done
> >   else
> >     exit
> > }
> 
> .. if you want to add 'exit' as fallback when no suse distro found

That else exit would seem to defeat the purpose of the for loop.
Comment 7 Steffen Winterfeldt 2021-03-03 08:51:04 UTC
Oh, sorry; it's a glitch from merging the different efi grub configs. I will
fix this.
Comment 8 Michael Chang 2021-03-03 09:07:41 UTC
(In reply to Andreas Färber from comment #6)
> (In reply to Michael Chang from comment #5)

> > .. if you want to add 'exit' as fallback when no suse distro found
> 
> That else exit would seem to defeat the purpose of the for loop.

Arh. You are right. Sorry for this stupid example, but I hope that helped to capture the idea.

Thanks.
Comment 9 Steffen Winterfeldt 2021-03-03 10:22:10 UTC
fixed (added missing 'boot'):

https://github.com/openSUSE/installation-images/pull/464
Comment 10 Steffen Winterfeldt 2021-03-03 10:32:05 UTC
A note regarding comment 1:

On all architectures != x86_64 'local boot' just exits to the UEFI firmware.
There's no change here. If you want that changed, please speak up and we
can try to find a better solution.
Comment 15 Max Lin 2021-03-08 10:23:33 UTC
This issue has been fixed in Build94.1 with installation-images 16.48[0] which contain fixed grub-efi.cfg, but now, with Build97.1[1] this issue re-appeared, installation-images still was 16.48[2], I guess new merged SLE change has introduced an regression thus this issue happened again. Michael and Steffen, could you have a look?


[0] https://openqa.opensuse.org/tests/1654893
[1] https://openqa.opensuse.org/tests/1661048#step/grub_test/7
[2] https://build.opensuse.org/package/show/openSUSE:Leap:15.3/installation-images
Comment 16 Steffen Winterfeldt 2021-03-08 12:56:07 UTC
I've checked with openSUSE-Leap-15.3-NET-x86_64-Build97.1-Media.iso and
it boots from disk just fine. grub.cfg looks also ok.
Comment 17 Michael Chang 2021-03-09 03:40:32 UTC
I believe this time is caused by grub2 boothole2 backport which prevented the efi chainloader from working ...
Comment 18 Michael Chang 2021-03-09 03:42:59 UTC
Set duplication to bsc#1183073.

*** This bug has been marked as a duplicate of bug 1183073 ***