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
This commit is contained in:
Vladimir Kozhukalov 2014-11-25 16:43:50 +03:00
parent f762f03ecc
commit d410cf1079

View File

@ -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)]