mirror of
https://src.fedoraproject.org/rpms/grub2.git
synced 2024-11-28 07:44:52 +00:00
Don't attempt to unify if there is no grub.cfg on EFI
If there is no grub config, for example when installing the system via anaconda, there is no need to attempt a grub configuration unification. It will indeed actually break because it will try to copy a non-existent file. Resolves: rhbz#1933085
This commit is contained in:
parent
c65a33ebca
commit
931f4f0364
1 changed files with 7 additions and 3 deletions
10
grub2.spec
10
grub2.spec
|
@ -350,6 +350,10 @@ set -eu
|
|||
EFI_HOME=/boot/efi/EFI/fedora
|
||||
GRUB_HOME=/boot/grub2
|
||||
|
||||
if test ! -f ${EFI_HOME}/grub.cfg; then
|
||||
exit 0 # nothing to unify, nothing to do
|
||||
fi
|
||||
|
||||
if grep -q "configfile" ${EFI_HOME}/grub.cfg; then
|
||||
exit 0 # already unified, nothing to do
|
||||
fi
|
||||
|
@ -366,11 +370,11 @@ export \$prefix
|
|||
configfile \$prefix/grub.cfg
|
||||
EOF
|
||||
|
||||
cp -av ${EFI_HOME}/grubenv ${EFI_HOME}/grubenv.rpmsave
|
||||
cp -a ${EFI_HOME}/grubenv ${EFI_HOME}/grubenv.rpmsave
|
||||
mv --force ${EFI_HOME}/grubenv ${GRUB_HOME}/grubenv
|
||||
|
||||
cp -av ${EFI_HOME}/grub.cfg ${EFI_HOME}/grub.cfg.rpmsave
|
||||
cp -av ${EFI_HOME}/grub.cfg ${GRUB_HOME}/
|
||||
cp -a ${EFI_HOME}/grub.cfg ${EFI_HOME}/grub.cfg.rpmsave
|
||||
cp -a ${EFI_HOME}/grub.cfg ${GRUB_HOME}/
|
||||
mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg
|
||||
|
||||
%files common -f grub.lang
|
||||
|
|
Loading…
Reference in a new issue