Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/udev/
Date: Thu, 10 Oct 2019 17:52:42
Message-Id: 1570729738.bade9ab70e1a7f9ba7b87def34c7903792d3d294.williamh@gentoo
1 commit: bade9ab70e1a7f9ba7b87def34c7903792d3d294
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 10 17:47:48 2019 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 10 17:48:58 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bade9ab7
7
8 sys-fs/udev: 243 bump
9
10 Package-Manager: Portage-2.3.76, Repoman-2.3.16
11 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
12
13 sys-fs/udev/Manifest | 1 +
14 sys-fs/udev/udev-243.ebuild | 329 ++++++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 330 insertions(+)
16
17 diff --git a/sys-fs/udev/Manifest b/sys-fs/udev/Manifest
18 index ff85ac5d17c..b53cebb6825 100644
19 --- a/sys-fs/udev/Manifest
20 +++ b/sys-fs/udev/Manifest
21 @@ -8,3 +8,4 @@ DIST systemd-241-rc1.tar.gz 7617965 BLAKE2B 6c491297b71ad3c473d644de04bb334f902e
22 DIST systemd-241-rc2.tar.gz 7619504 BLAKE2B 610940b3141d36a0534cf477d303eb681f418f8c04d7e9ff1d28832d02c05d68195aec108b15392662b134020c28df5b35f6c1c85f8eea8e7090cdc210ce5e26 SHA512 69932b1e5d48fbf6fd650a91354763b1e7e8d490def98a011d6377ee8623abc21244f2c8ddd97a500c4d3e6ab11bae2a6148ddc84e325d75a0273b3d456d8f41
23 DIST systemd-241.tar.gz 7640538 BLAKE2B 69d7196fee0d0ad06ea8d7c78b0299cc17517ecce3ca4c0b1181a3fbb13bc2627629156785051e2ff427dcc21414f7a078724c6409ebaa431618e4799ebcd50a SHA512 a7757574590e8aa37e1291ea0b2c5eb03a8d8062fe9462fa5b0bf50830c933e2b301d106c70d904f94afc0aa8e43a8acfd11926dfa25b1b89174580e491e545e
24 DIST systemd-242.tar.gz 7831435 BLAKE2B 288e65d0a8e133ef5885689eb16118a83d93c730e342da63115cea0892fc999104c3a4856c83f3e7ef909ba2f3311146730b05ee02d84cc0400851ccbdcd54cd SHA512 578f68a3c8f2d454198fc04ff8d943abcfb390531d57f9603d185857f7afa7f4dc641dafecf49ce50fe22f5837b252b181400891e8efd4459fd4f69bb4283cb4
25 +DIST systemd-243.tar.gz 8242522 BLAKE2B 89e3ebbea5a99061329f7c78220a66c1e075d5ba90dfdf5ee8d0d9b762ef4600dc82d8ca2054632e5e343b6272cd8046c92f7f99dcfa8287c5ef2b42fb96d4cb SHA512 56b52a297aa5ac04d9667eb3afb1598725b197de73ff72baa1aabbc2844e36fba7b7fccdf6d214ae8b5b926616b2b7e15772763aaa80ec938d74333ff9c8673e
26
27 diff --git a/sys-fs/udev/udev-243.ebuild b/sys-fs/udev/udev-243.ebuild
28 new file mode 100644
29 index 00000000000..d48c72b25fa
30 --- /dev/null
31 +++ b/sys-fs/udev/udev-243.ebuild
32 @@ -0,0 +1,329 @@
33 +# Copyright 2003-2019 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +inherit bash-completion-r1 linux-info meson ninja-utils multilib-minimal toolchain-funcs udev
39 +
40 +if [[ ${PV} = 9999* ]]; then
41 + EGIT_REPO_URI="https://github.com/systemd/systemd.git"
42 + inherit git-r3
43 +else
44 + MY_PV=${PV/_/-}
45 + MY_P=systemd-${MY_PV}
46 + S=${WORKDIR}/${MY_P}
47 + SRC_URI="https://github.com/systemd/systemd/archive/v${MY_PV}/${MY_P}.tar.gz"
48 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
49 +fi
50 +
51 +DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
52 +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
53 +
54 +LICENSE="LGPL-2.1 MIT GPL-2"
55 +SLOT="0"
56 +IUSE="acl +kmod selinux"
57 +
58 +RESTRICT="test"
59 +
60 +COMMON_DEPEND=">=sys-apps/util-linux-2.30[${MULTILIB_USEDEP}]
61 + sys-libs/libcap[${MULTILIB_USEDEP}]
62 + acl? ( sys-apps/acl )
63 + kmod? ( >=sys-apps/kmod-16 )
64 + selinux? ( >=sys-libs/libselinux-2.1.9 )
65 + !<sys-libs/glibc-2.11
66 + !sys-apps/gentoo-systemd-integration
67 + !sys-apps/systemd"
68 +DEPEND="${COMMON_DEPEND}
69 + dev-util/gperf
70 + >=dev-util/intltool-0.50
71 + >=dev-util/meson-0.40.0
72 + dev-util/ninja
73 + >=sys-apps/coreutils-8.16
74 + virtual/os-headers
75 + virtual/pkgconfig
76 + >=sys-kernel/linux-headers-3.9
77 + app-text/docbook-xml-dtd:4.2
78 + app-text/docbook-xml-dtd:4.5
79 + app-text/docbook-xsl-stylesheets
80 + dev-libs/libxslt"
81 +RDEPEND="${COMMON_DEPEND}
82 + acct-group/kmem
83 + acct-group/tty
84 + acct-group/audio
85 + acct-group/cdrom
86 + acct-group/dialout
87 + acct-group/disk
88 + acct-group/input
89 + acct-group/kvm
90 + acct-group/lp
91 + acct-group/render
92 + acct-group/tape
93 + acct-group/video
94 + !<sys-fs/lvm2-2.02.103
95 + !<sec-policy/selinux-base-2.20120725-r10"
96 +PDEPEND=">=sys-apps/hwids-20140304[udev]
97 + >=sys-fs/udev-init-scripts-26"
98 +
99 +pkg_setup() {
100 + if [[ ${MERGE_TYPE} != buildonly ]]; then
101 + CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER ~UNIX"
102 + linux-info_pkg_setup
103 +
104 + # CONFIG_FHANDLE was introduced by 2.6.39
105 + local MINKV=2.6.39
106 +
107 + if kernel_is -lt ${MINKV//./ }; then
108 + eerror "Your running kernel is too old to run this version of ${P}"
109 + eerror "You need to upgrade kernel at least to ${MINKV}"
110 + fi
111 +
112 + if kernel_is -lt 3 7; then
113 + ewarn "Your running kernel is too old to have firmware loader and"
114 + ewarn "this version of ${P} doesn't have userspace firmware loader"
115 + ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
116 + fi
117 + fi
118 +}
119 +
120 +src_prepare() {
121 + cat <<-EOF > "${T}"/40-gentoo.rules
122 + # Gentoo specific floppy and usb groups
123 + ACTION=="add", SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
124 + ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
125 + EOF
126 +
127 + if [[ -d "${WORKDIR}/patches" ]]; then
128 + eapply "${WORKDIR}/patches"
129 + fi
130 +
131 + default
132 +}
133 +
134 +meson_multilib_native_use() {
135 + if multilib_is_native_abi && use "$1"; then
136 + echo true
137 + else
138 + echo false
139 + fi
140 +}
141 +
142 +multilib_src_configure() {
143 + local emesonargs=(
144 + -Dacl=$(meson_multilib_native_use acl)
145 + -Defi=false
146 + -Dkmod=$(meson_multilib_native_use kmod)
147 + -Dselinux=$(meson_multilib_native_use selinux)
148 + -Dlink-udev-shared=false
149 + -Dsplit-usr=true
150 +
151 + # Prevent automagic deps
152 + -Dgcrypt=false
153 + -Dlibcryptsetup=false
154 + -Dlibidn=false
155 + -Dlibidn2=false
156 + -Dlibiptc=false
157 + -Dseccomp=false
158 + -Dlz4=false
159 + -Dxz=false
160 + )
161 + meson_src_configure
162 +}
163 +
164 +src_configure() {
165 + # Prevent conflicts with i686 cross toolchain, bug 559726
166 + tc-export AR CC NM OBJCOPY RANLIB
167 + multilib-minimal_src_configure
168 +}
169 +
170 +multilib_src_compile() {
171 + # meson creates this link
172 + local libudev=$(readlink src/udev/libudev.so.1)
173 +
174 + local targets=(
175 + src/udev/${libudev}
176 + )
177 + if multilib_is_native_abi; then
178 + targets+=(
179 + systemd-udevd
180 + udevadm
181 + src/udev/ata_id
182 + src/udev/cdrom_id
183 + src/udev/mtd_probe
184 + src/udev/scsi_id
185 + src/udev/v4l_id
186 + man/udev.conf.5
187 + man/systemd.link.5
188 + man/hwdb.7
189 + man/udev.7
190 + man/systemd-udevd.service.8
191 + man/udevadm.8
192 + )
193 + fi
194 + eninja "${targets[@]}"
195 +}
196 +
197 +multilib_src_install() {
198 + local libudev=$(readlink src/udev/libudev.so.1)
199 +
200 + into /
201 + dolib.so src/udev/{${libudev},libudev.so.1,libudev.so}
202 +
203 + insinto "/usr/$(get_libdir)/pkgconfig"
204 + doins src/libudev/libudev.pc
205 +
206 + if multilib_is_native_abi; then
207 + into /
208 + dobin udevadm
209 +
210 + exeinto /lib/systemd
211 + doexe systemd-udevd
212 +
213 + exeinto /lib/udev
214 + doexe src/udev/{ata_id,cdrom_id,mtd_probe,scsi_id,v4l_id}
215 +
216 + rm rules/99-systemd.rules || die
217 + insinto /lib/udev/rules.d
218 + doins rules/*.rules
219 +
220 + insinto /usr/share/pkgconfig
221 + doins src/udev/udev.pc
222 +
223 + mv man/systemd-udevd.service.8 man/systemd-udevd.8 || die
224 + rm man/systemd-udevd-{control,kernel}.socket.8 || die
225 + doman man/*.[0-9]
226 + fi
227 +}
228 +
229 +multilib_src_install_all() {
230 + doheader src/libudev/libudev.h
231 +
232 + insinto /etc/udev
233 + doins src/udev/udev.conf
234 + keepdir /etc/udev/{hwdb.d,rules.d}
235 +
236 + insinto /lib/systemd/network
237 + doins network/99-default.link
238 +
239 + # see src_prepare() for content of 40-gentoo.rules
240 + insinto /lib/udev/rules.d
241 + doins "${T}"/40-gentoo.rules
242 + doins "${S}"/rules/*.rules
243 +
244 + dobashcomp shell-completion/bash/udevadm
245 +
246 + insinto /usr/share/zsh/site-functions
247 + doins shell-completion/zsh/_udevadm
248 +
249 + einstalldocs
250 +}
251 +
252 +pkg_postinst() {
253 + mkdir -p "${ROOT%/}"/run
254 +
255 + # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
256 + # So try to remove it here (will only work if empty).
257 + rmdir "${ROOT%/}"/dev/loop 2>/dev/null
258 + if [[ -d ${ROOT%/}/dev/loop ]]; then
259 + ewarn "Please make sure your remove /dev/loop,"
260 + ewarn "else losetup may be confused when looking for unused devices."
261 + fi
262 +
263 + local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
264 + while read -r dev path fstype rest; do
265 + if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
266 + ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
267 + ewarn "filesystem. Otherwise udev won't be able to boot."
268 + ewarn "See, https://bugs.gentoo.org/453186"
269 + fi
270 + done < "${fstab}"
271 +
272 + if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
273 + ewarn
274 + ewarn "Please re-emerge all packages on your system which install"
275 + ewarn "rules and helpers in /usr/lib/udev. They should now be in"
276 + ewarn "/lib/udev."
277 + ewarn
278 + ewarn "One way to do this is to run the following command:"
279 + ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
280 + ewarn "Note that qfile can be found in app-portage/portage-utils"
281 + fi
282 +
283 + local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
284 + local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
285 + for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
286 + if [[ -f ${old_rules} ]]; then
287 + ewarn
288 + ewarn "File ${old_rules} is from old udev installation but if you still use it,"
289 + ewarn "rename it to something else starting with 70- to silence this deprecation"
290 + ewarn "warning."
291 + fi
292 + done
293 +
294 + elog
295 + elog "Starting from version >= 197 the new predictable network interface names are"
296 + elog "used by default, see:"
297 + elog "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
298 + elog "https://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
299 + elog
300 + elog "Example command to get the information for the new interface name before booting"
301 + elog "(replace <ifname> with, for example, eth0):"
302 + elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
303 + elog
304 + elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
305 + elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
306 + elog "to disable the feature."
307 +
308 + if has_version 'sys-apps/biosdevname'; then
309 + ewarn
310 + ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
311 + ewarn "detected to be installed with the new predictable network interface names."
312 + fi
313 +
314 + ewarn
315 + ewarn "You need to restart udev as soon as possible to make the upgrade go"
316 + ewarn "into effect."
317 + ewarn "The method you use to do this depends on your init system."
318 + if has_version 'sys-apps/openrc'; then
319 + ewarn "For sys-apps/openrc users it is:"
320 + ewarn "# /etc/init.d/udev --nodeps restart"
321 + fi
322 +
323 + elog
324 + elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
325 + elog "fixing known issues visit:"
326 + elog "https://wiki.gentoo.org/wiki/Udev"
327 + elog "https://wiki.gentoo.org/wiki/Udev/upgrade"
328 +
329 + # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
330 + # do the same for 80-net-setup-link.rules to keep the old behavior
331 + local net_move=no
332 + local net_name_slot_sym=no
333 + local net_rules_path="${ROOT%/}"/etc/udev/rules.d
334 + local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
335 + local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
336 + if [[ ! -e ${net_setup_link} ]]; then
337 + [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
338 + if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
339 + net_move=yes
340 + net_name_slot_sym=yes
341 + fi
342 + fi
343 + if [[ ${net_move} == yes ]]; then
344 + ebegin "Copying ${net_name_slot} to ${net_setup_link}"
345 +
346 + if [[ ${net_name_slot_sym} == yes ]]; then
347 + ln -nfs /dev/null "${net_setup_link}"
348 + else
349 + cp "${net_name_slot}" "${net_setup_link}"
350 + fi
351 + eend $?
352 + fi
353 +
354 + # Update hwdb database in case the format is changed by udev version.
355 + if has_version 'sys-apps/hwids[udev]'; then
356 + udevadm hwdb --update --root="${ROOT%/}"
357 + # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
358 + # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
359 + [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
360 + fi
361 +}