[PATCH anaconda:rhel7/master v2] Change the string used to test for serial console (#1054951)
Vratislav Podzimek
vpodzime at redhat.com
Wed Jan 29 12:57:36 UTC 2014
On Tue, 2014-01-28 at 11:41 -0600, d.marlin wrote:
> The string used to test for serial console is a literal ("ttyS"). To support
> serial consoles other than those starting with "ttyS", such as ttyAMA0 for ARM,
> create a list of string values that may be used. Add a property to test if
> the console device starts with any of these strings.
>
> Note: 64-bit ARM (aarch64) hardware may use either ttyS0 or ttyAMA0 for the
> serial console. The Foundation Model simulator currently uses ttyAMA0.
>
> Resolves: rhbz#1054951
>
> Signed-off-by: David A. Marlin <dmarlin at redhat.com>
> ---
> pyanaconda/bootloader.py | 20 +++++++++++++++++---
> 1 files changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
> index 1fe292f..80a0e5b 100644
> --- a/pyanaconda/bootloader.py
> +++ b/pyanaconda/bootloader.py
> @@ -1004,6 +1004,8 @@ class GRUB(BootLoader):
>
> packages = ["grub"]
>
> + _serial_consoles = ["ttyS"]
> +
> def __init__(self):
> super(GRUB, self).__init__()
> self.encrypted_password = ""
> @@ -1055,9 +1057,18 @@ class GRUB(BootLoader):
> return GRUB._config_dir
>
> @property
> + def has_serial_console(self):
> + """ true if the console is a serial console. """
> + for _console in self._serial_consoles:
> + if self.console.startswith(_console):
> + return True
> + return False
Pushed to master. I've just replaced the 4 lines above with
return any(self.console.startswith(sconsole)
for sconsole in self._serial_consoles)
Thanks!
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list