Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nigel Kukard
idms-linux-installer-package
Commits
7956f170
Commit
7956f170
authored
Jul 28, 2019
by
Nigel Kukard
Browse files
Cleaned up serial handling, make sure all config is in the block
parent
b48ce9b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/idmslinux_installer/util/sysgrub.py
View file @
7956f170
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment