From d410cf1079f4b113e69d2f18cdf1cbf30b818861 Mon Sep 17 00:00:00 2001 From: Vladimir Kozhukalov Date: Tue, 25 Nov 2014 16:43:50 +0300 Subject: [PATCH] Set GRUB_HIDDEN_TIMEOUT=5 in /etc/default/grub * This gonna give some time to VM to make hard drives fully available. Othewise kernel could encounter VFS syncing issue. This case is quite hard to reproduce. Change-Id: I2128f5b0a894231454b5bcc540b8991394f89ed4 Related-Bug: 1396078 --- fuel_agent/utils/grub_utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fuel_agent/utils/grub_utils.py b/fuel_agent/utils/grub_utils.py index 2d554fb..559ef35 100644 --- a/fuel_agent/utils/grub_utils.py +++ b/fuel_agent/utils/grub_utils.py @@ -199,13 +199,16 @@ def grub2_install(install_devices, chroot=''): def grub2_cfg(kernel_params='', chroot=''): grub_defaults = chroot + guess_grub2_default(chroot=chroot) - regex = re.compile(r'^.*GRUB_CMDLINE_LINUX.*') + rekerparams = re.compile(r'^.*GRUB_CMDLINE_LINUX=.*') + retimeout = re.compile(r'^.*GRUB_HIDDEN_TIMEOUT=.*') new_content = '' with open(grub_defaults) as f: for line in f: - new_content += regex.sub( + line = rekerparams.sub( 'GRUB_CMDLINE_LINUX="{kernel_params}"'. format(kernel_params=kernel_params), line) + line = retimeout.sub('GRUB_HIDDEN_TIMEOUT=5', line) + new_content += line with open(grub_defaults, 'wb') as f: f.write(new_content) cmd = [guess_grub2_mkconfig(chroot), '-o', guess_grub2_conf(chroot)]