1. VectorLinux Core
  2. vinstall

Commits

Rodrigo Bistolfi  committed 3f9ff17

Fix #17 Copy grub.cfg.new to grub.cfg

  • Participants
  • Parent commits 9dfd703
  • Branches master

Comments (0)

Files changed (1)

File vinstall/backend/bootloader.py

View file
  • Ignore whitespace
 __author__ = "M0E-lnx"
 
 
-import os, shutil
+import os
+import shutil
+import tempfile
 from StringIO import StringIO
 from vinstall.backend import utils, media
 from vinstall.backend import sp
-import os
-import tempfile
 import unittest
 
 
             f.writelines("\n".join(ndata))
 
         # after these are set, we just need to run grub-mkconfig
-        sp.check_call(["grub-mkconfig", "-o", "/boot/grub/grub.cfg"])
+        cfg = "/boot/grub/grub.cfg"
+        new = cgf + ".new"
+        sp.check_call(["grub-mkconfig", "-o", cfg])
+        if os.path.exists(new):
+            shutil.move(new, cfg)
 
     def install(self):
         """Install grub to the target