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