Bug 20620

Summary: Erroneous report that grub2 cannot be installed at end of Live install
Product: Mageia Reporter: Martin Whitaker <mageia>
Component: RPM PackagesAssignee: Mageia tools maintainers <mageiatools>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: release_blocker CC: thierry.vignaud
Version: CauldronKeywords: PATCH
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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()
Patch to make do_pkgs_standalone::are_installed() use a chroot in a Live install
Patch to make do_pkgs_standalone::remove() use a chroot in a Live install
Patch to fix fast path in do_pkgs::ensure_is_installed()
kill now useless is_mgalive()

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