Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/livecd-tools:master commit in: init.d/
Date: Sun, 01 May 2011 02:51:28
Message-Id: 5bdfa8ccc47ac834adab356dc0d8dfb184ff1e59.williamH@gentoo
1 commit: 5bdfa8ccc47ac834adab356dc0d8dfb184ff1e59
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 15 22:50:09 2011 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Sun May 1 02:46:14 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/livecd-tools.git;a=commit;h=5bdfa8cc
7
8 split out firmware extraction and hwsetup
9
10 Firmware extraction and hwsetup are now separate services.
11
12 ---
13 init.d/autoconfig | 30 +++++-------------------------
14 init.d/firmware | 22 ++++++++++++++++++++++
15 init.d/hwsetup | 14 ++++++++++++++
16 3 files changed, 41 insertions(+), 25 deletions(-)
17
18 diff --git a/init.d/autoconfig b/init.d/autoconfig
19 index 55fbcfd..e2655a6 100755
20 --- a/init.d/autoconfig
21 +++ b/init.d/autoconfig
22 @@ -272,6 +272,10 @@ list_services() {
23 svcs="${svcs} $(check_svc ${APM} apmd)"
24 svcs="${svcs} $(check_svc ${BRLTTY} brltty)"
25 svcs="${svcs} $(check_svc ${COLDPLUG} coldplug hotplug)"
26 + if yesno "$COLDPLUG" && ! rc-service -e coldplug && ! rc-service -e hotplug
27 + then
28 + echo firmware hwsetup
29 + fi
30 svcs="${svcs} $(check_svc ${GPM} gpm-pre)"
31 svcs="${svcs} $(check_svc ${GPM} gpm)"
32 svcs="${svcs} $(check_svc ${IDEDMA} hdparm)"
33 @@ -287,17 +291,6 @@ list_services() {
34 echo ${svcs}
35 }
36
37 -unpack_firmware() {
38 - # This unpacks any firmware tarballs.
39 - if [ -e /lib/firmware.tar.bz2 ]
40 - then
41 - ebegin "Unpacking firmware"
42 - mkdir -p /lib/firmware
43 - tar xjf /lib/firmware.tar.bz2 -C /lib/firmware
44 - eend 0
45 - fi
46 -}
47 -
48 get_info() {
49 local tmp
50
51 @@ -460,21 +453,8 @@ start() {
52 ewarn "Hardware detection disabled via cmdline ..."
53 fi
54
55 - # Now, we check if we are supposed to run a coldplug script.
56 - if yesno "${COLDPLUG}"
57 + if ! yesno "${COLDPLUG}"
58 then
59 - # Check whether we should be using hotplug/coldplug or whether we should
60 - # just let udev do it all.
61 - # coldplug+hotplug would already be up due to list_services
62 - if ! rc-service -e coldplug && ! rc-service -e hotplug
63 - then
64 - # TODO: This needs to go to a seperate script, so that hwsetup can depend on it.
65 - unpack_firmware
66 - [ -x /sbin/udevtrigger ] && /sbin/udevtrigger
67 - fi
68 - [ -e /etc/sysconfig ] || mkdir -p /etc/sysconfig
69 - [ -x /usr/sbin/hwsetup ] && hwsetup
70 - else
71 ewarn "Hotplug/Coldplug disabled via cmdline ..."
72 fi
73
74
75 diff --git a/init.d/firmware b/init.d/firmware
76 new file mode 100755
77 index 0000000..d65d601
78 --- /dev/null
79 +++ b/init.d/firmware
80 @@ -0,0 +1,22 @@
81 +#!/sbin/runscript
82 +# Copyright 1999-2011 Gentoo Foundation
83 +# Distributed under the terms of the GNU General Public License v2
84 +# $Header: $
85 +
86 +# This unpacks any firmware tarballs.
87 +
88 +depend() {
89 + :
90 +}
91 +
92 +start() {
93 +einfo checking for firmware to unpack
94 + if [ -e /lib/firmware.tar.bz2 ]
95 + then
96 + ebegin "Unpacking firmware"
97 + mkdir -p /lib/firmware
98 + tar xjf /lib/firmware.tar.bz2 -C /lib/firmware
99 + eend 0
100 + fi
101 + [ -x /sbin/udevtrigger ] && /sbin/udevtrigger
102 +}
103
104 diff --git a/init.d/hwsetup b/init.d/hwsetup
105 new file mode 100755
106 index 0000000..aac4db5
107 --- /dev/null
108 +++ b/init.d/hwsetup
109 @@ -0,0 +1,14 @@
110 +#!/sbin/runscript
111 +# Copyright 1999-2011 Gentoo Foundation
112 +# Distributed under the terms of the GNU General Public License v2
113 +# $Header: $
114 +
115 +depend() {
116 + need firmware
117 +}
118 +
119 +start() {
120 + einfo starting hwsetup
121 + [ -e /etc/sysconfig ] || mkdir -p /etc/sysconfig
122 + [ -x /usr/sbin/hwsetup ] && hwsetup
123 +}