Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/udev/
Date: Wed, 30 Jan 2019 20:14:39
Message-Id: 1548879268.1bf61b0720a1a53395a7728078c8aaf4039f45dd.floppym@gentoo
1 commit: 1bf61b0720a1a53395a7728078c8aaf4039f45dd
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 30 20:14:28 2019 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 30 20:14:28 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bf61b07
7
8 sys-fs/udev: bump to 241-rc2
9
10 Package-Manager: Portage-2.3.58, Repoman-2.3.12_p63
11 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
12
13 sys-fs/udev/Manifest | 1 +
14 sys-fs/udev/udev-241_rc2.ebuild | 326 ++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 327 insertions(+)
16
17 diff --git a/sys-fs/udev/Manifest b/sys-fs/udev/Manifest
18 index 2c0843aff6d..7b1a675bd2d 100644
19 --- a/sys-fs/udev/Manifest
20 +++ b/sys-fs/udev/Manifest
21 @@ -5,3 +5,4 @@ DIST systemd-240-patches-1.tar.gz 15364 BLAKE2B e5cf4c2b8666a5c03e658f46674422d2
22 DIST systemd-240-patches-3.tar.gz 31952 BLAKE2B 0677d24c4f4e1575dbd4953eb75734f0773671e4ffc2a8d848353a379f5ea2caf4f96620ed6303d98ec00a15367d5e2124b493aaef80b1a0fe118866a1c04ada SHA512 e604e1de17bcd4c941036f12d2e3ae96dd6e86647db2b07576e8468405900b6e8af6a0e55a50c7e9b19704601930b8152c8ac506b2624e261ee0cd35dfc91a21
23 DIST systemd-240.tar.gz 7582001 BLAKE2B cf53595a83424984dd9f533f7cd0c9905366c5a52ab946fc45ff7fd1bcc85978ff654720113641534e40c0f9a1ad1c9628255778616770762950426789f659c3 SHA512 da7467781b16f65d868931ae88fd07554db61542aec7f11dbec9f7279b529f900301edfea2d3813ddb64eeb3fdcfb7be86e540c65212dd7cfdcdebbc80de2ff5
24 DIST systemd-241-rc1.tar.gz 7617965 BLAKE2B 6c491297b71ad3c473d644de04bb334f902ee4110d647b654c5452f34401cfc11c7564b290022072555f3fbd46674ce009f587622f412f8a66330a7089db34c5 SHA512 168ba80d6e8abadbf1ed84270f2b02e257f1490b61021bb6fb704d9b5fad2670b63e0fc0cb26071e8d56c993faa30274e80d53cf49154cce2b609f47c73b30e0
25 +DIST systemd-241-rc2.tar.gz 7619504 BLAKE2B 610940b3141d36a0534cf477d303eb681f418f8c04d7e9ff1d28832d02c05d68195aec108b15392662b134020c28df5b35f6c1c85f8eea8e7090cdc210ce5e26 SHA512 69932b1e5d48fbf6fd650a91354763b1e7e8d490def98a011d6377ee8623abc21244f2c8ddd97a500c4d3e6ab11bae2a6148ddc84e325d75a0273b3d456d8f41
26
27 diff --git a/sys-fs/udev/udev-241_rc2.ebuild b/sys-fs/udev/udev-241_rc2.ebuild
28 new file mode 100644
29 index 00000000000..100e4f4f152
30 --- /dev/null
31 +++ b/sys-fs/udev/udev-241_rc2.ebuild
32 @@ -0,0 +1,326 @@
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 user
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${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 + !<sys-fs/lvm2-2.02.103
83 + !<sec-policy/selinux-base-2.20120725-r10"
84 +PDEPEND=">=sys-apps/hwids-20140304[udev]
85 + >=sys-fs/udev-init-scripts-26"
86 +
87 +pkg_setup() {
88 + if [[ ${MERGE_TYPE} != buildonly ]]; then
89 + CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER ~UNIX"
90 + linux-info_pkg_setup
91 +
92 + # CONFIG_FHANDLE was introduced by 2.6.39
93 + local MINKV=2.6.39
94 +
95 + if kernel_is -lt ${MINKV//./ }; then
96 + eerror "Your running kernel is too old to run this version of ${P}"
97 + eerror "You need to upgrade kernel at least to ${MINKV}"
98 + fi
99 +
100 + if kernel_is -lt 3 7; then
101 + ewarn "Your running kernel is too old to have firmware loader and"
102 + ewarn "this version of ${P} doesn't have userspace firmware loader"
103 + ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
104 + fi
105 + fi
106 +}
107 +
108 +src_prepare() {
109 + cat <<-EOF > "${T}"/40-gentoo.rules
110 + # Gentoo specific floppy and usb groups
111 + ACTION=="add", SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
112 + ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
113 + EOF
114 +
115 + if [[ -d "${WORKDIR}/patches" ]]; then
116 + eapply "${WORKDIR}/patches"
117 + fi
118 +
119 + local PATCHES=(
120 + "${FILESDIR}/236-uucp-group.patch"
121 + )
122 +
123 + default
124 +}
125 +
126 +meson_multilib_native_use() {
127 + if multilib_is_native_abi && use "$1"; then
128 + echo true
129 + else
130 + echo false
131 + fi
132 +}
133 +
134 +multilib_src_configure() {
135 + local emesonargs=(
136 + -Dacl=$(meson_multilib_native_use acl)
137 + -Defi=false
138 + -Dkmod=$(meson_multilib_native_use kmod)
139 + -Dselinux=$(meson_multilib_native_use selinux)
140 + -Dlink-udev-shared=false
141 + -Dsplit-usr=true
142 +
143 + # Prevent automagic deps
144 + -Dgcrypt=false
145 + -Dlibcryptsetup=false
146 + -Dlibidn=false
147 + -Dlibidn2=false
148 + -Dlibiptc=false
149 + -Dseccomp=false
150 + -Dlz4=false
151 + -Dxz=false
152 + )
153 + meson_src_configure
154 +}
155 +
156 +src_configure() {
157 + # Prevent conflicts with i686 cross toolchain, bug 559726
158 + tc-export AR CC NM OBJCOPY RANLIB
159 + multilib-minimal_src_configure
160 +}
161 +
162 +multilib_src_compile() {
163 + # meson creates this link
164 + local libudev=$(readlink src/udev/libudev.so.1)
165 +
166 + local targets=(
167 + src/udev/${libudev}
168 + )
169 + if multilib_is_native_abi; then
170 + targets+=(
171 + systemd-udevd
172 + udevadm
173 + src/udev/ata_id
174 + src/udev/cdrom_id
175 + src/udev/mtd_probe
176 + src/udev/scsi_id
177 + src/udev/v4l_id
178 + man/udev.conf.5
179 + man/systemd.link.5
180 + man/hwdb.7
181 + man/udev.7
182 + man/systemd-udevd.service.8
183 + man/udevadm.8
184 + )
185 + fi
186 + eninja "${targets[@]}"
187 +}
188 +
189 +multilib_src_install() {
190 + local libudev=$(readlink src/udev/libudev.so.1)
191 +
192 + into /
193 + dolib.so src/udev/{${libudev},libudev.so.1,libudev.so}
194 +
195 + insinto "/usr/$(get_libdir)/pkgconfig"
196 + doins src/libudev/libudev.pc
197 +
198 + if multilib_is_native_abi; then
199 + into /
200 + dobin udevadm
201 +
202 + exeinto /lib/systemd
203 + doexe systemd-udevd
204 +
205 + exeinto /lib/udev
206 + doexe src/udev/{ata_id,cdrom_id,mtd_probe,scsi_id,v4l_id}
207 +
208 + rm rules/99-systemd.rules || die
209 + insinto /lib/udev/rules.d
210 + doins rules/*.rules
211 +
212 + insinto /usr/share/pkgconfig
213 + doins src/udev/udev.pc
214 +
215 + mv man/systemd-udevd.service.8 man/systemd-udevd.8 || die
216 + rm man/systemd-udevd-{control,kernel}.socket.8 || die
217 + doman man/*.[0-9]
218 + fi
219 +}
220 +
221 +multilib_src_install_all() {
222 + doheader src/libudev/libudev.h
223 +
224 + insinto /etc/udev
225 + doins src/udev/udev.conf
226 + keepdir /etc/udev/{hwdb.d,rules.d}
227 +
228 + insinto /lib/systemd/network
229 + doins network/99-default.link
230 +
231 + # see src_prepare() for content of 40-gentoo.rules
232 + insinto /lib/udev/rules.d
233 + doins "${T}"/40-gentoo.rules
234 + doins "${S}"/rules/*.rules
235 +
236 + dobashcomp shell-completion/bash/udevadm
237 +
238 + insinto /usr/share/zsh/site-functions
239 + doins shell-completion/zsh/_udevadm
240 +
241 + einstalldocs
242 +}
243 +
244 +pkg_postinst() {
245 + mkdir -p "${ROOT%/}"/run
246 +
247 + # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
248 + # So try to remove it here (will only work if empty).
249 + rmdir "${ROOT%/}"/dev/loop 2>/dev/null
250 + if [[ -d ${ROOT%/}/dev/loop ]]; then
251 + ewarn "Please make sure your remove /dev/loop,"
252 + ewarn "else losetup may be confused when looking for unused devices."
253 + fi
254 +
255 + local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
256 + while read -r dev path fstype rest; do
257 + if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
258 + ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
259 + ewarn "filesystem. Otherwise udev won't be able to boot."
260 + ewarn "See, https://bugs.gentoo.org/453186"
261 + fi
262 + done < "${fstab}"
263 +
264 + if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
265 + ewarn
266 + ewarn "Please re-emerge all packages on your system which install"
267 + ewarn "rules and helpers in /usr/lib/udev. They should now be in"
268 + ewarn "/lib/udev."
269 + ewarn
270 + ewarn "One way to do this is to run the following command:"
271 + ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
272 + ewarn "Note that qfile can be found in app-portage/portage-utils"
273 + fi
274 +
275 + local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
276 + local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
277 + for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
278 + if [[ -f ${old_rules} ]]; then
279 + ewarn
280 + ewarn "File ${old_rules} is from old udev installation but if you still use it,"
281 + ewarn "rename it to something else starting with 70- to silence this deprecation"
282 + ewarn "warning."
283 + fi
284 + done
285 +
286 + elog
287 + elog "Starting from version >= 197 the new predictable network interface names are"
288 + elog "used by default, see:"
289 + elog "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
290 + elog "https://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
291 + elog
292 + elog "Example command to get the information for the new interface name before booting"
293 + elog "(replace <ifname> with, for example, eth0):"
294 + elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
295 + elog
296 + elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
297 + elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
298 + elog "to disable the feature."
299 +
300 + if has_version 'sys-apps/biosdevname'; then
301 + ewarn
302 + ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
303 + ewarn "detected to be installed with the new predictable network interface names."
304 + fi
305 +
306 + ewarn
307 + ewarn "You need to restart udev as soon as possible to make the upgrade go"
308 + ewarn "into effect."
309 + ewarn "The method you use to do this depends on your init system."
310 + if has_version 'sys-apps/openrc'; then
311 + ewarn "For sys-apps/openrc users it is:"
312 + ewarn "# /etc/init.d/udev --nodeps restart"
313 + fi
314 +
315 + elog
316 + elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
317 + elog "fixing known issues visit:"
318 + elog "https://wiki.gentoo.org/wiki/Udev"
319 + elog "https://wiki.gentoo.org/wiki/Udev/upgrade"
320 +
321 + # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
322 + # do the same for 80-net-setup-link.rules to keep the old behavior
323 + local net_move=no
324 + local net_name_slot_sym=no
325 + local net_rules_path="${ROOT%/}"/etc/udev/rules.d
326 + local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
327 + local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
328 + if [[ ! -e ${net_setup_link} ]]; then
329 + [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
330 + if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
331 + net_move=yes
332 + net_name_slot_sym=yes
333 + fi
334 + fi
335 + if [[ ${net_move} == yes ]]; then
336 + ebegin "Copying ${net_name_slot} to ${net_setup_link}"
337 +
338 + if [[ ${net_name_slot_sym} == yes ]]; then
339 + ln -nfs /dev/null "${net_setup_link}"
340 + else
341 + cp "${net_name_slot}" "${net_setup_link}"
342 + fi
343 + eend $?
344 + fi
345 +
346 + # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
347 + # https://bugs.gentoo.org/246847
348 + # https://bugs.gentoo.org/514174
349 + enewgroup input
350 +
351 + # Update hwdb database in case the format is changed by udev version.
352 + if has_version 'sys-apps/hwids[udev]'; then
353 + udevadm hwdb --update --root="${ROOT%/}"
354 + # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
355 + # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
356 + [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
357 + fi
358 +}