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 <javierm@redhat.com>
This commit is contained in:
Javier Martinez Canillas 2019-03-11 12:01:37 +01:00
parent 8c44667ebf
commit a7449e2e58
No known key found for this signature in database
GPG Key ID: C751E590D63F3D69

View File

@ -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