dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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