50f79d8 Execute grub2-switch-to-blscfg script in %posttrans instead of %post

Authored and Committed by javierm 4 years ago
1 file changed. 7 lines added. 3 lines removed.
    Execute grub2-switch-to-blscfg script in %posttrans instead of %post
    
    The GRUB configuration is switched to BLS using the grub2-switch-to-blscfg
    script, which is installed by the grub2-tools package. Among other things,
    the script copies the blscfg module from the /usr/lib/grub/$arch directory
    to /boot/grub2/$arch.
    
    This is done because for non-UEFI installs (i386-pc and powerpc-ieee1275)
    the GRUB core and modules aren't updated on package upgrade, so the blscfg
    module won't be the latest that contains the current BLS support.
    
    But the grub2-switch-to-blscfg script is currently executed in grub2-tools
    %post scritplet, which means that if the grub2-tools package is installed
    before the grub2-pc-modules package (that installs the blscfg module), the
    grub2-switch-to-blscfg script won't copy the latest version of the module.
    
    This will make systems to fail to populate the GRUB menu, since its config
    will already be migrated to BLS but the blscfg module won't be the latest.
    
    So to make sure that the latest blscfg module is copied regardless of the
    grub2-tools and grub2-pc-modules packages install order, run the switch
    script in a grub2-tools %posttrans so it's executed at the end of the RPM
    transaction once all the packages have been installed.
    
    Resolves: rhbz#1652806
    
    Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
    
        
file modified
+7 -3