From ab2e53c8a196a595e50f1c836bf756b9db1ae68d Mon Sep 17 00:00:00 2001 From: Marcel Kolaja Date: Tue, 17 Sep 2019 17:47:36 +0200 Subject: [PATCH] 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 Signed-off-by: Javier Martinez Canillas Reviewed-by: Daniel Kiper --- util/grub-mkconfig.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 9f477ff05..523d4e029 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -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