]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
grub-mkconfig: Honor a symlink when generating configuration by grub-mkconfig
authorMarcel Kolaja <mkolaja@redhat.com>
Tue, 17 Sep 2019 15:47:36 +0000 (17:47 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 23 Sep 2019 11:17:15 +0000 (13:17 +0200)
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>
util/grub-mkconfig.in

index 9f477ff05468e42c62a0cd52fa917deedebb47e9..523d4e029bb87a8684d7bb16712bf2c8e04459a0 100644 (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