Bug 1172114

Summary: yast2_bootloader test fails on Raspberry Pi 3
Product: [openSUSE] openSUSE Distribution Reporter: Guillaume GARDET <guillaume.gardet>
Component: YaST2Assignee: E-mail List <yast2-maintainers>
Status: VERIFIED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: afaerber, chester.lin, ddavis, dheidler, dmueller, fvogt, glin, jlee, jreidinger, mbrugger, mchang, yousaf.kaukab
Version: Leap 15.2Flags: jreidinger: SHIP_STOPPER?
Target Milestone: ---   
Hardware: aarch64   
OS: Other   
URL: https://openqa.opensuse.org/tests/1278546/modules/yast2_bootloader/steps/6
See Also: http://bugzilla.suse.com/show_bug.cgi?id=1167015
http://bugzilla.suse.com/show_bug.cgi?id=1172133
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: y2logs
framebuffer screenshot of error msg

Description Guillaume GARDET 2020-05-26 10:39:43 UTC
With latest Leap 15.2 snapshot, yast2_bootloader test fails on Raspberry Pi 3

Maybe due to yast2_bootloader update: https://build.opensuse.org/request/show/807739

See: https://openqa.opensuse.org/tests/1278546/modules/yast2_bootloader/steps/6
Comment 1 Fabian Vogt 2020-05-26 12:23:03 UTC
u-boot does not expose EFI vars, so only removable installations are possible. This conflicts with:

"# run grub2-install also non-removable if efi is there"
Comment 2 Andreas Färber 2020-05-26 13:04:23 UTC
Sounds like fallout from bug #1167015 for Fujitsu A64FX.
Comment 3 Dominik Heidler 2020-05-26 14:52:55 UTC
Created attachment 838197 [details]
y2logs

I could reproduce this on Build 202.5 (jeos 14.49) on a RPi3B+ by installing yast2-bootloader, running "yast2 bootloader" and pressing Save/Finish.
Comment 4 Dominik Heidler 2020-05-26 14:57:47 UTC
Created attachment 838198 [details]
framebuffer screenshot of error msg
Comment 5 Josef Reidinger 2020-05-26 16:53:22 UTC
Yes, it is result of change done for bug #1167015

Adding needinfo for mchang, as he requested that change and also adding Gary, who has some insight.
Comment 6 Gary Ching-Pang Lin 2020-05-27 02:40:10 UTC
It seems that grub2-install was run twice unconditionally. I'd expect something like this:

if (efivarfs exists) {
  grub2-install
}
grub2-install --no-nvram --removable
Comment 7 Josef Reidinger 2020-05-27 06:25:32 UTC
(In reply to Gary Ching-Pang Lin from comment #6)
> It seems that grub2-install was run twice unconditionally. I'd expect
> something like this:
> 
> if (efivarfs exists) {
>   grub2-install
> }
> grub2-install --no-nvram --removable

well, I use previously existing test for efivars which looks like

Yast::Arch.aarch64 && File.directory?("/sys/firmware/efi")

so if /sys/firmware/efi is directory, it will run it without params. We use it to decide if we need to add `--no-nvram --removable` or not.

So Dominik, can you please check if this directory exists in your case?
Comment 8 Dominik Heidler 2020-05-27 09:27:35 UTC
Yes, /sys/firmware/efi is a directory with some files and subfolders in it on my Raspberry Pi 3B+.
Comment 10 Gary Ching-Pang Lin 2020-05-27 10:03:30 UTC
(In reply to Dominik Heidler from comment #8)
> Yes, /sys/firmware/efi is a directory with some files and subfolders in it
> on my Raspberry Pi 3B+.

Is there any like Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c in /sys/firmware/efi/efivars/ or /sys/firmware/efi/vars/? If u-boot did emulate some UEFI variables, then we need to find another way to detect the emulated UEFI environment...
Comment 11 Michael Chang 2020-05-27 10:15:35 UTC
If so, this is not a regression by new update, but brand new issue as uboot emulated uefi couldn't be reliably detected by the logic we know of (and using).

Or is there any good explanation why previous version would work ?
Comment 12 Michael Chang 2020-05-27 10:50:27 UTC
(In reply to Josef Reidinger from comment #7)
> (In reply to Gary Ching-Pang Lin from comment #6)
> > It seems that grub2-install was run twice unconditionally. I'd expect
> > something like this:
> > 
> > if (efivarfs exists) {
> >   grub2-install
> > }
> > grub2-install --no-nvram --removable
> 
> well, I use previously existing test for efivars which looks like
> 
> Yast::Arch.aarch64 && File.directory?("/sys/firmware/efi")


Hi Josef,

It seems like !Dir.glob("/sys/firmware/efi/efivars/*").empty? should be used instead of File.directory?("/sys/firmware/efi") ? It was used by removable_efi? in previous version and also aligned with the logic in perl bootloader.
Comment 13 Josef Reidinger 2020-05-27 11:01:29 UTC
Yes, I can change it, it is not problem. Just Dominik can you please check if there is anything at `/sys/firmware/efi/efivars/*` ? So we are sure before changing it?
Comment 14 Dominik Heidler 2020-05-27 11:02:13 UTC
# find /sys/firmware/efi
/sys/firmware/efi/
/sys/firmware/efi/fw_platform_size
/sys/firmware/efi/efivars
/sys/firmware/efi/systab
/sys/firmware/efi/config_table
/sys/firmware/efi/vars
/sys/firmware/efi/vars/del_var
/sys/firmware/efi/vars/new_var
Comment 15 Josef Reidinger 2020-05-27 12:49:09 UTC
OK, fix is in review https://github.com/yast/yast-bootloader/pull/605
Comment 16 Yousaf Kaukab 2020-05-27 13:37:37 UTC
*** Bug 1172133 has been marked as a duplicate of this bug. ***
Comment 17 Josef Reidinger 2020-05-28 08:44:12 UTC
fix merged. It is sr#219190 yast2-bootloader version 4.2.25
Comment 19 Dominik Heidler 2020-06-15 10:44:13 UTC
Works fine on build 209.2