Browse code

Adding efi boot as an option for ks and ova.

Sharath George authored on 2015/08/05 04:00:03
Showing 2 changed files
... ...
@@ -122,7 +122,15 @@ class Installer(object):
122 122
             self.execute_modules(modules.commons.POST_INSTALL)
123 123
 
124 124
             # install grub
125
-            process = subprocess.Popen([self.setup_grub_command, '-w', self.photon_root, self.install_config['disk']['disk'], self.install_config['disk']['root']], stdout=self.output)
125
+            try:
126
+                if self.install_config['boot'] == 'bios':
127
+                    process = subprocess.Popen([self.setup_grub_command, '-w', self.photon_root, "bios", self.install_config['disk']['disk'], self.install_config['disk']['root']], stdout=self.output)
128
+                elif self.install_config['boot'] == 'efi':
129
+                    process = subprocess.Popen([self.setup_grub_command, '-w', self.photon_root, "efi", self.install_config['disk']['disk'], self.install_config['disk']['root']], stdout=self.output)
130
+            except:
131
+                #install bios if variable is not set.
132
+                process = subprocess.Popen([self.setup_grub_command, '-w', self.photon_root, "bios", self.install_config['disk']['disk'], self.install_config['disk']['root']], stdout=self.output)
133
+
126 134
             retval = process.wait()
127 135
 
128 136
         process = subprocess.Popen([self.unmount_disk_command, '-w', self.photon_root], stdout=self.output)
... ...
@@ -41,10 +41,11 @@ ARCH=$(uname -m)	# host architecture
41 41
 > ${LOGFILE}		#	clear/initialize logfile
42 42
 
43 43
 # Check if passing a HHD and partition
44
-if [ $# -eq 2 ] 
44
+if [ $# -eq 3 ] 
45 45
 	then
46
-		HDD=$1
47
-		PARTITION=$2
46
+        BOOTMODE=$1
47
+		HDD=$2
48
+		PARTITION=$3
48 49
 fi
49 50
 
50 51
 #
... ...
@@ -62,7 +63,12 @@ echo "Unable to found grub install command"
62 62
 exit 1
63 63
 fi
64 64
 
65
-grub_mbr_install
65
+if [ "$BOOTMODE" == "bios" ]; then 
66
+    grub_mbr_install
67
+fi
68
+if [ "$BOOTMODE" == "efi" ]; then 
69
+    grub_efi_install
70
+fi
66 71
 
67 72
 cp boot/unifont.pf2 ${BUILDROOT}/boot/grub2/
68 73
 mkdir -p ${BUILDROOT}/boot/grub2/themes/photon