FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Design Team

 
 
LinkBack Thread Tools
 
Old 11-15-2011, 06:26 PM
Will Woods
 
Default loader/serial.c: use 'weird' serial devices if present (#752596)

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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 05:37 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org