grub-mkconfig: Honor a symlink when generating configuration by grub-mkconfig

Honor a symlink when generating configuration by grub-mkconfig, so that
the -o option follows it rather than overwriting it with a regular file.

Signed-off-by: Marcel Kolaja <mkolaja@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Marcel Kolaja 2019-09-17 17:47:36 +02:00 committed by Daniel Kiper
parent fc085f7f18
commit ab2e53c8a1

View file

@ -287,7 +287,8 @@ and /etc/grub.d/* files or please file a bug report with
exit 1
else
# none of the children aborted with error, install the new grub.cfg
mv -f ${grub_cfg}.new ${grub_cfg}
cat ${grub_cfg}.new > ${grub_cfg}
rm -f ${grub_cfg}.new
fi
fi