Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Dual Head

Posted on 2004-11-27
7
Medium Priority
?
422 Views
Last Modified: 2013-12-06
Hi all

SYSTEM: Fedora Core 3 Heidelberg
DISPLAY CARD: ATI RADEON S300 w 128Mb, VGA, DVI, TVOUT

I can run X in Dual Head mode but only when I do it like this:

>Boot with configuration file (xorg.conf) in single head mode
>login
>change to dual head with system-config-display
>logout
>login


If I happen to forget to put the xorg.conf file back in single head mode before rebooting or if the system hangs and I have to restart manually (power), it WILL not start and I have to use knoppix or the fedora rescue mode to mount the filesystem and replace the xorg.conf file.


This is very annoying and I would like either

>A solution

or

>A hack that can put the xorg.conf in single head mode BEFORE X is started on boot



With kind regards




Ramses (x_terminat_or_3)  *°oO°Make Love Not War°Oo°*
0
Comment
Question by:x_terminat_or_3
  • 4
  • 2
7 Comments
 
LVL 3

Expert Comment

by:jeiler
ID: 12690041
Don't know of a solution but here is a hack that might help...

Create a singlehead_xorg.conf
Create a script in /etc/init.d which copies singlehead_xorg.conf to xorg.conf (cp -f  /etc/X11/singlehead_xorg.conf  /etc/X11/xorg.conf)
Add links to run this script before starting X (ln -s /etc/init.d/copyscript /etc/rc.d/rc5.d/S##copyscript)
You will need to replace ## with a number that makes sense but you are probably safe putting in at the same level as network.

0
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12690294
jeiler


Ooops.... Fedora don't like that

Boot hangs when I do that, maybe because Fedora uses the X-Window system while booting.

For this to work, it should be executed before the booting goes to the graphical mode.

You should know that, as opposed to Red-Hat, Fedora goes to graphical mode during boot to display a progressbar of the global boot process.
0
 
LVL 38

Accepted Solution

by:
wesly_chen earned 1800 total points
ID: 12693034
> If I happen to forget to put the xorg.conf file back in single head mode
> it WILL not start and I have to use knoppix or the fedora rescue mode to mount the filesystem and replace the
> xorg.conf file.
Ctrl+Alt+F1 (F2, F3, F4 .. F6) will give you text mode console.

> opposed to Red-Hat, Fedora goes to graphical mode during boot to display a progressbar of the global boot process.
In /etc/inittab, change
id:5:initdefault:  ====> id:3:initdefault:
And it will boot in to text mode.

>A hack that can put the xorg.conf in single head mode BEFORE X is started on boot
Say you have
/etc/X11/singlehead_xorg.conf  
/etc/X11/dualhead_xorg.conf
and a symbolic link (created later)
/etc/X11/xorg.conf  --> /etc/X11/singlehead_xorg.conf

In /etc/inittab, change
id:5:initdefault:  ====> id:3:initdefault:   <=== Boot in text mode first

Add the following into /etc/rc.d/rc.local
------
rm -f /etc/X11/xorg.conf; ln -s /etc/X11/singlehead_xorg.conf /etc/X11/xorg.conf
init 5   <=== continue to graphic mode
-----

Wesly
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 3

Assisted Solution

by:jeiler
jeiler earned 200 total points
ID: 12695782
I believe the graphical mode during bootup isn't X, it is framebuffer.

Just a thought:
Is it possible the system got updated and the mkinitrd failed to happen?

Anyways, here is an init script that I tested on Fedora Core 3 that you are welcome to try if you haven't found a better solution yet.
#!/bin/sh
#
# singlehead: puts xorg.conf back in single head mode
#
# chkconfig: 5 07 93
# description:  Moves graphics to single head
#
# Source function library.
. /etc/init.d/functions

SINGLE_CONFIG=/etc/X11/singlehead_xorg.conf
MAIN_CONFIG=/etc/X11/xorg.conf

start() {
    # Do not start if there is no config file.
    [ -f "$SINGLE_CONFIG" ] || return 1

    action "Resetting to Single Head Config:" cp -f $SINGLE_CONFIG $MAIN_CONFIG
}

stop() {
    # Nothing to do in in stop.
    return 0
}

case "$1" in
    start)
        start
        RETVAL=$?
        ;;
    stop)
        stop
        RETVAL=$?
        ;;
    *)
        echo $"Usage: $0 {start|stop}"
        exit 1
        ;;
esac

exit $RETVAL
0
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12695850
< I believe the graphical mode during bootup isn't X, it is framebuffer. >

Maybe so, but it definitly uses the xorg config file because the 2nd monitor is blacked-out if the system is in dualhead mode, and a clone of monitor 1 if the system is in singlehead mode.  Which means that framebuffer or X, it uses xorg.conf


Anyway, I'm going to do a test in a few hours...
0
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12697271
Guys,


I made a little mistake in rc.local

I put in

echo -n "Putting system in singlehead
rm .. blabla
echo  " done"

And it so happened that it was interpreted by echo

This means that:

The FIX to the problem I was having is:
==================================
In /etc/inittab, change
id:5:initdefault:  ====> id:3:initdefault:
Add the following into /etc/rc.d/rc.local
init 5   <=== continue to graphic mode
==================================



Thanks Wesley.  the system boots correctly now, regardless of single head or multihead in xorg.conf


>thank you also jeiler for your participation

0
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12697306
I meant that the file was not deleted because the command 'rm -f xorg.conf: ls -s xorg.config.singlehead xorg.conf  was not executed by the system but interpreted by the ECHO command.  It means that my system booted correctly with dualhead mode activated.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month21 days, 2 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question