Increase all the grub_timeout defaults to 10sec
This increases the timeout value and adds the ability in the IPMI session to catch the moment and press a key to see the grub menu to choose a different kernel. Conflicts: bareon/utils/grub.py fuel_agent/tests/test_manager.py Change-Id: I297c5a4d17606274d6f344c7dcbdcf44663984b2 Closes-Bug: #1540638
This commit is contained in:
parent
58f03a5487
commit
1d843c4f6e
@ -27,8 +27,8 @@ from bareon.utils import utils
|
||||
|
||||
opts = [
|
||||
cfg.IntOpt(
|
||||
'grub_timeout',
|
||||
default=5,
|
||||
'timeout',
|
||||
default=10,
|
||||
help='Timeout in secs for GRUB'
|
||||
),
|
||||
cfg.BoolOpt(
|
||||
@ -96,14 +96,14 @@ class BootLoaderAction(base.BaseAction, mixins.MountableMixin):
|
||||
if grub.version == 1:
|
||||
gu.grub1_cfg(kernel=kernel, initrd=initrd,
|
||||
kernel_params=grub.kernel_params, chroot=chroot,
|
||||
grub_timeout=CONF.grub_timeout)
|
||||
grub_timeout=CONF.timeout)
|
||||
gu.grub1_install(install_devices, boot_device, chroot=chroot)
|
||||
else:
|
||||
# TODO(kozhukalov): implement which kernel to use by default
|
||||
# Currently only grub1_cfg accepts kernel and initrd
|
||||
# parameters.
|
||||
gu.grub2_cfg(kernel_params=grub.kernel_params, chroot=chroot,
|
||||
grub_timeout=CONF.grub_timeout)
|
||||
grub_timeout=CONF.timeout)
|
||||
gu.grub2_install(install_devices, chroot=chroot)
|
||||
|
||||
# TODO(agordeev): move to separate actions?
|
||||
|
@ -53,11 +53,6 @@ opts = [
|
||||
default='.bareon-image',
|
||||
help='Suffix which is used while creating temporary files',
|
||||
),
|
||||
cfg.IntOpt(
|
||||
'grub_timeout',
|
||||
default=5,
|
||||
help='Timeout in secs for GRUB'
|
||||
),
|
||||
cfg.IntOpt(
|
||||
'max_loop_devices_count',
|
||||
default=255,
|
||||
|
@ -67,7 +67,7 @@ class TestBootLoaderAction(unittest2.TestCase):
|
||||
mock_gu.grub1_cfg.assert_called_once_with(
|
||||
kernel_params='fake_kernel_params root=UUID=fake_root_uuid ',
|
||||
initrd='guessed_initrd', kernel='guessed_kernel',
|
||||
chroot='/tmp/target', grub_timeout=5)
|
||||
chroot='/tmp/target', grub_timeout=10)
|
||||
mock_gu.grub1_install.assert_called_once_with(
|
||||
['/dev/sda', '/dev/sdb', '/dev/sdc'],
|
||||
'/dev/sda3', chroot='/tmp/target')
|
||||
@ -94,7 +94,7 @@ class TestBootLoaderAction(unittest2.TestCase):
|
||||
mock_gu.grub1_cfg.assert_called_once_with(
|
||||
kernel_params='fake_kernel_params root=UUID= ',
|
||||
initrd='initrd_name', kernel='kernel_name', chroot='/tmp/target',
|
||||
grub_timeout=5)
|
||||
grub_timeout=10)
|
||||
mock_gu.grub1_install.assert_called_once_with(
|
||||
['/dev/sda', '/dev/sdb', '/dev/sdc'],
|
||||
'/dev/sda3', chroot='/tmp/target')
|
||||
@ -167,7 +167,7 @@ class TestBootLoaderAction(unittest2.TestCase):
|
||||
initrd='guessed_initrd',
|
||||
chroot='/tmp/target',
|
||||
kernel='guessed_kernel',
|
||||
grub_timeout=5)
|
||||
grub_timeout=10)
|
||||
mock_gu.grub1_install.assert_called_once_with(
|
||||
['/dev/sda', '/dev/sdb', '/dev/sdc'],
|
||||
'/dev/sda3', chroot='/tmp/target')
|
||||
@ -188,7 +188,7 @@ class TestBootLoaderAction(unittest2.TestCase):
|
||||
mock_gu.grub2_cfg.assert_called_once_with(
|
||||
kernel_params=' console=ttyS0,9600 console=tty0 rootdelay=90 '
|
||||
'nomodeset root=UUID=fake_UUID ',
|
||||
chroot='/tmp/target', grub_timeout=5)
|
||||
chroot='/tmp/target', grub_timeout=10)
|
||||
mock_gu.grub2_install.assert_called_once_with(
|
||||
['/dev/sda', '/dev/sdb', '/dev/sdc'],
|
||||
chroot='/tmp/target')
|
||||
|
@ -404,7 +404,7 @@ class TestGrubUtils(unittest2.TestCase):
|
||||
mock_initrd.return_value = 'initrd-version'
|
||||
config = """
|
||||
default=0
|
||||
timeout=5
|
||||
timeout=10
|
||||
title Default (kernel-version)
|
||||
kernel /kernel-version kernel-params
|
||||
initrd /initrd-version
|
||||
|
@ -199,7 +199,7 @@ def grub1_stage1(chroot=''):
|
||||
|
||||
|
||||
def grub1_cfg(kernel=None, initrd=None,
|
||||
kernel_params='', chroot='', grub_timeout=5):
|
||||
kernel_params='', chroot='', grub_timeout=10):
|
||||
|
||||
if not kernel:
|
||||
kernel = guess_kernel(chroot=chroot)
|
||||
@ -233,7 +233,7 @@ def grub2_install(install_devices, chroot='', boot_root='', lvm_boot=False):
|
||||
utils.execute(*cmd, run_as_root=True, check_exit_code=[0])
|
||||
|
||||
|
||||
def grub2_cfg(kernel_params='', chroot='', grub_timeout=5, lvm_boot=False):
|
||||
def grub2_cfg(kernel_params='', chroot='', grub_timeout=10, lvm_boot=False):
|
||||
with grub2_prepare(kernel_params, chroot, grub_timeout, lvm_boot):
|
||||
cmd = [guess_grub2_mkconfig(chroot), '-o', guess_grub2_conf(chroot)]
|
||||
if chroot:
|
||||
@ -241,7 +241,7 @@ def grub2_cfg(kernel_params='', chroot='', grub_timeout=5, lvm_boot=False):
|
||||
utils.execute(*cmd, run_as_root=True)
|
||||
|
||||
|
||||
def grub2_cfg_bundled(kernel_params='', chroot='', grub_timeout=5,
|
||||
def grub2_cfg_bundled(kernel_params='', chroot='', grub_timeout=10,
|
||||
lvm_boot=False):
|
||||
# NOTE(oberezovskyi): symlink is required because of grub2-probe fails
|
||||
# to find device with root partition of fuel agent.
|
||||
@ -259,7 +259,8 @@ def grub2_cfg_bundled(kernel_params='', chroot='', grub_timeout=5,
|
||||
|
||||
|
||||
@contextmanager
|
||||
def grub2_prepare(kernel_params='', chroot='', grub_timeout=5, lvm_boot=False):
|
||||
def grub2_prepare(kernel_params='', chroot='', grub_timeout=10,
|
||||
lvm_boot=False):
|
||||
old_env = os.environ.copy()
|
||||
os.environ['GRUB_DISABLE_SUBMENU'] = 'y'
|
||||
os.environ['GRUB_CMDLINE_LINUX_DEFAULT'] = kernel_params
|
||||
|
@ -41,7 +41,7 @@
|
||||
#image_build_suffix=.bareon-image
|
||||
|
||||
# Timeout in secs for GRUB (integer value)
|
||||
#grub_timeout=5
|
||||
#grub_timeout=10
|
||||
|
||||
# Maximum allowed loop devices count to use (integer value)
|
||||
#max_loop_devices_count=255
|
||||
|
Loading…
Reference in New Issue
Block a user