Bug 20089

Summary: Installer is wrongly offering option to use GRUB Legacy in live installs
Product: Mageia Reporter: Dick Gevers <dvgevers>
Component: RPM PackagesAssignee: Thierry Vignaud <thierry.vignaud>
Status: RESOLVED FIXED QA Contact: Mageia tools maintainers <mageiatools>
Severity: normal    
Priority: release_blocker CC: mageia, marja11, ngompa13, sysadmin-bugs, thierry.vignaud
Version: CauldronKeywords: 6sta2, PATCH
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: draklive-install-2.8-1.mga6.src.rpm CVE:
Status comment: Patch provided
Attachments: do not offer lilo/grub-legacy in live install

Description Dick Gevers 2017-01-08 17:31:23 CET
Description of problem:

Boot to Live mode with M6sta2 Gnome Live DVD (64 bits) and start installer.

Proceed to drakboot, choose grub legacy.

An error occurs: Package grub not found.
Dick Gevers 2017-01-08 17:31:43 CET

Keywords: (none) => 6sta2

Dick Gevers 2017-01-08 17:33:14 CET

Summary: Installer has option to choose grub legac6y for bootloader but package not found => Installer has option to choose grub legacy for bootloader but package not found

Marja Van Waes 2017-01-08 22:43:06 CET

CC: (none) => marja11
Assignee: bugsquad => isobuild

Comment 1 Neal Gompa 2017-01-08 22:45:08 CET
It should not be possible to choose Grub Legacy.

CC: (none) => ngompa13
Summary: Installer has option to choose grub legacy for bootloader but package not found => Installer lets you choose grub legacy as bootloader in M6 Live DVD when it should not

