diff --git a/bareon/actions/bootloader.py b/bareon/actions/bootloader.py index cc9494e..11b3071 100644 --- a/bareon/actions/bootloader.py +++ b/bareon/actions/bootloader.py @@ -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? diff --git a/bareon/drivers/deploy/nailgun.py b/bareon/drivers/deploy/nailgun.py index 80d344f..f92e51c 100644 --- a/bareon/drivers/deploy/nailgun.py +++ b/bareon/drivers/deploy/nailgun.py @@ -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, diff --git a/bareon/tests/test_do_bootloader.py b/bareon/tests/test_do_bootloader.py index a84d10a..58e9101 100644 --- a/bareon/tests/test_do_bootloader.py +++ b/bareon/tests/test_do_bootloader.py @@ -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') diff --git a/bareon/tests/test_grub_utils.py b/bareon/tests/test_grub_utils.py index 72de635..81e170f 100644 --- a/bareon/tests/test_grub_utils.py +++ b/bareon/tests/test_grub_utils.py @@ -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 diff --git a/bareon/utils/grub.py b/bareon/utils/grub.py index ad22055..8904c67 100644 --- a/bareon/utils/grub.py +++ b/bareon/utils/grub.py @@ -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 diff --git a/etc/bareon/bareon.conf.sample b/etc/bareon/bareon.conf.sample index f60e1ac..944803c 100644 --- a/etc/bareon/bareon.conf.sample +++ b/etc/bareon/bareon.conf.sample @@ -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