Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/udev-gentoo-scripts:master commit in: init.d/, conf.d/
Date: Sat, 30 Jun 2012 23:47:32
Message-Id: 1341098919.7084a91b1ec84af5173597b41b3ed899996bf9c8.WilliamH@gentoo
1 commit: 7084a91b1ec84af5173597b41b3ed899996bf9c8
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jun 30 23:06:33 2012 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 30 23:28:39 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/udev-gentoo-scripts.git;a=commit;h=7084a91b
7
8 drop support for the persistent rules generators
9
10 For udev 185 and newer, this is not supported by upstream, so we
11 can remove the code from the startup script.
12
13 ---
14 conf.d/udev | 11 ----------
15 init.d/udev | 61 -----------------------------------------------------------
16 2 files changed, 0 insertions(+), 72 deletions(-)
17
18 diff --git a/conf.d/udev b/conf.d/udev
19 index 12c2afa..3c425b3 100644
20 --- a/conf.d/udev
21 +++ b/conf.d/udev
22 @@ -1,16 +1,5 @@
23 # /etc/conf.d/udev: config file for udev
24
25 -# We discourage to disable persistent-net!!
26 -# this may lead to random interface naming
27 -
28 -# Disable adding new rules for persistent-net
29 -persistent_net_disable="no"
30 -
31 -# Disable adding new rules for persistent-cd
32 -# Disabling this will stop new cdrom devices to appear
33 -# as /dev/{cdrom,cdrw,dvd,dvdrw}
34 -persistent_cd_disable="no"
35 -
36 # udev can trigger coldplug events which cause services to start and
37 # kernel modules to be loaded.
38 # Services are deferred to start in the boot runlevel.
39
40 diff --git a/init.d/udev b/init.d/udev
41 index 265523a..2adee63 100644
42 --- a/init.d/udev
43 +++ b/init.d/udev
44 @@ -6,8 +6,6 @@ command=/usr/lib/systemd/systemd-udevd
45 command_args="--daemon ${udev_opts}"
46 description="udev manages device permissions and symbolic links in /dev"
47
48 -persistent_cd_disable="${persistent_cd_disable:-no}"
49 -persistent_net_disable="${persistent_net_disable:-no}"
50 rc_coldplug=${rc_coldplug:-${RC_COLDPLUG:-YES}}
51 udev_debug="${udev_debug:-no}"
52 udev_monitor="${udev_monitor:-no}"
53 @@ -81,21 +79,6 @@ cleanup()
54 exit 1
55 }
56
57 -rules_disable_switch()
58 -{
59 - # this function disables rules files
60 - # by creating new files with the same name
61 - # in a temp rules directory with higher priority
62 - local f=$(get_rundir)/rules.d/"$1" bname="$1" onoff="$2"
63 -
64 - if yesno "${onoff}"; then
65 - echo "# This file disables ${bname} due to /etc/conf.d/udev" \
66 - > "${f}"
67 - else
68 - rm -f "${f}"
69 - fi
70 -}
71 -
72 is_service_enabled()
73 {
74 local svc="$1"
75 @@ -127,9 +110,6 @@ start_pre()
76
77 /lib/udev/write_root_link_rule
78
79 - rules_disable_switch 75-persistent-net-generator.rules "${persistent_net_disable}"
80 - rules_disable_switch 75-cd-aliases-generator.rules ${persistent_cd_disable}
81 -
82 if [ -e /proc/sys/kernel/hotplug ]; then
83 echo "" >/proc/sys/kernel/hotplug
84 fi
85 @@ -189,46 +169,6 @@ populate_dev()
86 return 0
87 }
88
89 -check_persistent_net()
90 -{
91 - # check if there are problems with persistent-net
92 - local syspath= devs= problem=false
93 - for syspath in /sys/class/net/*_rename*; do
94 - if [ -d "${syspath}" ]; then
95 - devs="${devs} ${syspath##*/}"
96 - problem=true
97 - fi
98 - done
99 -
100 - ${problem} || return 0
101 -
102 - eerror "UDEV: Your system has a problem assigning persistent names"
103 - eerror "to these network interfaces: ${devs}"
104 -
105 - einfo "Checking persistent-net rules:"
106 - # the sed-expression lists all duplicate lines
107 - # from the input, like "uniq -d" does, but uniq
108 - # is installed into /usr/bin and not available at boot.
109 - dups=$(
110 - RULES_FILE='/etc/udev/rules.d/70-persistent-net.rules'
111 - . /lib/udev/rule_generator.functions
112 - find_all_rules 'NAME=' '.*' | \
113 - tr ' ' '\n' | \
114 - sort | \
115 - sed '$!N; s/^\(.*\)\n\1$/\1/; t; D'
116 - )
117 - if [ -n "${dups}" ]; then
118 - ewarn "The rules create multiple entries assigning these names:"
119 - eindent
120 - ewarn "${dups}"
121 - eoutdent
122 - else
123 - ewarn "Found no duplicate names in persistent-net rules,"
124 - ewarn "there must be some other problem!"
125 - fi
126 - return 1
127 -}
128 -
129 check_udev_works()
130 {
131 # should exist on every system, else udev failed
132 @@ -267,7 +207,6 @@ start_post()
133 {
134 start_udevmonitor
135 populate_dev
136 - check_persistent_net
137 check_udev_works || cleanup
138 stop_udevmonitor
139 display_hotplugged_services