dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0011-Honor-a-symlink-when-generating-configuration-by-gru.patch

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