Comment 2 Marja Van Waes 2017-01-09 00:16:29 CET
(In reply to Neal Gompa from comment #1)
> It should not be possible to choose Grub Legacy.

Not in UEFI installs, because Grub legacy won't work there.

However, for legacy BIOS installs we only made Grub2 the new default
https://wiki.mageia.org/en/Mageia_6_Release_Notes#Grub2_used_as_boot_loader_by_default

Grub legacy wasn't obsoleted. 

Unless I missed something, it should still be selectable outside UEFI installs.
Marja Van Waes 2017-01-09 00:17:19 CET

Summary: Installer lets you choose grub legacy as bootloader in M6 Live DVD when it should not => Installer has option to choose grub legacy for bootloader but package not found

Comment 3 Neal Gompa 2017-01-09 00:33:14 CET
(In reply to Marja van Waes from comment #2)
> (In reply to Neal Gompa from comment #1)
> > It should not be possible to choose Grub Legacy.
> 
> Not in UEFI installs, because Grub legacy won't work there.
> 
> However, for legacy BIOS installs we only made Grub2 the new default
> https://wiki.mageia.org/en/
> Mageia_6_Release_Notes#Grub2_used_as_boot_loader_by_default
> 
> Grub legacy wasn't obsoleted. 
> 
> Unless I missed something, it should still be selectable outside UEFI
> installs.

We only support GRUB Legacy as M5->M6 upgrade. New installs should *never* have GRUB  Legacy because of the ext4 incompatibility (GRUB Legacy cannot read ext4 created by M6).
Comment 4 Martin Whitaker 2017-01-09 01:02:47 CET
I believe Neal is correct, and this is the behaviour you'll see with the classic installer. It's not happening in the Live installer because it doesn't set the global $isInstall variable (except in one very restricted area).

CC: (none) => mageia
Component: Release (media or process) => RPM Packages
Assignee: isobuild => mageiatools
Source RPM: gnome live dvd 64 bits => draklive-install-2.8-1.mga6.src.rpm

Neal Gompa 2017-01-09 02:22:00 CET

Summary: Installer has option to choose grub legacy for bootloader but package not found => Installer is wrongly offering option to use GRUB Legacy in live installs

Neal Gompa 2017-01-09 02:22:54 CET

Priority: Normal => release_blocker

Comment 5 Marja Van Waes 2017-01-09 08:06:18 CET
(In reply to Neal Gompa from comment #3)
> (In reply to Marja van Waes from comment #2)

> > 
> > Unless I missed something, it should still be selectable outside UEFI
> > installs.
> 
> We only support GRUB Legacy as M5->M6 upgrade. New installs should *never*
> have GRUB  Legacy because of the ext4 incompatibility (GRUB Legacy cannot
> read ext4 created by M6).

Thanks, so i did miss something ;)
I hope i'll remember to make the release notes more clear about it being the only option, when the wiki gets unlocked.
Comment 6 Thierry Vignaud 2017-01-09 09:45:05 CET
draklive-install could set a $::isLiveInstall variable we could test for in bootloader.pm...

CC: (none) => thierry.vignaud

Comment 7 Martin Whitaker 2017-01-09 09:58:31 CET
(In reply to Thierry Vignaud from comment #6)
> draklive-install could set a $::isLiveInstall variable we could test for in
> bootloader.pm...

I'll do that (I've got another bug to fix in draklive-install). Will you do the necessary change in bootloader.pm?
Comment 8 Thierry Vignaud 2017-01-09 10:11:46 CET
Yes
Comment 9 Thierry Vignaud 2017-01-12 19:19:40 CET
But you haven't pushed anything yet...
Comment 10 Mageia Robot 2017-01-12 19:42:21 CET
commit 7e28f939b41928fd41efb220af91337b31bfc37a
Author: Martin Whitaker <mageia@...>
Date:   Thu Jan 12 18:39:31 2017 +0000

    Set a $::isLiveInstall variable for other drakx modules to use.
    
    Part of a fix for mga#20089.
---
 Commit Link:
   http://gitweb.mageia.org/software/draklive-install/commit/?id=7e28f939b41928fd41efb220af91337b31bfc37a
Comment 11 Martin Whitaker 2017-01-12 19:45:36 CET
(In reply to Thierry Vignaud from comment #9)
> But you haven't pushed anything yet...

Yes, I only have so much free time, and other bugs seemed more urgent...

Done now.
Comment 12 Thierry Vignaud 2017-01-16 11:37:24 CET
Created attachment 8863 [details]
do not offer lilo/grub-legacy in live install

To be tested (with a install on UEFI too)
Thierry Vignaud 2017-01-16 11:37:41 CET

Keywords: (none) => PATCH

Comment 13 Neal Gompa 2017-01-16 12:18:55 CET
(In reply to Thierry Vignaud from comment #12)
> Created attachment 8863 [details]
> do not offer lilo/grub-legacy in live install
> 
> To be tested (with a install on UEFI too)

Why not just remove the code that supports the older bootloaders entirely? Wouldn't that be simpler and less hacky?
Comment 14 Thierry Vignaud 2017-01-17 14:28:17 CET
Because that would break upgrading from mga5...
Comment 15 Rémi Verschelde 2017-01-17 15:35:51 CET
(In reply to Thierry Vignaud from comment #12)
> Created attachment 8863 [details]
> do not offer lilo/grub-legacy in live install

Those might be silly questions as I'm not very familiar with the code, but:

- Doesn't the live installer define `$::isInstall` as true too? If not, I'd say it's confusingly named and should probably be renamed to `$::isClassicalInstall` to avoid logic being written only for the classical installer while forgetting the live installer.

- Wouldn't this work? We only want to support install grub-legacy on !efi and upgrades, so:

```
-if_(!is_uefi() && !($::isInstall && !$::o->{isUpgrade}), (
+if_(!is_uefi() && $:o->{isUpgrade}), (
```
Comment 16 Rémi Verschelde 2017-01-17 15:36:32 CET
Typo in my fake diff:

```
-if_(!is_uefi() && !($::isInstall && !$::o->{isUpgrade}), (
+if_(!is_uefi() && $::o->{isUpgrade}), (
```
Comment 17 Rémi Verschelde 2017-01-17 15:37:42 CET
Martin, could you test the patch in comment 12 next time you spin a live ISO?

Status comment: (none) => Patch provided, needs testing
Assignee: mageiatools => mageia
QA Contact: (none) => mageiatools

Comment 18 Thierry Vignaud 2017-01-17 18:03:05 CET
No.
draklive-install doesn't set $::isInstall but for a couple function call.

The $::isInstall flag is specific to the classic installer.
draklive-install & other standalone tools (eg: drakxtools) do not set it.
There's no intention to rename it.

There's neither a global $::o variable nor a isUpgrade flag set when used from draklive-install
Comment 19 Rémi Verschelde 2017-01-17 18:24:10 CET
Thanks for the explanations :) Can't wait for our own GitLab or similar to be able to discuss such things in a friendly code commenting interface :D
Comment 20 Martin Whitaker 2017-01-17 19:18:51 CET
Tested by patching existing Live ISO before running draklive-install. Works as expected - grub2 is the only bootloader requested.

Status comment: Patch provided, needs testing => Patch provided
Assignee: mageia => thierry.vignaud

Comment 21 Mageia Robot 2017-01-23 17:48:23 CET
commit 0a8596e052f6574d1f052ef46733bfffa190de40
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Mon Jan 16 11:33:04 2017 +0100

    do not offer lilo/grub-legacy in live install
    
    Resolves: mga#20089
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx/commit/?id=0a8596e052f6574d1f052ef46733bfffa190de40
Comment 22 Thierry Vignaud 2017-01-23 18:01:13 CET
Fixed in git after testing a patched mga6 install

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