summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2011-02-13 13:43:08 -0600
committerWilliam Hubbs <williamh@gentoo.org>2011-04-30 21:46:14 -0500
commit32e81d1a44f3bcce6cc2a23210bd5919ac2c45c2 (patch)
treea7a2093f2de73f8ad94bbdb3e2a8226e1ee88ae8 /init.d/gpm-pre
parentstart xdm from autoconfig (diff)
downloadlivecd-tools-32e81d1a44f3bcce6cc2a23210bd5919ac2c45c2.tar.gz
livecd-tools-32e81d1a44f3bcce6cc2a23210bd5919ac2c45c2.tar.bz2
livecd-tools-32e81d1a44f3bcce6cc2a23210bd5919ac2c45c2.zip
move init.d scripts to a common directory
We have several init.d scripts, and some of the names clash with other parts of the package, so I have moved them to an init.d directory.
Diffstat (limited to 'init.d/gpm-pre')
-rw-r--r--init.d/gpm-pre36
1 files changed, 36 insertions, 0 deletions
diff --git a/init.d/gpm-pre b/init.d/gpm-pre
new file mode 100644
index 0000000..af52b0e
--- /dev/null
+++ b/init.d/gpm-pre
@@ -0,0 +1,36 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# Do one of the following:
+# Add to /etc/rc.conf: rc_gpm_need="autoconfig-gpm-pre"
+# XOR
+# Add to /etc/conf.d/gpm: rc_need="autoconfig-gpm-pre"
+
+depend() {
+ before gpm
+ need hwsetup
+}
+
+start() {
+ # FIXME: If MOUSE_DEVICE is empty, we actually do not want to do anything, not even start gpm.
+ # created by hwsetup
+ source /etc/sysconfig/gentoo
+ source /etc/sysconfig/mouse
+ einfo "Mouse is ${HILITE}${MOUSE_FULLNAME}${NORMAL} at ${HILITE}${MOUSE_DEVICE}${NORMAL} ..."
+
+ if [ $(grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm) ]; then
+ sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
+ else
+ echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
+ fi
+
+ if [ $(grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm) ]; then
+ sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm
+ else
+ echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm
+ fi
+}
+
+# vim: ft=gentoo-init-d: