Bug 20620 - Erroneous report that grub2 cannot be installed at end of Live install
Summary: Erroneous report that grub2 cannot be installed at end of Live install
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: release_blocker normal
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2017-04-02 22:29 CEST by Martin Whitaker
Modified: 2017-04-05 04:54 CEST (History)
1 user (show)

See Also:
Source RPM: drakxtools-17.75-1.mga6.src.rpm
CVE:
Status comment: Patches pushed, to be tested in drakx 17.77 or later


Attachments
Patch to clean up Live install chroot in do_pkgs_standalone:install() (908 bytes, text/plain)
2017-04-02 22:31 CEST, Martin Whitaker
Details
Patch to make do_pkgs_standalone::are_installed() use a chroot in a Live install (1.20 KB, text/plain)
2017-04-02 22:33 CEST, Martin Whitaker
Details
Patch to make do_pkgs_standalone::remove() use a chroot in a Live install (1.06 KB, text/plain)
2017-04-02 22:33 CEST, Martin Whitaker
Details
Patch to fix fast path in do_pkgs::ensure_is_installed() (762 bytes, text/plain)
2017-04-02 22:34 CEST, Martin Whitaker
Details
kill now useless is_mgalive() (1.45 KB, patch)
2017-04-03 17:21 CEST, Thierry Vignaud
Details | Diff

Description Martin Whitaker 2017-04-02 22:29:18 CEST
After clicking on the Finish button in the second bootloader configuration screen, a pop-up appears claiming "Could not install grub2 package!". This is not true; the grub2 package has already been installed. If you click on OK in the pop-up window, installation completes, and the installed system can be booted without a problem.

This is a regression caused by commit de1fcc27f943f4ae7b8ac4147a36b196c236619e, which means that the fast path in do_pkgs::ensure_is_installed() no longer works, because $o_file is not passed on to do_pkgs::is_installed(). But it exposes a couple of other bugs when do_pkgs is used by the Live installer

1) do_pkgs_standalone::are_installed() needs to check for packages inside the install root. Currently it checks in the Live system root, which is why we get the erroneous report that grub2 cannot be installed

2) do_pkgs_standalone::removes() needs to remove packages inside the install root. Currently it removes them from the Live system root. This is prevent the "Probe foreign OS" checkbox from working as expected.

Patches follow.
Comment 1 Martin Whitaker 2017-04-02 22:31:51 CEST
Created attachment 9174 [details]
Patch to clean up Live install chroot in do_pkgs_standalone:install()

Did this first as I wanted to reuse the code. Now we have $::isLiveInstall, we can do a cleaner check for whether we need to run in a chroot.
Comment 2 Martin Whitaker 2017-04-02 22:33:10 CEST
Created attachment 9175 [details]
Patch to make do_pkgs_standalone::are_installed() use a chroot in a Live install
Comment 3 Martin Whitaker 2017-04-02 22:33:49 CEST
Created attachment 9176 [details]
Patch to make do_pkgs_standalone::remove() use a chroot in a Live install
Comment 4 Martin Whitaker 2017-04-02 22:34:26 CEST
Created attachment 9177 [details]
Patch to fix fast path in do_pkgs::ensure_is_installed()
Comment 5 Thierry Vignaud 2017-04-03 17:21:50 CEST
Looks good.
this means we should kill is_mgalive()

CC: (none) => thierry.vignaud

Comment 6 Thierry Vignaud 2017-04-03 17:21:52 CEST
Created attachment 9182 [details]
kill now useless is_mgalive()
Comment 7 Rémi Verschelde 2017-04-04 10:34:02 CEST
Let's push to git :)
Rémi Verschelde 2017-04-04 10:34:30 CEST

Status comment: (none) => Approved patchset, needs to be pushed to git and packaged

Rémi Verschelde 2017-04-04 20:08:38 CEST

Status comment: Approved patchset, needs to be pushed to git and packaged => Patches pushed, to be tested in drakx 17.77 or later

Comment 8 Thierry Vignaud 2017-04-05 04:54:54 CEST
Closing

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


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