Bug 1127481 - Upgrade to 15.1 tries to install grub-efi even though my bootloader is Legacy BIOS and fails to install packages
Upgrade to 15.1 tries to install grub-efi even though my bootloader is Legacy...
Status: CONFIRMED
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: Upgrade Problems
Leap 15.1
Other Other
: P2 - High : Normal (vote)
: ---
Assigned To: YaST Team
Jiri Srain
https://trello.com/c/HI7uPXfN
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-01 09:42 UTC by Konstantinos Tsamis
Modified: 2020-10-14 08:28 UTC (History)
5 users (show)

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


Attachments
logs (3.84 MB, application/gzip)
2019-03-01 09:42 UTC, Konstantinos Tsamis
Details
YaST2_internal_error_invalid_merge_argument_grub2_for_grub2-efi (1.40 MB, image/jpeg)
2019-08-24 13:09 UTC, Isamu Koga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantinos Tsamis 2019-03-01 09:42:56 UTC
Created attachment 798527 [details]
logs

Using the DVD I chose Upgrade and I saw the error in the Overview section at the end that it can't detect the efi partition so it might make my system unbootable and I should open a bug. The problem is after the upgrade was finished I didn't have a y2log but only y2log-1 and y2log-2. And I couldn't find the error in those. After reboot I do a zypper up and there are like 800 packages to be updated, all of them cached already. So that means it cached all the packages instead of installing and I had to do it again. After installing all of them I see the similar error here:


Executing %posttrans script 'kernel-firmware-20190118-lp151.1.3.noarch.rpm' <3%>================================================================================================================================[\]
Output of kernel-firmware-20190118-lp151.1.3.noarch.rpm %posttrans script:
    Creating initrd: /boot/initrd-4.12.14-lp150.12.48-default
    dracut: Executing: /usr/bin/dracut --logfile /var/log/YaST2/mkinitrd.log --force /boot/initrd-4.12.14-lp150.12.48-default 4.12.14-lp150.12.48-default
    dracut: *** Including module: bash ***
    dracut: *** Including module: systemd ***
    dracut: *** Including module: warpclock ***
    dracut: *** Including module: systemd-initrd ***
    dracut: *** Including module: i18n ***
    dracut: *** Including module: drm ***
    dracut: *** Including module: plymouth ***
    dracut: *** Including module: crypt ***
    dracut: *** Including module: dm ***
    dracut: Skipping udev rule: 64-device-mapper.rules
    dracut: Skipping udev rule: 60-persistent-storage-dm.rules
    dracut: Skipping udev rule: 55-dm.rules
    dracut: *** Including module: kernel-modules ***
    dracut: *** Including module: lvm ***
    dracut: Skipping udev rule: 64-device-mapper.rules
    dracut: Skipping udev rule: 56-lvm.rules
    dracut: Skipping udev rule: 60-persistent-storage-lvm.rules
    dracut: *** Including module: resume ***
    dracut: *** Including module: rootfs-block ***
    dracut: *** Including module: suse-btrfs ***
    dracut-install: ERROR: installing '/usr/share/doc/btrfsprogs/dracut-fsck-help.txt' to '/usr/share/fsck/fsck_help_btrfs.txt'
    dracut: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.GR4CZA/initramfs /usr/share/doc/btrfsprogs/dracut-fsck-help.txt /usr/share/fsck/fsck_help_btrfs.txt
    dracut: *** Including module: suse-xfs ***
    dracut: *** Including module: terminfo ***
    dracut: *** Including module: udev-rules ***
    dracut: Skipping udev rule: 40-redhat.rules
    dracut: Skipping udev rule: 50-firmware.rules
    dracut: Skipping udev rule: 50-udev.rules
    dracut: Skipping udev rule: 91-permissions.rules
    dracut: Skipping udev rule: 80-drivers-modprobe.rules
    dracut: *** Including module: dracut-systemd ***
    dracut: *** Including module: haveged ***
    dracut: *** Including module: usrmount ***
    dracut: *** Including module: base ***
    dracut: *** Including module: fs-lib ***
    dracut: *** Including module: shutdown ***
    dracut: *** Including module: suse ***
    dracut: *** Including modules done ***
    dracut: *** Installing kernel module dependencies and firmware ***
    dracut: *** Installing kernel module dependencies and firmware done ***
    dracut: *** Resolving executable dependencies ***
    dracut: *** Resolving executable dependencies done***
    dracut: *** Hardlinking files ***
    dracut: *** Hardlinking files done ***
    dracut: *** Stripping files ***
    dracut: *** Stripping files done ***
    dracut: *** Generating early-microcode cpio image ***
    dracut: *** Constructing GenuineIntel.bin ****
    dracut: *** Store current command line parameters ***
    dracut: Stored kernel commandline:
    dracut:  rd.luks.uuid=luks-3ca9e321-7a76-4dc6-9a46-8c11ac70b25e
    dracut:  rd.lvm.lv=LVM_group/root
    dracut:  resume=UUID=874f7a4f-4f84-4c92-a971-280b933bfea6
    dracut:  root=/dev/mapper/LVM_group-root rootfstype=xfs rootflags=rw,relatime,attr2,inode64,noquota
    dracut: *** Creating image file '/boot/initrd-4.12.14-lp151.21-default' ***
    dracut: *** Creating initramfs image file '/boot/initrd-4.12.14-lp151.21-default' done ***

