Commit 298786e9 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Merge branch 'nkupdates' into 'master'

Cleaned up serial handling, make sure all config is in the block

See merge request idms-linux-rolling/projects/idms-linux-installer!27
parents b9474a5e 7956f170
Pipeline #105 passed with stage
in 1 minute and 25 seconds
......@@ -75,18 +75,6 @@ class SysGrub:
# Rebuild the line
line = 'GRUB_PRELOAD_MODULES="' + ' '.join(modules) + '"\n'
# Check if this is the GRUB_CMDLINE_LINUX line
matches = re.match(r'^\s*GRUB_CMDLINE_LINUX="(?P<cmdline>.*)"', line)
if matches:
# If we can split it into a list
options = matches.group('cmdline').split()
# If we're dealing with a serial console add options
if is_serial:
options.append('console=ttyS%s,%sn8' % (is_serial['unit'], is_serial['speed']))
# Rebuild the line
line = 'GRUB_CMDLINE_LINUX="' + ' '.join(options) + '"\n'
# Write out line
conf_file_new.write(line)
......@@ -97,6 +85,8 @@ class SysGrub:
conf_file_new.write('GRUB_TERMINAL_OUTPUT=serial\n')
conf_file_new.write('GRUB_SERIAL_COMMAND="serial --unit=%s --speed=%s"\n' %
(is_serial['unit'], is_serial['speed']))
conf_file_new.write('GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX console=ttyS%s,%s"\n' %
(is_serial['unit'], is_serial['speed']))
conf_file_new.write('# END - Serial Console\n')
# Close files
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment