Bug 18646 - grub2-install fails to install during installation of 6sta1 classic iso (/usr/lib/grub/x86_efi/modinfo.sh does not exist.)
Summary: grub2-install fails to install during installation of 6sta1 classic iso (/usr...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Installer (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal major
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard:
Keywords: 6sta1, NEEDINFO
Depends on:
Blocks: 416
  Show dependency treegraph
 
Reported: 2016-06-07 12:11 CEST by Len Lawrence
Modified: 2016-06-08 15:00 CEST (History)
7 users (show)

See Also:
Source RPM: grub2
CVE:
Status comment:


Attachments
Install log for 6sta1 classic iso (188.51 KB, application/octet-stream)
2016-06-07 16:27 CEST, Len Lawrence
Details

Description Len Lawrence 2016-06-07 12:11:35 CEST
Description of problem:
During the installation of the latest (Jun 6) 6sta1 classic iso an error occurs at the bootloader installation stage.
  An error occurred
  installation failed. grub2-install failed: grub2-install:
  error: /usr/lib/grub/x86_efi/modinfo.sh does not exist.
  Please specify --target or --directory.
         ....propagated



Version-Release number of selected component (if applicable):
Mageia-6-sta1-x86_64-DVD

How reproducible:
Once, so far.  Needs to be repeated without the nvidia configuration step.

Steps to Reproduce:
1. USB UEFI install of Mageia-6-sta1-x86_64-DVD.iso
2. Configure nvidia graphics driver and continue
3.
Comment 1 Marja Van Waes 2016-06-07 14:07:20 CEST
Guessing this should be assigned to grub2, for now.

@ Len

As always with problems that occur during a classical install, attach the logs of the install, see
https://wiki.mageia.org/en/Triage_guide#Traditional_installer

Keywords: (none) => 6sta1, NEEDINFO
CC: sysadmin-bugs => ennael1, marja11, thierry.vignaud, tmb, zen25000
Component: Release (media or process) => RPM Packages
Assignee: bugsquad => zen25000
Summary: bootloader fails to install during installation of 6sta1 classic iso => grub2-install fails to install during installation of 6sta1 classic iso (/usr/lib/grub/x86_efi/modinfo.sh does not exist.)
Source RPM: (none) => grub2

Comment 2 Thomas Backlund 2016-06-07 14:13:29 CEST
Sigh, I guess yet Another $random not-really-upstream sync somewhere...

The efi one is actually in:
/usr/lib/grub/x86_64-efi/modinfo.sh
Thierry Vignaud 2016-06-07 14:22:21 CEST

Blocks: (none) => 416

Comment 3 Len Lawrence 2016-06-07 16:09:45 CEST
Sorry, there is a typo there:
error: /usr/lib/grub/x86_64-efi/modinfo.sh does not exist.

I have tried this on another UEFI machine and also avoided the nvidia configuration step.  No difference.
Also tried another USB key to eliminate possible media problems.
No difference.  Same error always.
Comment 4 Len Lawrence 2016-06-07 16:12:29 CEST
@Marja
If I can get to a console before exit I shall attach the logs.
Comment 5 Len Lawrence 2016-06-07 16:27:03 CEST
Created attachment 7941 [details]
Install log for 6sta1 classic iso

Mageia-6-sta1-x86_64-DVD install on UEFI machine which stalls on the bootloader install.
Comment 6 Thomas Backlund 2016-06-07 16:32:35 CEST
Ok, so the modifo.sh path was a typo....

The real breakage is:

At start we want grub2 nowdays:

* preferring grub2 over lilo,grub2-efi,grub
* replacing bootloader with grub2
* selecting grub2-2.02-0.git10457.6.mga6.x86_64
* requiring grub2-common[== 2.02-0.git10457.6.mga6] for grub2-2.02-0.git10457.6.mga6.x86_64
* chosen grub2-common-2.02-0.git10457.6.mga6.x86_64 for grub2-common[== 2.02-0.git10457.6.mga6]
* selecting grub2-common-2.02-0.git10457.6.mga6.x86_64


Then we detect UEFI

* selecting grub2-efi because of needed for UEFI boot


and poof:

* no packages match grub2-efi (it is either in skip.list or already rejected)
* ERROR: selection failed: grub2-efi-2.02-0.git10457.6.mga6.x86_64 (due to conflicts with grub2-2.02-0.git10457.6.mga6.x86_64)
Comment 7 Thierry Vignaud 2016-06-07 16:51:49 CEST
So

Status: NEW => ASSIGNED
Component: RPM Packages => Installer
Assignee: zen25000 => thierry.vignaud

Comment 8 Barry Jackson 2016-06-07 17:40:01 CEST
...installer installs grub2 instead of grub2-efi on UEFI hardware.
Comment 9 Thomas Backlund 2016-06-07 17:45:57 CEST
(In reply to Barry Jackson from comment #8)
> ...installer installs grub2 instead of grub2-efi on UEFI hardware.

Yes, that's because of rpm deps.

basesystem wants bootloader, wich gets defaulted to grub2...

It's only later we detect uefi and the need for grub2-efi.

this "bug" is because we started to deprecate grub legacy and installer has always lived with "grub legacy" is default until now... so some hiccups are expected when we adjust installer
Comment 10 Mageia Robot 2016-06-07 17:48:38 CEST
commit e75a01510f0c0ac105d03d6e95f6aa046197e614
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Tue Jun 7 17:44:48 2016 +0200

    fix selecting grub2-efi on UEFI (mga#18646)
    
    the issue is that we select basesystem which pulls bootloader -> grub2
    then later grub2-efi b/c we're on UEFI which results in:
    
    we don't use the right API for selecting packages which results in:
    * preferring grub2 over lilo,grub2-efi,grub
    * replacing bootloader with grub2
    * selecting grub2-2.02-0.git10457.6.mga6.x86_64
    (...)
    * selecting grub2-efi because of needed for UEFI boot
    (...)
    * no packages match grub2-efi (it is either in skip.list or already rejected)
    * ERROR: selection failed: grub2-efi-2.02-0.git10457.6.mga6.x86_64 (due
      to conflicts with grub2-2.02-0.git10457.6.mga6.x86_64)
    
    the proper fix would be to use a better URPM API but it's just as simple
    to pick the bootloader before picking basesystem...
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx/commit/?id=e75a01510f0c0ac105d03d6e95f6aa046197e614
Comment 11 Thierry Vignaud 2016-06-07 17:49:27 CEST
Fixed

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED

Comment 12 Thomas Backlund 2016-06-07 17:51:20 CEST
Not really, you have a c/p error:

+    if (is_uefi()) {
+       log::l("selecting grub2-efi because it's needed for UEFI boot");
+       $p = 'grub2-efi';
+    } else {
+       log::l("defaulting to grub");
+       $p = 'grub2-efi';


so now all get grub2-efi :)
Comment 13 Thomas Backlund 2016-06-07 17:56:38 CEST
Oh, and come to think of it... 
the above wont work on live medias as the image get grub2 installed on the squashfs image, and I need to be able to switch to efi when needed...

But I think I can work around it for now with draklive doing "rpm -e -nodeps grub2" at end of install, before image creation, and it can the pull in correct grub2(-efi) from live core media during live install...
Comment 14 Barry Jackson 2016-06-07 17:59:04 CEST
:)

O/T
Thomas,Thierry are you OK if I push updated grub2 now with fix for Bug 15846
(btrfs sector 63 bug)?
Comment 15 Thierry Vignaud 2016-06-07 18:11:40 CEST
(In reply to Thomas Backlund from comment #12)
That's what happen when one test only with OVMF after a bad baby night :-)

(In reply to Barry Jackson from comment #14)
yes go on
Comment 16 Charles Edwards 2016-06-07 19:06:44 CEST
I just tested an EFI clean install using stage2-17.35.
grub2-efi installs without issue.
On re-boot system boots to a working desktop.

Will test with 17.35.1 after next mirror sync.

CC: (none) => cae

Comment 17 Charles Edwards 2016-06-07 21:20:20 CEST
Just tested with Stage2-17.35.1

Ran test on multi drive, multi OS system.
Installed in both EFI and MBR mode, bootloader installs and performs flawlessly
on both.
Comment 18 Marja Van Waes 2016-06-08 15:00:57 CEST
*** Bug 18656 has been marked as a duplicate of this bug. ***

CC: (none) => westel


Note You need to log in before you can comment on or make changes to this bug.