[PATCH anaconda/rhel7 2/2] Change serial console start string to a variable
d.marlin
dmarlin at redhat.com
Fri Jan 17 19:13:03 UTC 2014
From: "d.marlin" <dmarlin at redhat.com>
Change serial console start string to a variable to support serial consoles
other than those starting with "ttyS", such as ARM (ttyAMA0).
Also, update the Aarch64 packages to include efibootmgr.
Signed-off-by: David A. Marlin <dmarlin at redhat.com>
---
pyanaconda/bootloader.py | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 9ae5e17..5fc014e 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1004,6 +1004,8 @@ class GRUB(BootLoader):
packages = ["grub"]
+ _serial_console = "ttyS"
+
def __init__(self):
super(GRUB, self).__init__()
self.encrypted_password = ""
@@ -1055,9 +1057,14 @@ class GRUB(BootLoader):
return GRUB._config_dir
@property
+ def serial_console(self):
+ """ device prefix for serial console. """
+ return self._serial_console
+
+ @property
def serial_command(self):
command = ""
- if self.console and self.console.startswith("ttyS"):
+ if self.console and self.console.startswith(self.serial_console):
unit = self.console[-1]
command = ["serial"]
s = parse_serial_opt(self.console_options)
@@ -1082,7 +1089,7 @@ class GRUB(BootLoader):
if not self.console:
return
- if self.console.startswith("ttyS"):
+ if self.console.startswith(self.serial_console):
config.write("%s\n" % self.serial_command)
config.write("terminal --timeout=%s serial console\n"
% self.timeout)
@@ -1462,7 +1469,7 @@ class GRUB2(GRUB):
defaults.write("GRUB_DISTRIBUTOR=\"$(sed 's, release .*$,,g' /etc/system-release)\"\n")
defaults.write("GRUB_DEFAULT=saved\n")
defaults.write("GRUB_DISABLE_SUBMENU=true\n")
- if self.console and self.console.startswith("ttyS"):
+ if self.console and self.console.startswith(self.serial_console):
defaults.write("GRUB_TERMINAL=\"serial console\"\n")
defaults.write("GRUB_SERIAL_COMMAND=\"%s\"\n" % self.serial_command)
else:
@@ -1725,10 +1732,13 @@ class EFIGRUB(GRUB2):
def check(self):
return True
-# FIXME: We need to include grubby, and omit efibootmgr and shim packages
+# FIXME: We need to include grubby, and omit the shim package
# on aarch64 until we get all the EFI bits in place.
class Aarch64EFIGRUB(EFIGRUB):
- packages = ["grub2-efi", "grubby"]
+ packages = ["grub2-efi", "efibootmgr", "grubby"]
+
+ _serial_console = "ttyAMA"
+
class MacEFIGRUB(EFIGRUB):
def mactel_config(self):
--
1.8.3.1
More information about the anaconda-patches
mailing list