c78952
From c29e260c9f41f4f802fa852b6c46fb2e5d912cb6 Mon Sep 17 00:00:00 2001
f4c76c
From: Marcel Kolaja <mkolaja@redhat.com>
f4c76c
Date: Tue, 21 Jan 2014 10:57:08 -0500
31cddd
Subject: [PATCH] Honor a symlink when generating configuration by
f4c76c
 grub2-mkconfig
f4c76c
f4c76c
Honor a symlink when generating configuration by grub2-mkconfig, so that
f4c76c
the -o option follows it rather than overwriting it with a regular file.
f4c76c
---
f4c76c
 util/grub-mkconfig.in | 3 ++-
f4c76c
 1 file changed, 2 insertions(+), 1 deletion(-)
f4c76c
f4c76c
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
ec4acb
index f8496d28bdf..3b070fd7632 100644
f4c76c
--- a/util/grub-mkconfig.in
f4c76c
+++ b/util/grub-mkconfig.in
2ae5c1
@@ -276,7 +276,8 @@ and /etc/grub.d/* files or please file a bug report with
2ae5c1
     exit 1
f4c76c
   else
f4c76c
     # none of the children aborted with error, install the new grub.cfg
f4c76c
-    mv -f ${grub_cfg}.new ${grub_cfg}
f4c76c
+    cat ${grub_cfg}.new > ${grub_cfg}
f4c76c
+    rm -f ${grub_cfg}.new
f4c76c
   fi
f4c76c
 fi
f4c76c