Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/livecd-tools:bl2-only commit in: /, autoconfig-init.d-addons/
Date: Thu, 10 Feb 2011 21:11:18
Message-Id: 619787709641e3c9a800354497f0da01fe3cc792.robbat2@gentoo
1 commit: 619787709641e3c9a800354497f0da01fe3cc792
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 10 21:05:50 2011 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 10 21:05:50 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/livecd-tools.git;a=commit;h=61978770
7
8 Add conversion of GPM as first example for BL2 work.
9
10 ---
11 autoconfig | 24 ++---------------
12 autoconfig-init.d-addons/autoconfig-gpm-pre | 36 +++++++++++++++++++++++++++
13 2 files changed, 39 insertions(+), 21 deletions(-)
14
15 diff --git a/autoconfig b/autoconfig
16 index df96d59..2d5ef86 100755
17 --- a/autoconfig
18 +++ b/autoconfig
19 @@ -504,29 +504,11 @@ start() {
20 [ -f /etc/sysconfig/gentoo ] && source /etc/sysconfig/gentoo
21
22 # Mouse
23 + # FIXME: If MOUSE_DEVICE is empty, we actually do not want to do anything, not even start gpm.
24 if [ -n "${MOUSE_DEVICE}" ]
25 then
26 - einfo "Mouse is ${HILITE}${MOUSE_FULLNAME}${NORMAL} at ${HILITE}${MOUSE_DEVICE}${NORMAL} ..."
27 - source /etc/sysconfig/mouse
28 - if [ -x /usr/sbin/gpm ]
29 - then
30 - if [ $(grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm) ]
31 - then
32 - sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
33 - else
34 - echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
35 - fi
36 -
37 - if [ $(grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm) ]
38 - then
39 - sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm
40 - else
41 - echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm
42 - fi
43 -
44 - [ "${GPM}" = "yes" ] \
45 - && [ -x /etc/init.d/gpm ] && /etc/init.d/gpm start
46 - fi
47 + :
48 + # Migrated to autoconfig-gpm-pre
49 fi
50
51 [ "${DETECT}" = "no" ] && DHCP="no"
52
53 diff --git a/autoconfig-init.d-addons/autoconfig-gpm-pre b/autoconfig-init.d-addons/autoconfig-gpm-pre
54 new file mode 100644
55 index 0000000..af52b0e
56 --- /dev/null
57 +++ b/autoconfig-init.d-addons/autoconfig-gpm-pre
58 @@ -0,0 +1,36 @@
59 +#!/sbin/runscript
60 +# Copyright 1999-2011 Gentoo Foundation
61 +# Distributed under the terms of the GNU General Public License v2
62 +# $Header: $
63 +
64 +# Do one of the following:
65 +# Add to /etc/rc.conf: rc_gpm_need="autoconfig-gpm-pre"
66 +# XOR
67 +# Add to /etc/conf.d/gpm: rc_need="autoconfig-gpm-pre"
68 +
69 +depend() {
70 + before gpm
71 + need hwsetup
72 +}
73 +
74 +start() {
75 + # FIXME: If MOUSE_DEVICE is empty, we actually do not want to do anything, not even start gpm.
76 + # created by hwsetup
77 + source /etc/sysconfig/gentoo
78 + source /etc/sysconfig/mouse
79 + einfo "Mouse is ${HILITE}${MOUSE_FULLNAME}${NORMAL} at ${HILITE}${MOUSE_DEVICE}${NORMAL} ..."
80 +
81 + if [ $(grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm) ]; then
82 + sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
83 + else
84 + echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
85 + fi
86 +
87 + if [ $(grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm) ]; then
88 + sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm
89 + else
90 + echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm
91 + fi
92 +}
93 +
94 +# vim: ft=gentoo-init-d: