From f7a57c982726041092e6496eb68c90b37e8620a8 Mon Sep 17 00:00:00 2001 From: Shivanand Tendulker Date: Thu, 9 Apr 2015 01:30:57 -0700 Subject: [PATCH] Fix for automated boot iso issue with IPA ramdisk Autogenerated boot iso for iscsi_ilo driver fails when Fedora based IPA ramdisk is used for deploy in UEFI boot mode. The keywords used (linux and initrd) in grub.cfg template are specific to Ubuntu only. They are not recognized by Fedora. Have changed it to keywords (linuxefi and initrdefi) which are recognized by both Ubuntu and Fedora deploy ramdisks. Also the menuentry name has been changed to 'boot_partition' in grub config file. This is done to make it consistent with pxe driver's elilo config file wherein menuentry name for the final boot of user image is 'boot_partition'. Closes-Bug: 1441691 Change-Id: Ia6fdbf4868e6606a18b33ce2b75f29f701a31b35 --- ironic/common/grub_conf.template | 10 +++++++--- ironic/tests/test_images.py | 11 +++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ironic/common/grub_conf.template b/ironic/common/grub_conf.template index 746a43d975..2a979d2d6c 100644 --- a/ironic/common/grub_conf.template +++ b/ironic/common/grub_conf.template @@ -1,4 +1,8 @@ -menuentry "install" { -linux {{ linux }} {{ kernel_params }} -- -initrd {{ initrd }} +set default=0 +set timeout=5 +set hidden_timeout_quiet=false + +menuentry "boot_partition" { +linuxefi {{ linux }} {{ kernel_params }} -- +initrdefi {{ initrd }} } diff --git a/ironic/tests/test_images.py b/ironic/tests/test_images.py index fb1da9dbc0..b610d4b0af 100644 --- a/ironic/tests/test_images.py +++ b/ironic/tests/test_images.py @@ -424,12 +424,15 @@ class FsImageTestCase(base.TestCase): self.assertEqual(expected_cfg, cfg) def test__generate_grub_cfg(self): - kernel_params = ['key1=value1', 'key2'] options = {'linux': '/vmlinuz', 'initrd': '/initrd'} - expected_cfg = ("menuentry \"install\" {\n" - "linux /vmlinuz key1=value1 key2 --\n" - "initrd /initrd\n" + expected_cfg = ("set default=0\n" + "set timeout=5\n" + "set hidden_timeout_quiet=false\n" + "\n" + "menuentry \"boot_partition\" {\n" + "linuxefi /vmlinuz key1=value1 key2 --\n" + "initrdefi /initrd\n" "}") cfg = images._generate_cfg(kernel_params,