Subversion Repositories livecd

Rev

Rev 48 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 48 Rev 71
Line 14... Line 14...
14
 
14
 
15
# source functions
15
# source functions
16
. /$MOUNTDIR/live/liblinuxlive
16
. /$MOUNTDIR/live/liblinuxlive
17
. /etc/init.d/functions
17
. /etc/init.d/functions
18
 
18
 
-
 
19
# defaults for xorg.conf
-
 
20
XORG_CONF=/etc/X11/xorg.conf
-
 
21
HSYNC_DEFAULT="30.0-80.0"
-
 
22
VSYNC_DEFAULT="50.0-90.0"
-
 
23
SCREEN_DEFAULT="1280x1024"
-
 
24
MODES_DEFAULT='"2048x1536" "1920x1200" "1600x1200" "1400x1050" "1280x1024" "1280x960" "1280x800" "1152x864" "1152x768" "1024x768" "800x600" "640x480"'
-
 
25
 
19
 
26
 
20
### -----------------------------------------------------------
27
### -----------------------------------------------------------
21
### Get boot parameters
28
### Get boot parameters
22
### -----------------------------------------------------------
29
### -----------------------------------------------------------
23
 
30
 
Line 286... Line 293...
286
 
293
 
287
### configure Xserver
294
### configure Xserver
288
 
295
 
289
### check for xorg.conf in CONFIG_FOLDER
296
### check for xorg.conf in CONFIG_FOLDER
290
if [ -r $CONFIG_FOLDER/xorg.conf ]; then
297
if [ -r $CONFIG_FOLDER/xorg.conf ]; then
291
    cp -af $CONFIG_FOLDER/xorg.conf /etc/X11/xorg.conf
298
    cp -af $CONFIG_FOLDER/xorg.conf $XORG_CONF
292
    if [ "$?" = "0" ]; then
299
    if [ "$?" = "0" ]; then
293
	echo "Saved xorg.conf file found."
300
	echo "Saved xorg.conf file found."
294
	XDRIVER=""
301
	XDRIVER=""
295
	HAVE_XORG_CONF="yes"
302
	HAVE_XORG_CONF="yes"
296
    fi
303
    fi
Line 308... Line 315...
308
if [ $XDRIVER ]; then
315
if [ $XDRIVER ]; then
309
    echo "Force to use $XDRIVER driver!"
316
    echo "Force to use $XDRIVER driver!"
310
    video_driver="--set-driver=$XDRIVER"
317
    video_driver="--set-driver=$XDRIVER"
311
fi
318
fi
312
 
319
 
313
### run system-config-display
320
### configure Xserver
314
if [ -x /usr/bin/system-config-display ]; then
321
if [ -x /usr/bin/system-config-display ]; then
315
    echo "Configure Xserver:"
322
    echo "Configure Xserver:"
316
    if [ ! $HAVE_XORG_CONF ]; then
323
    if [ ! $HAVE_XORG_CONF ]; then
317
	if [ ! $SIMPLEX ]; then
324
	if [ ! $SIMPLEX ]; then
-
 
325
 
318
            # default values
326
            # default values
319
	    [ ! $HSYNC ] && HSYNC="30.0-80.0"
327
	    [ ! $HSYNC ]  && HSYNC="$HSYNC_DEFAULT"
320
	    [ ! $VSYNC ] && VSYNC="50.0-90.0"
328
	    [ ! $VSYNC ]  && VSYNC="$VSYNC_DEFAULT"
321
	    [ ! $SCREEN ] && SCREEN="1280x1024"
329
	    [ ! $SCREEN ] && SCREEN="$SCREEN_DEFAULT"
322
    
330
	    
-
 
331
            # run system-config-display 
323
	    system-config-display \
332
	    system-config-display \
324
		--reconfig \
333
		--reconfig \
325
                -v \
334
                -v \
326
		--set-resolution=$SCREEN \
335
		--set-resolution=$SCREEN \
327
		--set-hsync=$HSYNC \
336
		--set-hsync=$HSYNC \
328
		--set-vsync=$VSYNC \
337
		--set-vsync=$VSYNC \
329
		$video_driver | grep Trying
338
		$video_driver | grep Trying
-
 
339
 
-
 
340
            # system-config-display in SL5 does not really work :-(
-
 
341
            # e.g. no Monitor and resolution set
-
 
342
 
-
 
343
	    # add Monitor Section and add Monitor0 to Screen Section
-
 
344
	    grep -q Monitor $XORG_CONF
-
 
345
	    if [ "$" != "0" ]; then
-
 
346
		echo    "Section \"Monitor\""          >> $XORG_CONF
-
 
347
		echo -e "\tIdentifier   \"Monitor0\""  >> $XORG_CONF
-
 
348
		echo -e "\tHorizSync    $HSYNC"        >> $XORG_CONF
-
 
349
		echo -e "\tVertRefresh  $VSYNC"        >> $XORG_CONF
-
 
350
		echo -e "\tOption       \"dpms\""      >> $XORG_CONF
-
 
351
		echo -e "EndSection"                   >> $XORG_CONF
-
 