Executing %posttrans script 'grub2-i386-pc-2.02-lp151.19.2.noarch.rpm' .........................................................................<57%>===========================================================[|]
Output of grub2-i386-pc-2.02-lp151.19.2.noarch.rpm %posttrans script:
    update-bootloader: 2019-02-27 13:20:09 <3> update-bootloader-2225 run_command.294: '/usr/lib/bootloader/grub2-efi/install' failed with exit code 1, output:
    <<<<<<<<<<<<<<<<
    target = x86_64-efi
    ls: cannot access '/sys/firmware/efi/efivars': No such file or directory
    + /usr/sbin/shim-install --config-file=/boot/grub2/grub.cfg --no-nvram --removable
    No valid EFI partition
    >>>>>>>>>>>>>>>>

Executing %posttrans scripts ................................................................................................................................................................................[done]
There are some running programs that might use files deleted by recent upgrade. You may wish to check and restart some of them. Run 'zypper ps -s' to list these programs.

Core libraries or services have been updated.
Reboot is required to ensure that your system benefits from these updates.

The logs are a bit of a mess for some reason after the installation, I also unpacked some tarballs trying to find the error but no luck. Maybe someone else can have better luck.
Comment 1 Stefan Schubert 2019-03-01 13:25:03 UTC
While calling
2019-02-27 05:12:44 <1> install(3493) [Ruby] lib/cheetah.rb:158 Executing "/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg".
there are some errors around:
2019-02-27 05:12:47 <1> install(3493) [Ruby] lib/cheetah.rb:158 Executing "/usr/sbin/shim-install --config-file\=/boot/grub2/grub.cfg".
2019-02-27 05:12:47 <3> install(3493) [Ruby] lib/cheetah.rb:206 Error output: No valid EFI partition
2019-02-27 05:12:47 <3> install(3493) [Ruby] lib/cheetah.rb:178 Status: 1
2019-02-27 05:12:47 <3> install(3493) [Ruby] yast2/execute.rb:232 Execution of command "[["/usr/sbin/shim-install", "--config-file=/boot/grub2/grub.cfg"]]" failed.
Exit code: 1
Error output: No valid EFI partition

