summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2012-10-03 09:09:48 -0500
committerWilliam Hubbs <williamh@gentoo.org>2012-10-03 09:09:48 -0500
commit476fe7f59765f889d010c507f1142d48b724d60b (patch)
tree39352906926a0918b6b609804a34fde50c4b4b48
parentfurther cosmetic cleanups (diff)
downloadlivecd-tools-476fe7f59765f889d010c507f1142d48b724d60b.tar.gz
livecd-tools-476fe7f59765f889d010c507f1142d48b724d60b.tar.bz2
livecd-tools-476fe7f59765f889d010c507f1142d48b724d60b.zip
gpm-pre: fix sourcing of hwsetup settings
Source the files only if they exist. Also, warn if a mouse was not detected. The gpm init script already detects if a mouse isn't configured and refuses to start, which is what we want. X-Gentoo-Bug: 408533 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=408533
-rwxr-xr-xinit.d/gpm-pre10
1 files changed, 6 insertions, 4 deletions
diff --git a/init.d/gpm-pre b/init.d/gpm-pre
index f44e5c2..ef97e38 100755
--- a/init.d/gpm-pre
+++ b/init.d/gpm-pre
@@ -9,10 +9,12 @@ depend() {
}
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
+ [ -f /etc/sysconfig/gentoo ] && source /etc/sysconfig/gentoo
+ [ -f /etc/sysconfig/mouse ] && source /etc/sysconfig/mouse
+ if [ -z "${MOUSE_DEVICE}" ]; then
+ ewarn "No mouse detected. GPM will not be started."
+ return 0
+ fi
einfo "Mouse is ${HILITE}${MOUSE_FULLNAME}${NORMAL} at ${HILITE}${MOUSE_DEVICE}${NORMAL} ..."
if [ $(grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm) ]; then