Only execute grub2-switch-to-blscfg if GRUB_ENABLE_BLSCFG isn't set

There's no point on executing the script if GRUB_ENABLE_BLSCFG has already
been set. Currently was checking if an user explicitly set it to false to
avoid enabling the BLS configuration, but it should also be avoided if was
already set to true by a previous package update or during installation.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
This commit is contained in:
Javier Martinez Canillas 2019-05-20 18:34:12 +02:00
parent d8cdcb3a21
commit 298aa12e25
No known key found for this signature in database
GPG Key ID: C751E590D63F3D69

View File

@ -310,7 +310,7 @@ fi
%posttrans tools %posttrans tools
if [ -f /etc/default/grub ]; then if [ -f /etc/default/grub ]; then
! grep -q '^GRUB_ENABLE_BLSCFG=false' /etc/default/grub && \ ! grep -q '^GRUB_ENABLE_BLSCFG=.*' /etc/default/grub && \
/sbin/grub2-switch-to-blscfg --backup-suffix=.rpmsave &>/dev/null || : /sbin/grub2-switch-to-blscfg --backup-suffix=.rpmsave &>/dev/null || :
fi fi