[PATCH 1/2] loader/serial.c: use 'weird' serial devices if present (#752596)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



loader has some magic code to switch its controlling terminal to a
serial device, under certain circumstances. In F15 and earlier, it
worked basically like this:

 1. if a 'weird' serial device (xvc0, hvc0, hvsi[0-2]) exists, use that
 2. else if /dev/console is actually a serial device, use that
 3. else if 'serial' was on the boot cmdline, use ttyS0
 4. else use tty1

Commit 422702a3 refactored the serial handling into its own file, and
accidentally changed this behavior so that the serial devices were only
checked if 'serial' was on the commandline. This should restore the
previous behavior.
---
 loader/serial.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/loader/serial.c b/loader/serial.c
index c4b722a..cb8b3ee 100644
--- a/loader/serial.c
+++ b/loader/serial.c
@@ -114,15 +114,17 @@ static int get_serial_fd() {
 
     restore_mode(&orig_cmode);
 
+    /* check to see if /dev/console is actually a serial device */
     if (fd < 0 && ioctl(0, TIOCLINUX, &twelve) < 0) {
         console = "/dev/console";
 
         if (ioctl(0, TIOCGSERIAL, &si) == -1)
             console = NULL;
     }
-    else
+    else if (serial_requested())
         console = "/dev/ttyS0";
 
+    /* get an fd for the console if we don't already have one */
     if (console && !weird) {
         fd = open(console, O_RDWR, 0);
         if (fd < 0)
@@ -161,7 +163,7 @@ void init_serial(struct termios *orig_cmode, int *orig_flags, GHashTable *cmdlin
      */
     get_mode_and_flags(orig_cmode, orig_flags);
 
-    if (!serial_requested(cmdline) || (fd = get_serial_fd()) == -1) {
+    if ((fd = get_serial_fd()) == -1) {
         /* This is not a serial console install. */
         if ((fd = open("/dev/tty1", O_RDWR, 0)) < 0) {
             if ((fd = open("/dev/vc/1", O_RDWR, 0)) < 0) {
-- 
1.7.7.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux