Bug 18739 - drak-install fails on install from desktop (grub2-install failed: grub2-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist)
Summary: drak-install fails on install from desktop (grub2-install failed: grub2-insta...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Thomas Backlund
QA Contact:
URL:
Whiteboard:
Keywords:
: 18712 18774 (view as bug list)
Depends on:
Blocks: 416
  Show dependency treegraph
 
Reported: 2016-06-20 05:15 CEST by William Kenney
Modified: 2016-06-24 04:42 CEST (History)
6 users (show)

See Also:
Source RPM: draklive-install
CVE:
Status comment:


Attachments
report lspcidrake -v (4.02 KB, text/plain)
2016-06-20 09:57 CEST, Ben McMonagle
Details
enable to disable gurpmi usage (1.00 KB, patch)
2016-06-20 20:26 CEST, Thierry Vignaud
Details | Diff
fix the grub2 post-install check (mga#18739) (1.72 KB, patch)
2016-06-20 22:54 CEST, Thierry Vignaud
Details | Diff

Description William Kenney 2016-06-20 05:15:39 CEST
Description of problem:

Attempted install from desktop using:

Mageia-6-sta1-LiveDVD-PLASMA5-i586-DVD.iso
Dated: 06/19/16
md5sum: 8963337aff808bc89cb2734ff6c82549

Failed and displayed the following error message:

The "draklive-install" program has crashed with the following error:

  grub2-install failed: grub2-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory.
  	...propagated at /usr/lib/libDrakX/any.pm line 268.
  Perl's trace:
  drakbug::bug_handler() called from /usr/lib/libDrakX/any.pm:268
  any::installBootloader() called from /usr/lib/libDrakX/any.pm:238
  any::setupBootloaderUntilInstalled() called from /usr/sbin/draklive-install:332
  main::setup_bootloader() called from /usr/sbin/draklive-install:70
  main::install_live() called from /usr/sbin/draklive-install:42

Used theme: Adwaita

To submit a bug report, click on the report button.  
This will open a web browser window on Bugzilla where you'll find a form to fill in.  The information displayed above will be transferred to that server
It would be very useful to attach to your report the output of the following command: 'lspcidrake -v'.
Comment 1 William Kenney 2016-06-20 05:31:14 CEST
Also effects:

Mageia-6-sta1-LiveDVD-PLASMA5-x86_64-DVD.iso
md5sum: eab7b1ca91523be67efffbdffcbaa37b
Comment 2 William Kenney 2016-06-20 05:56:00 CEST
All live isos released on 06/19/16 suffer from the same install error.
Rémi Verschelde 2016-06-20 09:31:57 CEST

CC: (none) => tmb, zen25000
Assignee: bugsquad => thierry.vignaud
Source RPM: (none) => drakxtools

Thierry Vignaud 2016-06-20 09:46:30 CEST

Component: Installer => RPM Packages
Summary: drak-install fails on install from desktop => drak-install fails on install from desktop ( grub2-install failed: grub2-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist)
Source RPM: drakxtools => draklive-install

Thierry Vignaud 2016-06-20 09:48:10 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=18712
Assignee: thierry.vignaud => tmb
Summary: drak-install fails on install from desktop ( grub2-install failed: grub2-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist) => drak-install fails on install from desktop (grub2-install failed: grub2-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist)

Comment 3 Ben McMonagle 2016-06-20 09:54:43 CEST
also occurs real hardware, custom disk partitioning, GPT HDD, bootloader to MBR HDD

CC: (none) => westel

Comment 4 Ben McMonagle 2016-06-20 09:57:03 CEST
Created attachment 8029 [details]
report lspcidrake -v
Comment 5 Thomas Backlund 2016-06-20 10:08:42 CEST
Sigh, so installer is really not triggering grub2 install anymore :/

It used to do so when grub legacy was default and user switched to grub2 (or installer detected efi and switched to grub2-efi by itself)


I'm starting to think switching to grub2 by default was /is a really idiotic choice (and yeah I was one of the guilty ones deciding so...) since the other bugs and limitations of grub2 keeps biting us too...


@Thierry,

are we missing something like "$do_pkgs->ensure_binary_is_installed()" on bootloader section that would cope with this?

The problem is because of grub2 <-> grub2-efi conflict, as a last step on iso generation I do a "rpm -e --nodeps grub2" so installer can pick either grub2 or grub2-efi from "Live Core" media during install without getting hit by installer giving up on rpm conflict as found in bug 18712
Comment 6 Thomas Backlund 2016-06-20 10:16:52 CEST
Really adding Thierry in cc would probably help.... 

Thierry, see comment 5

CC: (none) => thierry.vignaud

Comment 7 Thierry Vignaud 2016-06-20 10:57:02 CEST
That's because both grub2{,-efi} provides the same grub2-reboot binary we check in order to see if we need to install the package or not.
I'll alter that.
Comment 8 Thomas Backlund 2016-06-20 11:00:35 CEST
Yeah, but since I "rpm -e" the grub2-reboot is not on the iso, so shouldn't it still trigger install?
Comment 9 Thomas Backlund 2016-06-20 11:02:41 CEST
Ah, now I see... in mga5 it was both in grub2 and grub2-efi, but now it's in grub2-common that is still on iso
Comment 10 Thierry Vignaud 2016-06-20 11:23:28 CEST
So will you just remove grub2-common from the ISO in the short term?
Comment 11 William Kenney 2016-06-20 11:36:52 CEST
Thanks all for the quick action confirming this.
Comment 12 William Kenney 2016-06-20 11:38:49 CEST
Is this basically the same thing as:

https://bugs.mageia.org/show_bug.cgi?id=18724
Comment 13 Thomas Backlund 2016-06-20 11:53:25 CEST
(In reply to Thierry Vignaud from comment #10)
> So will you just remove grub2-common from the ISO in the short term?

yeah, I can do that
Comment 14 Thomas Backlund 2016-06-20 17:03:37 CEST
(In reply to Thomas Backlund from comment #13)
> (In reply to Thierry Vignaud from comment #10)
> > So will you just remove grub2-common from the ISO in the short term?
> 
> yeah, I can do that


ok, that didnt help :/

doing "rpm -e --nodeps grub2-common" on a live system before starting the install only results in "Could not install the gub2 package!" at bootloader stage.

And if I read the code correctly it's because the whereis_binary() checks for grub2-reboot -> tries to install grub2-common ->  gets the choice of grub2 vs grub2-efi and stops there...

But come to think of it, checking for grub2-reboot is now incorrect since its in common package and not in primary loader package anymore...

I guess rewriting that code part to check based on is_uefi() to check for grub2 vs grub2-efi package is the way to go...
Comment 15 Mageia Robot 2016-06-20 17:29:08 CEST
commit 0f32b38048f50cceed0f01b693086691909418ab
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Mon Jun 20 17:24:00 2016 +0200

    ensure we've the right grub2 flavor (mga#18739)
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx/commit/?id=0f32b38048f50cceed0f01b693086691909418ab
Comment 16 Thierry Vignaud 2016-06-20 17:31:25 CEST
Fixed.
You'll need drakxtools-17.40 for draklive-install & the same version of stage2 for the regular ISOs (though that's not a problem there as we picked the right grub2 flavor first)

Status: NEW => RESOLVED
Blocks: (none) => 416
Resolution: (none) => FIXED

Comment 17 Thierry Vignaud 2016-06-20 17:33:26 CEST
*** Bug 18712 has been marked as a duplicate of this bug. ***
Comment 18 Thomas Backlund 2016-06-20 19:12:25 CEST
Sorry. but still a no-go :/


Now I get "The package grub2 needs to be installed, Do you want to install it?"

pressing next gives "Could not istall the grub2 package!"

The only thing I see when started from terminal is that when it fails to install, it writes:

(gurpmi:21965): Gtk-WARNING **: cannot open display: :0
No protocol specified
Unable to init server: Could not connect: Connection refused


doing a manual "urpmi grub2" installs it without problems

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

Comment 19 Thierry Vignaud 2016-06-20 19:19:11 CEST
Well we use gurpmi since forever.
There's sg fishy for you as DISPLAY=:0 is broken.

Is that when running draklive or draklive-install?
Comment 20 Thomas Backlund 2016-06-20 19:32:06 CEST
thats draklive-install running...

Hm, I guess this is now a fallout of gnome needing polkit to allow draklive-install to start at all (as it need root privilegies)...

in mga5 draklive-install got started with:

/usr/sbin/draklive-install-lock-storage

but for mga6 I now call a wrapper

cat draklive-install-wrapper 
#!/bin/sh
/usr/bin/pkexec /usr/sbin/draklive-install-lock-storage



and the matching policy config

# cat org.mageia.draklive-install-lock-storage.policy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

 <vendor>Mageia</vendor>
 <vendor_url>http://www.mageia.org/</vendor_url>

 <action id="org.mageia.draklive-install-lock-storage.pkexec.run">
    <description>Run draklive-install</description>
    <message>Authentication is required to run Mageia Draklive Installer</message>
    <icon_name>draklive-install</icon_name>
    <defaults>
     <allow_any>yes</allow_any>
     <allow_inactive>no</allow_inactive>
     <allow_active>yes</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/draklive-install-lock-storage</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
 </action>
</policyconfig>


(and yes, I really need to commit all my changes to git as soon as I get them to work)
Thierry Vignaud 2016-06-20 20:24:24 CEST

Attachment 8029 is obsolete: 0 => 1

Comment 21 Thierry Vignaud 2016-06-20 20:26:36 CEST
Created attachment 8032 [details]
enable to disable gurpmi usage

Can you try this?
If this works, we can patch drakxtools & make draklive-install set/export DISABLE_GURPMI=1 as environment variable.

But if polkit makes a forked process fails to access X.org just after the parent process verified the said X.org access, something is really fishy...
Comment 22 Thierry Vignaud 2016-06-20 20:27:21 CEST
@Colin: please see my latest comment. WDYT is happening?

CC: (none) => mageia

Comment 23 Thomas Backlund 2016-06-20 21:30:32 CEST
Adding the following line in /etc/pam.d/polkit-1:
session optional pam_xauth.so

makes gurpmi work, and it it installs grub2 in the chroot, but after that I get "mandatory package grub2 missing"
Comment 24 Thierry Vignaud 2016-06-20 22:21:35 CEST
Are you sure it's in your repo?
Comment 25 Thomas Backlund 2016-06-20 22:30:51 CEST
Yep. as pointed out in comment 23 it gets installed...

and:
# urpmq --sources grub2
/var/local/mga_rpms/core/grub2-2.02-0.git10457.7.mga6.i586.rpm
Comment 26 Thomas Backlund 2016-06-20 22:34:10 CEST
Hm,
come to think of it... does the "mandatory package grub2 missing" check read the live media and not the chrooted one ?

the /var/local/mga_rpms/core/grub2-2.02-0.git10457.7.mga6.i586.rpm is both ins live and chroot, but if it does rpm -q  in live media it wont see anything as it was installed in the chroot
Comment 27 Thierry Vignaud 2016-06-20 22:35:18 CEST
My bad.
I don't pass a right path to check:
http://gitweb.mageia.org/software/drakx/commit/perl-install/bootloader.pm?id=0f32b38048f50cceed0f01b693086691909418ab
My check is OK for guessing if we need to install the package, but not for the after install check
Comment 28 Thierry Vignaud 2016-06-20 22:54:22 CEST
Created attachment 8033 [details]
fix the grub2 post-install check (mga#18739)

Can you try this?
Comment 29 Mageia Robot 2016-06-20 23:04:18 CEST
commit 60af921c04dda14b5a6f9cf8c134dda4a28448a6
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Mon Jun 20 22:53:03 2016 +0200

    fix the grub2 post-install check (mga#18739)
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx/commit/?id=60af921c04dda14b5a6f9cf8c134dda4a28448a6
Comment 30 Thierry Vignaud 2016-06-20 23:06:56 CEST
OK, this time I rerun drakboot after having manually run "urpmi grub2" so that I checked:
- that the 1st time, it installs the right "grub2-efi"
- and that the 2nd time there wasn't any error

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

Comment 31 Thierry Vignaud 2016-06-21 14:19:22 CEST
@Barry: Interestingly, grub & grub2-efi can coexist on FC24
(binaries are shared in grub2-tools)
Comment 32 Barry Jackson 2016-06-21 17:33:37 CEST
(In reply to Thierry Vignaud from comment #31)
> @Barry: Interestingly, grub & grub2-efi can coexist on FC24
> (binaries are shared in grub2-tools)

We did discuss this possibility some time ago, however I did not want to risk strange issues arising as a result of both being available, and there was also the unnecessary bloat of having both sets of modules when only one is required.
Comment 33 Thierry Vignaud 2016-06-24 04:42:43 CEST
*** Bug 18774 has been marked as a duplicate of this bug. ***

CC: (none) => bequimao.de


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