XFree86.dsl automated script for 2 different pc's


Forum: Other Help Topics
Topic: XFree86.dsl automated script for 2 different pc's
started by: Patrick

Posted by Patrick on Dec. 25 2004,18:25
Hello yall,

I am using Xfree86.dsl and it works great. (great job Henk!) Now i need to make a script  (or two) that i can run when i use my usb-stick on a different PC.

First line of this script:

install Xfree86.dsl (i don't know the command to do this)

Got the second line down already:

cp .xserverrcGforce ~/.xserverrc (or) cp .xserverrcX ~/.xserverrc (i use my stick on 2 pc's, one with a Gforce 4 mx videocard and one with a intel videocard (onboard)

Third line:

After copying/changing the .xserverrc i need to exit x/Xfree and go back to the new xserver. I haven't figured out yet how to put this in a script...

Do you know?

Posted by ke4nt1 on Dec. 25 2004,18:55
Patrick:

The command to work for your " install XFree86.dsl would be...

mydsl-load XFree86.dsl

73
ke4nt

Posted by mikshaw on Dec. 25 2004,20:38
You could add 'killall fluxbox' and 'startx', but that's kinda messy in my opinion.
What I'd do is remove 'startx' from .bash_profile, and put it at the end of your script instead.
With this method you'll boot to a console.  Since you plan to shut down fluxbox right after it starts, you're better off just waiting to start it until after xfree is installed.

One script is enough, by the way.  You can pass an argument to it which it uses to decide which xserverrc to use.  Something like this should work:

Code Sample

ARG="$1"
case $ARG in
g|gforce|G|Gforce)
cp ~/.xserverrcGforce ~/.xserverrc
;;
x|X)
cp ~/.xserverrcX ~/.xserverrc
;;
*)
echo "please specify g or x"
exit 0
;;
esac
exec startx


You'd start it with 'scriptname x' or 'scriptname g'

Another thing you can do is put the contents of your rc files into the script rather than backing up and restoring 2 additional files.   With this method you'd use echo or cat with a redirect rather than using cp.  Something like this:
Code Sample

case $ARG in
g|gforce|G|Gforce)
echo "contents of Gforce file" > $HOME/.xserverrc
;;

or
Code Sample

case $ARG in
g|gforce|G|Gforce)
cat << EOF > $HOME/.xserverrc
Some stuff to put in xserverrc.
more stuff.
it will copy everything until it reads this:
EOF
;;

Posted by Patrick on Dec. 26 2004,08:39
I am doing something wrong...
**********************************************
#!/bin/bash
mydsl-load /mnt/hdb8/XFree86.dsl
ARG="$1"
case $ARG in
g|gforce|G|Gforce)
rm ~/.xserverrc
cp /cdrom/keep/scriptjes/.xserverrcGforce ~/.xserverrc
;;
x|X)
rm ~/.xserverrc
cp /cdrom/keep/scriptjes/.xserverrcX ~/.xserverrc
;;
*)
echo "please specify g or x"
exit 0
;;
esac
exec startx
*****************************************************

This script is called "go" and is in my /home/dsl

It doesn't run right (yet)


Any tips?

Posted by mikshaw on Dec. 26 2004,15:37
I don't know yet.  I know that busybox has some different tools than gnu-utils, and as a result I sometimes need to modify my scripts even if they work fine on another system.

Could be rm is failing for some reason.  I'd use 'cp -f' instead.  Or it could be a syntax error that I just don't see.

Are you getting any error messages?  That would help a lot.

Posted by Patrick on Dec. 27 2004,08:50
I have been f&*%ing around with .xserverrc and a script at console-time to change X to XFree86. at first XFree86 worked great. (started the script from within x/fluxbox and after an exit i could enter XFree86/fluxbox) Now i can't get it to work (lots of error message when i startx / XFree86) Haven't got a clue what i am doing wrong now.. ( i don't now how to copy the error messages in the console)
Posted by Patrick on Dec. 27 2004,09:48
Got it to work...

This is my script called "home" that i run when i use the usb-stick at home.

****************
mydsl-load /mnt/hdb8/XFree86.dsl
rm ~/.xserverrc
cp -f /cdrom/keep/scriptjes/.xserverrcGforce ~/.xserverrc
startx
****************

Removed "startx" from ~/.bash_profile

Removed the line: /home/dsl/.xserverrc from the filetool.lst

Now all i have to do is make an other script called "work" and figure out what XFreeconfig-file i have to use with a compaq/HP-pc (evo P2.4 Ghz)

Thnx for all the support you guys..

Posted by henk1955 on Dec. 27 2004,10:21
if you do a:
Code Sample
cat /etc/sysconfig/xserver
or
Code Sample
cat /etc/sysconfig/knoppix
you will see some interesting stuff

Posted by henk1955 on Dec. 27 2004,12:18
maybe you can create a script, i.e configXF86 like
Code Sample
. /etc/sysconfig/xserver

echo "Description=$XDESC"

USEXF86="mydsl-load /mnt/hdb8/XFree86.dsl"

case "$XDESC" in
*"Radeon Mobility 7500"*)
 echo "use ATI Radeon 7500 config"
 $USEXF86
 ln -sf ~/XFree86_config_files/XF86Config-4_mod_radeon7500 /etc/X11/XF86Config-4
 cp -f ~/XFree86_config_files/.xserverrc_for_XF86 ~/.xserverrc
