| Summary: | urpmi upgrade 5 > 6 loses grub2 background | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | Barry Jackson <zen25000> |
| Component: | RPM Packages | Assignee: | Mageia Bug Squad <bugsquad> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | marja11, thierry.vignaud, zen25000 |
| Version: | Cauldron | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Source RPM: | grub2 | CVE: | |
| Status comment: | |||
| Attachments: | Current scriptlet in my test build used for upgrade | ||
|
Description
Barry Jackson
2017-01-17 13:41:48 CET
Samuel Verschelde
2017-01-17 15:46:35 CET
Keywords:
(none) =>
FOR_ERRATA6
Marja Van Waes
2017-01-17 17:15:07 CET
CC:
(none) =>
marja11 That's not a tool bug but a packaging issue. Like grub & lilo, grub2 tries to update the bootloader on update. See rpm -q --scripts grub2-common. The issue is that only grub-install updates unicode.pf2, not update-grub2 which is run from the scriptlet Note that unlike grub & lilo, grub2 doesn't actually update its bootloader, it only regenerate the boot menu. We historically update the bootloader in the grub & lilo case b/c we had cases where an updated systemd wouldn't reboot after an upgrade b/c of mismatch between the old stage1 and the new stage2, ... (you can add stage1.5 for grub). That can probably be an issue for grub2 too, even if we'ven't hit it yet. I think grub2-common should also run /boot/grub2/install.sh like grub runs /boot/grub/install.sh CC:
(none) =>
thierry.vignaud, zen25000 We should also probably simplify grub's post install as we generate a /boot/grub/install.sh for 17 years... Just simplified grub legacy's logic which was added in 2005 in order to upgrade Connectiva to Mandriva... (In reply to Thierry Vignaud from comment #1) > That's not a tool bug but a packaging issue. > > Like grub & lilo, grub2 tries to update the bootloader on update. > See rpm -q --scripts grub2-common. > > The issue is that only grub-install updates unicode.pf2, not update-grub2 > which is run from the scriptlet That's wrong. The scriptlet runs /boot/grub2/install.sh ------------------- if [ -f /boot/grub2/updtrans ] && [ -f /boot/grub2/install.sh -a -x /usr/sbin/detectloader ] && [ "$DURING_INSTALL" != "1" ] ; then LOADER=$(/usr/sbin/detectloader) [ "$LOADER" = "GRUB2" ] && /boot/grub2/install.sh ||: rm -f /boot/grub2/updtrans fi ------------------- [baz@jackodesktop ~]$ cat /boot/grub2/install.sh grub2-install --bootloader-id=tmp --no-nvram > > Note that unlike grub & lilo, grub2 doesn't actually update its bootloader, Yes it does, in the above scriptlet. Ah, the issue here is that grub2 in Mga5 does not create $updtrans during the update so the conditional fails and install.sh is not run. Maybe we should add an additional test in %posttrans for /boot/grub2/fonts/unicode.pf2 and if it's missing run install.sh. That should fix this upgrade issue from 5 > 6. WDYT? That's too late, new files from new pkgs are already there by that time. You can add a trigger in that case. (In reply to Thierry Vignaud from comment #5) > That's too late, new files from new pkgs are already there by that time. Why is that a problem? Running install.sh will run grub2-install which will copy the font file where it is needed > You can add a trigger in that case. Hmm... I remember having to remove all those ;) I have just built a test grub2 with this added in %posttrans: ############## # Run install.sh if unifont.pf2 is missing (unifont.pf2 is installed by grub2-install which is run by install.sh) if [ -f /boot/grub2/install.sh -a -x /usr/sbin/detectloader ] && [ "$DURING_INSTALL" != "1" ]; then LOADER=$(/usr/sbin/detectloader) [ "$LOADER" = "GRUB2" ] && [ ! -f /boot/grub2/fonts/unicode.pf2 ] && /boot/grub2/install.sh ||: fi ############## I don't see why this would not work. Ah I understood you mean it was a new file in the new pkg so I though you wanted to test the package didn't exist in the package - I didn't understand you wanted to test in the /boot tree The thing is with your change, we won't run install.sh anymore between updates as long as unicode.pf2 has been already installed, that would be a regression... (In reply to Thierry Vignaud from comment #7) > Ah I understood you mean it was a new file in the new pkg so I though you > wanted to test the package didn't exist in the package - I didn't understand > you wanted to test in the /boot tree > > The thing is with your change, we won't run install.sh anymore between > updates as long as unicode.pf2 has been already installed, that would be a > regression... Yes we would, this test is in addition to the current one, after it. The first test is still as in comment #4 which first checks for $updtrans The new test catches the upgrade from Mga5 which does not have updtrans and would otherwise not run install.sh. Checking for the font file is actually quite a good check to know whether update -grub has been run or not. However it failed to install unicode.pf2 During the upgrade I saw grub2-install was run after the transaction and it reported no error, however on reboot the background was missing as was unicode.pf2. I see no other errors in grub2 installation. Running install.sh from the running system again reports no error but DOES copy unifont.pf2 over correctly. I am baffled as to why it fails to copy it when run in %posttrans. Created attachment 8870 [details]
Current scriptlet in my test build used for upgrade
unicode.pf2 IS in grub2-common, however since grub2-mageia-theme is no longer Suggested/Required by grub2{,-efi} then the theme is not in the same transaction and is installed later on upgrade.
I think this may be the problem.
You removed the Recommends as part of grub2 tools integration.
http://svnweb.mageia.org/packages?view=revision&revision=953531
Is there another way to force grub2-*theme* packages to be included in the transaction? (Assuming this really is the issue)
Update: I tested an upgrade with the theme package Recommended but stupidly left it unversioned so it was still outside the transaction. However I did monitor the grub2/fonts folder during the upgrade and unicode.pf2 was copied over during update of grub2 BUT it was removed on update of the theme package later, so I now need to investigate why. :\ I give up, at least for tonight. If grub2-mageia-theme is excluded from the upgrade then obviously the theme is not updated, however the font file is in place and the Mga5 theme still works fine in the updated Mga6. If the new Mga6 grub2-mageia-theme is then installed, it somehow removes unicode.pf2 from /boot/grub2/fonts/ and I have no idea why or how. I will sleep on it. Any ideas? OK found it. Amazing what some sleep does ;) unicode.pf2 was in grub2-mageia-theme package in Mga5 and was written directly to it's final location - it is now in grub2-common and written to %_datadir from where it is copied to the final location by grub2-install, so it will be removed by the outgoing theme package. Thinking more clearly now, the change to %posttrans common should not be needed as this can be fixed with a one-time %triggerpostun mageia-theme to re-run install.sh during upgrade from Mga5 -> 6 only, Testing this now. A trigger is what I advertised you yesterday :-) (In reply to Thierry Vignaud from comment #15) > A trigger is what I advertised you yesterday :-) Yes but I was not fully understanding the reason behind the issue then. I have slept since :) Tested and working fine - fix pushed so closing. Keywords:
FOR_ERRATA6 =>
(none) |