glfs/general/sysutils/gpm/gpm-config.xml

109 lines
3.3 KiB
XML
Raw Normal View History

<sect2>
<title>Configuring <application>gpm</application></title>
<sect3><title>gpm init.d script</title>
<para>The <application>gpm</application> init.d script can be created using
the following commands: (This assumes that you have followed the
<acronym>LFS</acronym> default of having your $rc_base set to <filename
class="directory">/etc/rc.d</filename>)</para>
<screen><userinput><command>cat &gt; /etc/rc.d/init.d/gpm &lt;&lt; "EOF"</command>
#!/bin/sh
# Begin $rc_base/init.d/gpm
# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
# GPM specific parts by Mark Hymers - markh@linuxfromscratch.org
source /etc/sysconfig/rc
source $rc_functions
if [ -f /etc/sysconfig/mouse ]
then
source /etc/sysconfig/mouse
fi
if [ -z "$MDEVICE" ] || [ -z "$PROTOCOL" ]
then
echo "Please create an /etc/sysconfig/mouse file containing"
echo "MDEVICE and PROTOCOL values"
exit 1;
fi
case "$1" in
start)
echo "Starting gpm..."
loadproc gpm -m $MDEVICE -t $PROTOCOL
;;
stop)
echo "Stopping gpm..."
killproc gpm
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
statusproc gpm
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
# End $rc_base/init.d/gpm
<command>EOF
chmod 755 /etc/rc.d/init.d/gpm</command></userinput></screen>
<para>You then need to create symbolic links to this file in the relevant rc.d
directories. For example:
<screen><userinput><command>cd /etc/rc.d/init.d &amp;&amp;
ln -sf ../init.d/gpm ../rc0.d/K10gpm &amp;&amp;
ln -sf ../init.d/gpm ../rc1.d/K10gpm &amp;&amp;
ln -sf ../init.d/gpm ../rc2.d/K10gpm &amp;&amp;
ln -sf ../init.d/gpm ../rc3.d/S70gpm &amp;&amp;
ln -sf ../init.d/gpm ../rc4.d/S70gpm &amp;&amp;
ln -sf ../init.d/gpm ../rc5.d/S70gpm &amp;&amp;
ln -sf ../init.d/gpm ../rc6.d/K10gpm</command></userinput></screen></para></sect3>
<sect3><title>Config files</title>
<para><filename>/etc/sysconfig/mouse</filename>
This file contains the name of your mouse device and the protocol which
it uses. To create this file, run the following:</para>
<screen><userinput><command>cat &gt; /etc/sysconfig/mouse &lt;&lt; "EOF"</command>
# start /etc/sysconfig/mouse
MDEVICE=yourdevice
PROTOCOL=yourprotocol
# end /etc/sysconfig/mouse
<command>EOF</command></userinput></screen>
</sect3>
<sect3><title>Configuration Information</title>
<para>Examples of values to set <envar>MDEVICE</envar> and
<envar>PROTOCOL</envar> to are</para>
<screen><userinput>MDEVICE=/dev/psaux
PROTOCOL=imps2</userinput></screen>
<para>A list of which protocol values are known can be found by running
<command>gpm -t -help</command>. Your <envar>MDEVICE</envar> setting depends on
which type of mouse you have. For example,
<filename>/dev/ttyS0</filename> for a serial mouse (on Windows this is
COM1), <filename>/dev/input/mice</filename> is often used for
<acronym>USB</acronym> mice
and <filename>/dev/psaux</filename> for <acronym>PS2</acronym> mice. It is normally
thought not a good idea to link <filename>/dev/mouse</filename> to the relevant device, but
instead to reference it directly.</para>
</sect3>
</sect2>