Blob Blame Raw
From 9a7726c67258adb346b78edfd754f28e132585f5 Mon Sep 17 00:00:00 2001
From: Dennis Gilmore <dennis@ausil.us>
Date: Tue, 13 Mar 2012 12:03:24 -0500
Subject: [PATCH] Lets always write out a Legacy grub config file since its
 all ec2 supports and its presence doesnt hurt

Signed-off-by: Dennis Gilmore <dennis@ausil.us>
---
 appcreate/appliance.py |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/appcreate/appliance.py b/appcreate/appliance.py
index f9fc784..12f6794 100644
--- a/appcreate/appliance.py
+++ b/appcreate/appliance.py
@@ -258,6 +258,8 @@ class ApplianceImageCreator(ImageCreator):
             grub += "        initrd %s/%s-%s.img\n" % (prefix, initrd, v)
 
         logging.debug("Writing grub config %s/boot/grub/grub.conf" % self._instroot)
+        if not os.path.isdir(self._instroot + "/boot/grub/"):
+            os.mkdir(self._instroot + "/boot/grub/")
         cfg = open(self._instroot + "/boot/grub/grub.conf", "w")
         cfg.write(grub)
         cfg.close()
@@ -359,6 +361,9 @@ class ApplianceImageCreator(ImageCreator):
         logging.debug("Grub2 configuration file generated.")
 
     def _create_bootconfig(self):
+            # For EC2 lets always make a grub Legacy config file
+            logging.debug("Writing GRUB Legacy config.")
+            self._create_grub_config()
         if self.grub == 'grub2':
             # We have GRUB2 package installed
             # Most probably this is Fedora 16+
@@ -369,7 +374,6 @@ class ApplianceImageCreator(ImageCreator):
             # We have GRUB Legacy installed
             logging.debug("Found GRUB Legacy package.")
             self._create_grub_devices()
-            self._create_grub_config()
             self._copy_grub_files()
             self._install_grub()
         else:
-- 
1.7.9.3