1 | <sect2>
|
---|
2 | <title>Configuring gpm</title>
|
---|
3 |
|
---|
4 | <sect3><title>gpm init.d script</title>
|
---|
5 | <para>The gpm init.d script can be created using the following
|
---|
6 | commands: (This assumes that you have followed the LFS default of
|
---|
7 | having your $rc_base set to <filename
|
---|
8 | class="directory">/etc/rc.d</filename>)</para>
|
---|
9 | <para><screen><userinput>cat > /etc/rc.d/init.d/gpm << "EOF"</userinput>
|
---|
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
|
---|
60 | <userinput>EOF
|
---|
61 | chmod 755 /etc/rc.d/init.d/gpm</userinput></screen></para>
|
---|
62 |
|
---|
63 | <para>You then need to create symbolic links to this file in the relevant rc.d
|
---|
64 | directories. For example:
|
---|
65 | <screen><userinput>cd /etc/rc.d/init.d &&
|
---|
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 &&
|
---|
72 | ln -sf ../init.d/gpm ../rc6.d/K10gpm</userinput></screen></para></sect3>
|
---|
73 |
|
---|
74 | <sect3><title>Config files</title>
|
---|
75 | <para><userinput>/etc/sysconfig/mouse</userinput>
|
---|
76 | This file contains the name of your mouse device and the protocol which
|
---|
77 | it uses. To create this file, run the following:</para>
|
---|
78 |
|
---|
79 | <para><screen><userinput>cat > /etc/sysconfig/mouse << "EOF"</userinput>
|
---|
80 | # start /etc/sysconfig/mouse
|
---|
81 | MDEVICE=yourdevice
|
---|
82 | PROTOCOL=yourprotocol
|
---|
83 | # end /etc/sysconfig/mouse
|
---|
84 | <userinput>EOF</userinput></screen></para>
|
---|
85 | </sect3>
|
---|
86 |
|
---|
87 | <sect3><title>Configuration Information</title>
|
---|
88 |
|
---|
89 | <para>Examples of values to set MDEVICE and PROTOCOL to are</para>
|
---|
90 |
|
---|
91 | <para><screen>MDEVICE=/dev/psaux
|
---|
92 | PROTOCOL=imps2</screen></para>
|
---|
93 |
|
---|
94 | <para>A list of which protocol values are known can be found by running
|
---|
95 | <userinput>gpm -t -help</userinput>. Your MDEVICE setting depends on
|
---|
96 | which type of mouse you have. For example,
|
---|
97 | <userinput>/dev/ttyS0</userinput> for a serial mouse (on Windows this is
|
---|
98 | COM1), <userinput>/dev/input/mice</userinput> is often used for USB mice
|
---|
99 | and <userinput>/dev/psaux</userinput> for PS2 mice. It is normally
|
---|
100 | thought not a good idea to link /dev/mouse to the relevant device, but
|
---|
101 | instead to reference it directly.</para>
|
---|
102 |
|
---|
103 | </sect3>
|
---|
104 |
|
---|
105 | </sect2>
|
---|
106 |
|
---|