Browse code

installer: Do not proceed if bootloader setup fails

When building an AMI image, if grub2 is not available on the system,
the bootloader setup will fail. However, the image builder ignores
this error and proceeds anyway, creating an unbootable image. Fix it
by erroring out if mk-setup-grub.sh fails.

Change-Id: I0c9f69e176513f47be761e0d464484660b9d9856
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6339
Tested-by: michellew <michellew@vmware.com>
Reviewed-by: Sharath George

Srivatsa S. Bhat (VMware) authored on 2018/12/08 08:48:28
Showing 1 changed files
... ...
@@ -407,6 +407,9 @@ class Installer(object):
407 407
                     stdout=self.output)
408 408
             retval = process.wait()
409 409
 
410
+            if retval != 0:
411
+                raise Exception("Bootloader (grub2) setup failed")
412
+
410 413
             self._update_fstab()
411 414
 
412 415
     def _execute_modules(self, phase):