From c31e801897a3a9172ff238bfbdb4d65ab1be7d36 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mon, 11 Mar 2019 12:01:37 +0100 Subject: [PATCH] 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 --- grub2.spec | 7 +++++++ 1 file changed, 7 insertions(+) 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