From a7449e2e588ff895d36d718f7f240bb3e61a5369 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mar 11 2019 11:01:43 +0000 Subject: Switch to BLS in tools package %post scriptlet The switch to a BLS configuration was made before in the grubby package %post scriptlet, but this is wrong since it means that a not up-do-date grub2-switch-to-blscfg script could be used to do the switch. Resolves: rhbz#1652806 Signed-off-by: Javier Martinez Canillas --- diff --git a/grub2.spec b/grub2.spec index 0b3992e..1432110 100644 --- a/grub2.spec +++ b/grub2.spec @@ -278,6 +278,13 @@ elif [ -f /etc/grub.d/01_users ] && \ fi fi +%post tools + +if [ "$1" = 2 ]; then + ! grep -q '^GRUB_ENABLE_BLSCFG=false' /etc/default/grub && \ + /sbin/grub2-switch-to-blscfg --backup-suffix=.rpmsave &>/dev/null || : +fi + %triggerun -- grub2 < 1:1.99-4 # grub2 < 1.99-4 removed a number of essential files in postun. To fix upgrades # from the affected grub2 packages, we first back up the files in triggerun and