;;

*Radion*)
 echo "use ATI Radeon generic config"
 $USEXF86
 ln -sf ~/XFree86_config_files/XF86Config-4_generic_radeon /etc/X11/XF86Config-4
 cp -f ~/XFree86_config_files/.xserverrc_for_XF86 ~/.xserverrc
;;

*Brookdale*)
 echo "use i810 config"
 $USEXF86
 ln -sf ~/XFree86_config_files/XF86Config-4_generic_i810 /etc/X11/XF86Config-4
 cp -f ~/XFree86_config_files/.xserverrc_for_XF86 ~/.xserverrc
;;

*)
 echo "No XF86Config for your videocard."
 echo "Let's try vesa."
#  $USEXF86
#  ln -sf ~/XFree86_config_files/XF86Config-4_vesa /etc/X11/XF86Config-4
#  cp -f ~/XFree86_config_files/.xserverrc_for_XF86 ~/.xserverrc
;;

esac

and call it from bootlocal.sh

uncomment the last 3 lines if you prefer XFree86 over dsl's XVESA
<edit>
correct mistake, replaced:
ln -sf ~/XFree86_config_files/.xserverrc_for_XF86 ~/.xserverrc
by:
cp -f ~/XFree86_config_files/.xserverrc_for_XF86 ~/.xserverrc
</edit>

TYPO
replaced $USUXF86 to $USEXF86

Posted by Patrick on Dec. 27 2004,12:33
Hello Henk,

First of all thnx for taking away the screaming pitch sound from my 19 " monitor... :-)

Second:

I am thinking about using your script but how do i fit in nvidia.dsl? (got it "working" right now) I am not sure where to put it in the script..

Posted by 9a6or on Feb. 16 2005,23:23
Following on from Patrick's script, below is how I did it:

I created a script with Beaver (DSL text editor) which I saved as "home" to home/dsl
Code Sample

mydsl-load /mnt/sda1/optional/XFree86.dsl
cp -f ~/XFree86_config_files/.xserverrc_for_XF86 ~/.xserverrc
sudo cp -f ~/XFree86_config_files/XF86Config-4_radeon_9600pro /etc/X11/XF86Config-4
startx


(XFree86.dsl was downloaded first to the optional folder on the USB flashdisk ie. /mnt/sda1. As it is run by the script, XFree86 is set up and the XFree86_config_files folder is created. The relevant files are copied to their places and the X is started.)

I made "home" executable by
chmod 755 home

Also, I changed ".bash_profile" in home/dsl (it is a hidden file, click H in emelFM to see it):
Code Sample

#!/bin/bash
export IRCNICK=DSL
SSH=`env | grep SSH_CONNECTION`
# if [ -z "$SSH" ]; then startx; fi
clear
echo "startx ----- start Xvesa GUI"
echo "home   ----- start XFree86 GUI on ATI Radeon"


I added both home/dsl/home and home/dsl/.bash_profile to filetool.lst

Now when I type home DSL starts with XFree86 on my PC with 85Hz refresh rate, and startx runs the default Xvesa on other PCs. The next step is to work out the correct settings for the other PCs I am using and writing similar scripts for them.

To make DSL really portable this was an essential step to take. There must be more elegant ways of doing this but it works and certainly makes me happy :)

Posted by 9a6or on Feb. 17 2005,01:49
Loading multiple extensions leaves sda1 mounted...


I am making a script for running DSL on PCs with NVidia cards including acceleration. For this I have to call
mydsl-load /mnt/sda1/optional/XFree86.dsl  and
mydsl-load /mnt/sda1/optional/nvidia.dsl

Both extensions are read from a USB flashdisk which can run at slow speed only on this PC (USB 1.1). The message I get is:
umount: /mnt/sda1: device is busy

and when X runs sda1 is mounted.

How can I load two extensions so that sda1 remains unmounted afterwards?

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.