[f45b1953] | 1 | <sect2>
|
---|
[04a28bc] | 2 | <title>Configuring <application><acronym>GPM</acronym></application></title>
|
---|
[f45b1953] | 3 |
|
---|
| 4 | <sect3><title>gpm init.d script</title>
|
---|
[04a28bc] | 5 | <para>The <command>gpm</command> init.d script can be created using
|
---|
| 6 | the following commands: <!-- (This assumes that you have followed the
|
---|
[2be20f1b] | 7 | <acronym>LFS</acronym> default of having your $rc_base set to <filename
|
---|
[04a28bc] | 8 | class="directory">/etc/rc.d</filename>) --></para>
|
---|
[2be20f1b] | 9 | <screen><userinput><command>cat > /etc/rc.d/init.d/gpm << "EOF"</command>
|
---|
[f45b1953] | 10 | #!/bin/sh
|
---|
| 11 | # Begin $rc_base/init.d/gpm
|
---|
| 12 |
|
---|
| 13 | # Based on sysklogd script from LFS-3.1 and earlier.
|
---|
| 14 | # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
---|
| 15 | # GPM specific parts by Mark Hymers - markh@linuxfromscratch.org
|
---|
| 16 |
|
---|
| 17 | source /etc/sysconfig/rc
|
---|
| 18 | source $rc_functions
|
---|
| 19 |
|
---|
| 20 | if [ -f /etc/sysconfig/mouse ]
|
---|
| 21 | then
|
---|
| 22 | source /etc/sysconfig/mouse
|
---|
| 23 | fi
|
---|
| 24 |
|
---|
| 25 | if [ -z "$MDEVICE" ] || [ -z "$PROTOCOL" ]
|
---|
| 26 | then
|
---|
| 27 | echo "Please create an /etc/sysconfig/mouse file containing"
|
---|
| 28 | echo "MDEVICE and PROTOCOL values"
|
---|
| 29 | exit 1;
|
---|
| 30 | fi
|
---|
| 31 |
|
---|
| 32 | case "$1" in
|
---|
| 33 | start)
|
---|
| 34 | echo "Starting gpm..."
|
---|
| 35 | loadproc gpm -m $MDEVICE -t $PROTOCOL
|
---|
| 36 | ;;
|
---|
| 37 |
|
---|
| 38 | stop)
|
---|
| 39 | echo "Stopping gpm..."
|
---|
| 40 | killproc gpm
|
---|
| 41 | ;;
|
---|
| 42 |
|
---|
| 43 | restart)
|
---|
| 44 | $0 stop
|
---|
| 45 | sleep 1
|
---|
| 46 | $0 start
|
---|
| 47 | ;;
|
---|
| 48 |
|
---|
| 49 | status)
|
---|
| 50 | statusproc gpm
|
---|
| 51 | ;;
|
---|
| 52 |
|
---|
| 53 | *)
|
---|
| 54 | echo "Usage: $0 {start|stop|restart|status}"
|
---|
| 55 | exit 1
|
---|
| 56 | ;;
|
---|
| 57 | esac
|
---|
| 58 |
|
---|
| 59 | # End $rc_base/init.d/gpm
|
---|
[2be20f1b] | 60 | <command>EOF
|
---|
| 61 | chmod 755 /etc/rc.d/init.d/gpm</command></userinput></screen>
|
---|
[f45b1953] | 62 |
|
---|
[04a28bc] | 63 | <para>You then need to create symbolic links to this file in the
|
---|
[a75063d4] | 64 | relevant <filename>rc.d</filename> directories. For example:</para>
|
---|
[2be20f1b] | 65 | <screen><userinput><command>cd /etc/rc.d/init.d &&
|
---|
[f45b1953] | 66 | ln -sf ../init.d/gpm ../rc0.d/K10gpm &&
|
---|
| 67 | ln -sf ../init.d/gpm ../rc1.d/K10gpm &&
|
---|
| 68 | ln -sf ../init.d/gpm ../rc2.d/K10gpm &&
|
---|
| 69 | ln -sf ../init.d/gpm ../rc3.d/S70gpm &&
|
---|
| 70 | ln -sf ../init.d/gpm ../rc4.d/S70gpm &&
|
---|
| 71 | ln -sf ../init.d/gpm ../rc5.d/S70gpm &&
|
---|
[a75063d4] | 72 | ln -sf ../init.d/gpm ../rc6.d/K10gpm</command></userinput></screen>
|
---|
| 73 | </sect3>
|
---|
[f45b1953] | 74 |
|
---|
| 75 | <sect3><title>Config files</title>
|
---|
[064db32a] | 76 | <para><filename>/etc/sysconfig/mouse</filename>
|
---|
[f45b1953] | 77 | This file contains the name of your mouse device and the protocol which
|
---|
| 78 | it uses. To create this file, run the following:</para>
|
---|
| 79 |
|
---|
[2be20f1b] | 80 | <screen><userinput><command>cat > /etc/sysconfig/mouse << "EOF"</command>
|
---|
[f45b1953] | 81 | # start /etc/sysconfig/mouse
|
---|
[a75063d4] | 82 | MDEVICE=<replaceable>[yourdevice]</replaceable>
|
---|
| 83 | PROTOCOL=<replaceable>[yourprotocol]</replaceable>
|
---|
[f45b1953] | 84 | # end /etc/sysconfig/mouse
|
---|
[2be20f1b] | 85 | <command>EOF</command></userinput></screen>
|
---|
[f45b1953] | 86 | </sect3>
|
---|
| 87 |
|
---|
| 88 | <sect3><title>Configuration Information</title>
|
---|
| 89 |
|
---|
[2be20f1b] | 90 | <para>Examples of values to set <envar>MDEVICE</envar> and
|
---|
| 91 | <envar>PROTOCOL</envar> to are</para>
|
---|
[f45b1953] | 92 |
|
---|
[2be20f1b] | 93 | <screen><userinput>MDEVICE=/dev/psaux
|
---|
| 94 | PROTOCOL=imps2</userinput></screen>
|
---|
[f45b1953] | 95 |
|
---|
| 96 | <para>A list of which protocol values are known can be found by running
|
---|
[2be20f1b] | 97 | <command>gpm -t -help</command>. Your <envar>MDEVICE</envar> setting depends on
|
---|
[f45b1953] | 98 | which type of mouse you have. For example,
|
---|
[8a0cee4] | 99 | <filename>/dev/ttyS0</filename> for a serial mouse (on Windows this is
|
---|
[2be20f1b] | 100 | COM1), <filename>/dev/input/mice</filename> is often used for
|
---|
| 101 | <acronym>USB</acronym> mice
|
---|
| 102 | and <filename>/dev/psaux</filename> for <acronym>PS2</acronym> mice. It is normally
|
---|
[8a0cee4] | 103 | thought not a good idea to link <filename>/dev/mouse</filename> to the relevant device, but
|
---|
[f45b1953] | 104 | instead to reference it directly.</para>
|
---|
| 105 |
|
---|
| 106 | </sect3>
|
---|
| 107 |
|
---|
| 108 | </sect2>
|
---|