grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Honor a symlink when generating configuration by grub2-mkconfig


From: Javier Martinez Canillas
Subject: [PATCH] Honor a symlink when generating configuration by grub2-mkconfig
Date: Tue, 17 Sep 2019 17:47:36 +0200

From: Marcel Kolaja <address@hidden>

Honor a symlink when generating configuration by grub2-mkconfig, so that
the -o option follows it rather than overwriting it with a regular file.

Signed-off-by: Marcel Kolaja <address@hidden>
Signed-off-by: Javier Martinez Canillas <address@hidden>
---

 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 9f477ff0546..523d4e029bb 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
 
-- 
2.21.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]