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