Gentoo Archives: gentoo-commits

From: "Matthias Schwarzott (zzam)" <zzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-fs/udev: ChangeLog udev-130-r2.ebuild
Date: Tue, 28 Oct 2008 21:59:09
Message-Id: E1Kuwaf-0006Gi-DZ@stork.gentoo.org
1 zzam 08/10/28 21:59:05
2
3 Modified: ChangeLog
4 Added: udev-130-r2.ebuild
5 Log:
6 Add udev init-script for new, not yet in tree, openrc-versions (>0.3.0), Bug #240984.
7 (Portage version: 2.2_rc12/cvs/Linux 2.6.27-gentoo i686)
8
9 Revision Changes Path
10 1.413 sys-fs/udev/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.413&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.413&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?r1=1.412&r2=1.413
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v
19 retrieving revision 1.412
20 retrieving revision 1.413
21 diff -u -r1.412 -r1.413
22 --- ChangeLog 9 Oct 2008 08:56:42 -0000 1.412
23 +++ ChangeLog 28 Oct 2008 21:59:05 -0000 1.413
24 @@ -1,6 +1,14 @@
25 # ChangeLog for sys-fs/udev
26 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.412 2008/10/09 08:56:42 zzam Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.413 2008/10/28 21:59:05 zzam Exp $
29 +
30 +*udev-130-r2 (28 Oct 2008)
31 +
32 + 28 Oct 2008; Matthias Schwarzott <zzam@g.o>
33 + +files/udev-postmount-130-r2.initd, +files/udev.initd,
34 + +udev-130-r2.ebuild:
35 + Add udev init-script for new, not yet in tree, openrc-versions (>0.3.0),
36 + Bug #240984.
37
38 *udev-130-r1 (09 Oct 2008)
39
40
41
42
43 1.1 sys-fs/udev/udev-130-r2.ebuild
44
45 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-130-r2.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-130-r2.ebuild?rev=1.1&content-type=text/plain
47
48 Index: udev-130-r2.ebuild
49 ===================================================================
50 # Copyright 1999-2008 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-130-r2.ebuild,v 1.1 2008/10/28 21:59:05 zzam Exp $
53
54 inherit eutils flag-o-matic multilib toolchain-funcs versionator autotools
55
56 DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
57 HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
58 SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2"
59
60 LICENSE="GPL-2"
61 SLOT="0"
62 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
63 IUSE="selinux"
64
65 DEPEND="selinux? ( sys-libs/libselinux )"
66 RDEPEND="!sys-apps/coldplug
67 !<sys-fs/device-mapper-1.02.19-r1"
68 RDEPEND="${DEPEND} ${RDEPEND}
69 >=sys-apps/baselayout-1.12.5"
70 # We need the lib/rcscripts/addon support
71 PROVIDE="virtual/dev-manager"
72
73 pkg_setup() {
74 udev_helper_dir="/$(get_libdir)/udev"
75
76 # comparing kernel version without linux-info.eclass to not pull
77 # virtual/linux-sources
78
79 local KV=$(uname -r)
80 local KV_MAJOR=$(get_major_version ${KV})
81 local KV_MINOR=$(get_version_component_range 2 ${KV})
82 local KV_MICRO=$(get_version_component_range 3 ${KV})
83
84 local ok=0
85 if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 && ${KV_MICRO} -ge 18 ]]
86 then
87 ok=1
88 fi
89
90 if [[ ${ok} == 0 ]]
91 then
92 ewarn
93 ewarn "${P} does not support Linux kernel before version 2.6.15!"
94 ewarn "If you want to use udev reliable you should update"
95 ewarn "to at least kernel version 2.6.18!"
96 ewarn
97 ebeep
98 fi
99 }
100
101 sed_helper_dir() {
102 sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@"
103 }
104
105 src_unpack() {
106 unpack ${A}
107
108 cd "${S}"
109
110 # patches go here...
111
112 # Make sure there is no sudden changes to upstream rules file
113 # (more for my own needs than anything else ...)
114 MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules")
115 MD5=${MD5/ -/}
116 if [[ ${MD5} != 6c0547dfba7807da6f2987fd6aa74d4c ]]
117 then
118 echo
119 eerror "50-udev-default.rules has been updated, please validate!"
120 die "50-udev-default.rules has been updated, please validate!"
121 fi
122
123 sed_helper_dir \
124 rules/rules.d/50-udev-default.rules \
125 extras/rule_generator/write_*_rules \
126 udev/udev_rules_parse.c \
127 udev/udev_rules.c \
128 $(find -name "Makefile.*")
129
130 # fix version of volume_id lib
131 sed -e 's/-version-info/-version-number/' -i extras/volume_id/lib/Makefile.am
132
133 eautoreconf
134 }
135
136 src_compile() {
137 filter-flags -fprefetch-loop-arrays
138
139 econf \
140 --prefix=/usr \
141 --sysconfdir=/etc \
142 --exec-prefix= \
143 --with-libdir-name=$(get_libdir) \
144 --disable-debug \
145 --disable-logging \
146 $(use_with selinux)
147
148 emake || die "compiling udev failed"
149 }
150
151 src_install() {
152 into /
153 emake DESTDIR="${D}" install || die "make install failed"
154
155 exeinto "${udev_helper_dir}"
156 newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly"
157 newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \
158 || die "move_tmp_persistent_rules.sh not installed properly"
159 newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \
160 || die "write_root_link_rule not installed properly"
161 newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \
162 || die "shell-compat.sh not installed properly"
163
164 keepdir "${udev_helper_dir}"/state
165 keepdir "${udev_helper_dir}"/devices
166
167 # create symlinks for these utilities to /sbin
168 # where multipath-tools expect them to be (Bug #168588)
169 dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id
170 dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id
171
172 # Add gentoo stuff to udev.conf
173 echo "# If you need to change mount-options, do it in /etc/fstab" \
174 >> "${D}"/etc/udev/udev.conf
175
176 # let the dir exist at least
177 keepdir /etc/udev/rules.d
178
179 # Now installing rules
180 cd "${S}"/rules
181 insinto "${udev_helper_dir}"/rules.d/
182
183 # Our rules files
184 doins gentoo/??-*.rules
185 doins packages/40-alsa.rules
186
187 # Adding arch specific rules
188 if [[ -f packages/40-${ARCH}.rules ]]
189 then
190 doins "packages/40-${ARCH}.rules"
191 fi
192 cd "${S}"
193
194 # our udev hooks into the rc system
195 insinto /$(get_libdir)/rcscripts/addons
196 newins "${FILESDIR}"/udev-start-126.sh udev-start.sh
197 newins "${FILESDIR}"/udev-stop-126.sh udev-stop.sh
198
199 # The udev-post init-script
200 newinitd "${FILESDIR}"/udev-postmount-130-r2.initd udev-postmount
201
202 # init-script for >openrc-0.3.0
203 # TODO: Add message that user REALLY, REALLY
204 # needs to add this to sysinit runlevel
205 # Bug #240984
206 newinitd "${FILESDIR}/udev.initd" udev
207
208 insinto /etc/modprobe.d
209 newins "${FILESDIR}"/blacklist-110 blacklist
210 doins "${FILESDIR}"/pnp-aliases
211
212 # convert /lib/udev to real used dir
213 sed_helper_dir \
214 "${D}/$(get_libdir)"/rcscripts/addons/*.sh \
215 "${D}"/etc/init.d/udev* \
216 "${D}"/etc/modprobe.d/*
217
218 # documentation
219 dodoc ChangeLog README TODO || die "failed installing docs"
220
221 cd docs/writing_udev_rules
222 mv index.html writing_udev_rules.html
223 dohtml *.html
224
225 cd "${S}"
226
227 newdoc extras/volume_id/README README_volume_id
228
229 echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev
230 doenvd 20udev
231 }
232
233 pkg_preinst() {
234 if [[ -d ${ROOT}/lib/udev-state ]]
235 then
236 mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/
237 rm -r "${ROOT}"/lib/udev-state
238 fi
239
240 if [[ -f ${ROOT}/etc/udev/udev.config &&
241 ! -f ${ROOT}/etc/udev/udev.rules ]]
242 then
243 mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules
244 fi
245
246 # delete the old udev.hotplug symlink if it is present
247 if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]]
248 then
249 rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug
250 fi
251
252 # delete the old wait_for_sysfs.hotplug symlink if it is present
253 if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]]
254 then
255 rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug
256 fi
257
258 # delete the old wait_for_sysfs.hotplug symlink if it is present
259 if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]]
260 then
261 rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug
262 fi
263
264 # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind)
265 coldplug_stale=""
266 if [[ -f ${ROOT}/etc/init.d/coldplug ]]
267 then
268 coldplug_stale="1"
269 fi
270
271 has_version "=${CATEGORY}/${PN}-103-r3"
272 previous_equal_to_103_r3=$?
273
274 has_version "<${CATEGORY}/${PN}-104-r5"
275 previous_less_than_104_r5=$?
276
277 has_version "<${CATEGORY}/${PN}-106-r5"
278 previous_less_than_106_r5=$?
279
280 has_version "<${CATEGORY}/${PN}-113"
281 previous_less_than_113=$?
282 }
283
284 pkg_postinst() {
285 # people want reminders, I'll give them reminders. Odds are they will
286 # just ignore them anyway...
287
288 if [[ ${coldplug_stale} == 1 ]]
289 then
290 ewarn "A stale coldplug init script found. You should run:"
291 ewarn
292 ewarn " rc-update del coldplug"
293 ewarn " rm -f /etc/init.d/coldplug"
294 ewarn
295 ewarn "udev now provides its own coldplug functionality."
296 fi
297
298 # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules
299 if [[ $previous_equal_to_103_r3 = 0 ]] &&
300 [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]]
301 then
302 ewarn "Deleting stray 40-scsi-hotplug.rules"
303 ewarn "installed by sys-fs/udev-103-r3"
304 rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules
305 fi
306
307 # Removing some device-nodes we thought we need some time ago
308 if [[ -d ${ROOT}/lib/udev/devices ]]
309 then
310 rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom}
311 fi
312
313 # Removing some old file
314 if [[ $previous_less_than_104_r5 = 0 ]]
315 then
316 rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev
317 rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null
318 fi
319
320 if [[ $previous_less_than_106_r5 = 0 ]] &&
321 [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]]
322 then
323 rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules
324 fi
325
326 # Try to remove /etc/dev.d as that is obsolete
327 if [[ -d ${ROOT}/etc/dev.d ]]
328 then
329 rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null
330 if [[ -d ${ROOT}/etc/dev.d ]]
331 then
332 ewarn "You still have the directory /etc/dev.d on your system."
333 ewarn "This is no longer used by udev and can be removed."
334 fi
335 fi
336
337 # 64-device-mapper.rules now gets installed by sys-fs/device-mapper
338 # remove it if user don't has sys-fs/device-mapper installed
339 if [[ $previous_less_than_113 = 0 ]] &&
340 [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] &&
341 ! has_version sys-fs/device-mapper
342 then
343 rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules
344 einfo "Removed unneeded file 64-device-mapper.rules"
345 fi
346
347 # requested in Bug #225033:
348 elog
349 elog "persistent-net does assigning fixed names to network devices."
350 elog "If you have problems with persistent-net rules,"
351 elog "just delete the rules file"
352 elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules"
353 elog "and then trigger udev by either running"
354 elog "\tudevadm trigger --subsystem-match=net"
355 elog "or by rebooting."
356 elog
357 elog "This may number your devices in a different way than it is now."
358
359 if [[ ${ROOT} == / ]]
360 then
361 # check if root of init-process is identical to ours
362 if [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]]
363 then
364 einfo "restarting udevd now."
365 if [[ -n $(pidof udevd) ]]
366 then
367 killall -15 udevd &>/dev/null
368 sleep 1
369 killall -9 udevd &>/dev/null
370 fi
371 /sbin/udevd --daemon
372 fi
373 fi
374
375 ewarn "If you build an initramfs including udev, then please"
376 ewarn "make sure that the /sbin/udevadm binary gets included,"
377 ewarn "and your scripts changed to use it,as it replaces the"
378 ewarn "old helper apps udevinfo, udevtrigger, ..."
379
380 ewarn
381 ewarn "mount options for directory /dev are no longer"
382 ewarn "set in /etc/udev/udev.conf, but in /etc/fstab"
383 ewarn "as for other directories."
384
385 elog
386 elog "For more information on udev on Gentoo, writing udev rules, and"
387 elog " fixing known issues visit:"
388 elog " http://www.gentoo.org/doc/en/udev-guide.xml"
389 }