352
                sed -i "s|Device     \"Videocard0\"|Device     \"Videocard0\"\n\tMonitor    \"Monitor0\"|" $XORG_CONF
-
 
353
	    fi
-
 
354
 
-
 
355
            # add Modes for $SCREEN
-
 
356
	    grep -q Modes $XORG_CONF
-
 
357
	    if [ "$" != "0" ]; then
-
 
358
		modeline=$( echo ${MODES_DEFAULT} | sed "s|.*\"$SCREEN|\"$SCREEN|" )
-
 
359
		if [ "$modeline" ]; then
-
 
360
		    sed -i "s|\tDepth.*|\tDepth     24\n\t\tModes $modeline|" $XORG_CONF
-
 
361
		fi
-
 
362
	    fi
-
 
363
 
-
 
364
	# simple Xserver configuration.
330
	else
365
	else
331
	    echo "Use simple Xserver configuration."
366
	    echo "Use simple Xserver configuration."
332
	    system-config-display --noui --reconfig -v | grep Trying
367
	    system-config-display --noui --reconfig -v | grep Trying
333
	fi
368
	fi
334
    fi
369
    fi
335
fi
370
fi
336
 
371
 
-
 
372
 
337
### enable NVIDIA driver (needs nvidia, nvidia-libs rpms)
373
### enable NVIDIA driver (needs nvidia, nvidia-libs rpms)
338
if [ $NVIDIA ] && [ ! $NONVIDIA ]; then
374
if [ $NVIDIA ] && [ ! $NONVIDIA ]; then
339
    # serach for Nvidia Video Card
375
    # serach for Nvidia Video Card
340
    /sbin/lspci | grep VGA | grep -i -q nvidia
376
    /sbin/lspci | grep VGA | grep -i -q nvidia
341
    if [ "$?" = "0" ]; then
377
    if [ "$?" = "0" ]; then
Line 373... Line 409...
373
     /^[ \t]*Option[ \t]*\"Clone/d
409
     /^[ \t]*Option[ \t]*\"Clone/d
374
     /EndSection/i\\
410
     /EndSection/i\\
375
        Option      \"MonitorLayout\" \"CRT,LFP\"\\
411
        Option      \"MonitorLayout\" \"CRT,LFP\"\\
376
        Option      \"Clone\" \"1\"\\
412
        Option      \"Clone\" \"1\"\\
377
        Option      \"CloneRefresh\" \"60\"
413
        Option      \"CloneRefresh\" \"60\"
378
     }" -i /etc/X11/xorg.conf
414
     }" -i $XORG_CONF
379
fi
415
fi
380
 
416
 
381
# Set BoardName for Intel 915GM
417
# Set BoardName for Intel 915GM
382
if [ $I915GM ]; then
418
if [ $I915GM ]; then
383
    sed -i 's/BoardName.*VESA driver.*/BoardName   "Intel 915"/' /etc/X11/xorg.conf
419
    sed -i 's/BoardName.*VESA driver.*/BoardName   "Intel 915"/' $XORG_CONF
384
fi
420
fi
385
 
421
 
386
 
422
 
387
### parameter KB = KEYBOARD
423
### parameter KB = KEYBOARD
388
KEYBOARD=$KB
424
KEYBOARD=$KB
Line 567... Line 603...
567
### some magic: just access this file in order that it can be sourced later
603
### some magic: just access this file in order that it can be sourced later
568
ls -lag /etc/X11/xinit/xinitrc-common >/dev/null 2>&1
604
ls -lag /etc/X11/xinit/xinitrc-common >/dev/null 2>&1
569
sleep 1
605
sleep 1
570
 
606
 
571
### set keyboard for rdesktop
607
### set keyboard for rdesktop
572
if [ -e /etc/X11/xorg.conf ]; then
608
if [ -e $XORG_CONF ]; then
573
    grep -q de_CH /etc/X11/xorg.conf && RDESKTOP_OPT="-k de-ch"
609
    grep -q de_CH $XORG_CONF && RDESKTOP_OPT="-k de-ch"
574
    grep -q fr_CH /etc/X11/xorg.conf && RDESKTOP_OPT="-k fr-ch"
610
    grep -q fr_CH $XORG_CONF && RDESKTOP_OPT="-k fr-ch"
575
    grep -q jp106 /etc/X11/xorg.conf && RDESKTOP_OPT="-k ja"
611
    grep -q jp106 $XORG_CONF && RDESKTOP_OPT="-k ja"
576
fi
612
fi
577
 
613
 
578
if [ "$RDESKTOP_OPT" ]; then
614
if [ "$RDESKTOP_OPT" ]; then
579
    echo "alias rdesktop='rdesktop $RDESKTOP_OPT'" > /etc/profile.d/rdesktop.sh
615
    echo "alias rdesktop='rdesktop $RDESKTOP_OPT'" > /etc/profile.d/rdesktop.sh
580
    echo "export RDESKTOP_OPT='$RDESKTOP_OPT'" >> /etc/profile.d/rdesktop.sh
616
    echo "export RDESKTOP_OPT='$RDESKTOP_OPT'" >> /etc/profile.d/rdesktop.sh