Josef, could you please check it ? Thanks !
Comment 2 Josef Reidinger 2019-03-04 07:57:48 UTC
Konstantinos - can you please describe what you exactly did? I see in logs some failures in bootloader proposal. Do you try to edit configuration on upgrade proposal screen? ( clicking on booting headline )? What exactly you were doing during upgrade beside common clicking on next?
Comment 3 Konstantinos Tsamis 2019-03-04 09:40:53 UTC
(In reply to Josef Reidinger from comment #2)
> Konstantinos - can you please describe what you exactly did? I see in logs
> some failures in bootloader proposal. Do you try to edit configuration on
> upgrade proposal screen? ( clicking on booting headline )? What exactly you
> were doing during upgrade beside common clicking on next?

No I had Legacy BIOS before and just chose upgrade and then next next. In the summary screen it showed the error that it couldn't find the right partition but I thought it would be written as well in the logs. It was basically something like: 
Error output: No valid EFI partition

and then please report the bug with logs etc etc.
Comment 4 Stefan Schubert 2019-03-04 14:48:44 UTC
So, Josef could you please check it again ?
Comment 5 Josef Reidinger 2019-03-04 14:56:16 UTC
Well, it looks like DVD is boot with EFI. And bootloader prints warning about it, at least it is what I see in logs:

proposal returns warning with level warning and msg Cannot upgrade the bootloader because of a mismatch of the boot technology. The upgraded system uses <i>Legacy BIOS boot</i> while the installation medium has been booted using <i>EFI boot</i>.<br><br>This scenario is not supported, the upgraded system may not boot or the upgrade process can fail later.

So from my POV it works as expected. It should print warning on proposal screen ( I need to test if it print also additional confirmation during upgrade confirmation ). So looks like DVD is accidentally booted via EFI and not legacy ( or kernel wrongly report it as EFI ).
Comment 6 Stefan Schubert 2019-03-05 15:01:26 UTC
(In reply to Josef Reidinger from comment #5)
> Well, it looks like DVD is boot with EFI. And bootloader prints warning
> about it, at least it is what I see in logs:
> 
> proposal returns warning with level warning and msg Cannot upgrade the
> bootloader because of a mismatch of the boot technology. The upgraded system
> uses <i>Legacy BIOS boot</i> while the installation medium has been booted
> using <i>EFI boot</i>.<br><br>This scenario is not supported, the upgraded
> system may not boot or the upgrade process can fail later.
> 
> So from my POV it works as expected. It should print warning on proposal
> screen ( I need to test if it print also additional confirmation during
> upgrade confirmation ). So looks like DVD is accidentally booted via EFI and
> not legacy ( or kernel wrongly report it as EFI ).

Ok, thanks. Perhaps the kernel guys can help here in order to find out why it is booted via EFI. Feel free to reassign it back, if have the opinion that it is still an YaST issue.
Comment 7 Michael Chang 2019-06-13 04:17:24 UTC
According to comment#6, reassign to kernel maintainers.
Comment 8 Isamu Koga 2019-08-24 13:02:41 UTC
Just FYI.

I have experienced same issue with network installation which boot from USB stick.
I got YaST2 internal error dialog during installation process but upgrade has been completed.

After the reboot, it works!

Thanks.
Comment 9 Isamu Koga 2019-08-24 13:09:16 UTC
Created attachment 815626 [details]
YaST2_internal_error_invalid_merge_argument_grub2_for_grub2-efi

This is an error dialog that appeared near final stage during upgrade.
Comment 10 Neil Rickert 2019-08-24 13:49:51 UTC
I'll try this again.  My first attempt to comment was botched (bad gateway message).

Comment #6 >Perhaps the kernel guys can help here in order to find out why it is booted via EFI.

This is a mistake.  The kernel is not involved.  Whether the DVD is booted with UEFI or legacy booting is between the user and the BIOS settings.  By the time the boot menu (for the DVD) is showing, it has already been determined whether to use UEFI or legacy booting.  And the kernel has not yet been loaded at that stage.

If you find yourself in this situation, go into bootloader settings (during the install), and change the bootloader from "grub2-efi" to "grub2".  Then legacy booting will be used.

Perhaps there could be an option screen for this.  When the update finds that it is updating a legacy-boot system, but the DVD (or USB) was booted with UEFI, maybe it could prompt the user to choose between legacy booting (as previously used) and UEFI booting (as the installer was booted).
Comment 11 Josef Reidinger 2019-08-26 07:38:25 UTC
(In reply to Neil Rickert from comment #10)
> I'll try this again.  My first attempt to comment was botched (bad gateway
> message).
> 
> Comment #6 >Perhaps the kernel guys can help here in order to find out why
> it is booted via EFI.
> 
> This is a mistake.  The kernel is not involved.  Whether the DVD is booted
> with UEFI or legacy booting is between the user and the BIOS settings.  By
> the time the boot menu (for the DVD) is showing, it has already been
> determined whether to use UEFI or legacy booting.  And the kernel has not
> yet been loaded at that stage.
> 
> If you find yourself in this situation, go into bootloader settings (during
> the install), and change the bootloader from "grub2-efi" to "grub2".  Then
> legacy booting will be used.
> 
> Perhaps there could be an option screen for this.  When the update finds
> that it is updating a legacy-boot system, but the DVD (or USB) was booted
> with UEFI, maybe it could prompt the user to choose between legacy booting
> (as previously used) and UEFI booting (as the installer was booted).

Yeah, but only this way should be possible, as other case when originally EFI is used and now DVD booted with legacy is not possible due to missing EFI firmware variables.

In general this case is quite corner case which usually does not happen. It really has nothing to do with kernel, as it is up to machine firmware if legacy or EFI boot is used. YaST can only react on it.
So in case of legacy system and EFI booted medium it can allow user to force install of legacy grub and it should work. In other case we have problem and probably force user to boot properly DVD.