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: Sun, 08 Mar 2020 04:00:34
Message-Id: 1583639978.c0ac3e1b1960ee7939143c3740b74cf2cfbfdedd.floppym@gentoo
1 commit: c0ac3e1b1960ee7939143c3740b74cf2cfbfdedd
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 8 03:53:23 2020 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 8 03:59:38 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0ac3e1b
7
8 sys-fs/udev: EAPI=7 and clean up pkg_postinst
9
10 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
11
12 sys-fs/udev/udev-9999.ebuild | 142 +++++++------------------------------------
13 1 file changed, 22 insertions(+), 120 deletions(-)
14
15 diff --git a/sys-fs/udev/udev-9999.ebuild b/sys-fs/udev/udev-9999.ebuild
16 index e5fad94c8e4..badfd97ef89 100644
17 --- a/sys-fs/udev/udev-9999.ebuild
18 +++ b/sys-fs/udev/udev-9999.ebuild
19 @@ -1,7 +1,7 @@
20 -# Copyright 2003-2019 Gentoo Authors
21 +# Copyright 2003-2020 Gentoo Authors
22 # Distributed under the terms of the GNU General Public License v2
23
24 -EAPI=6
25 +EAPI=7
26
27 inherit bash-completion-r1 linux-info meson ninja-utils multilib-minimal toolchain-funcs udev usr-ldscript
28
29 @@ -25,27 +25,27 @@ IUSE="acl +kmod selinux static-libs"
30
31 RESTRICT="test"
32
33 -COMMON_DEPEND=">=sys-apps/util-linux-2.30[${MULTILIB_USEDEP}]
34 - sys-libs/libcap[${MULTILIB_USEDEP}]
35 - acl? ( sys-apps/acl )
36 - kmod? ( >=sys-apps/kmod-16 )
37 - selinux? ( >=sys-libs/libselinux-2.1.9 )
38 - !<sys-libs/glibc-2.11
39 - !sys-apps/gentoo-systemd-integration
40 - !sys-apps/systemd"
41 -DEPEND="${COMMON_DEPEND}
42 +BDEPEND="
43 dev-util/gperf
44 >=dev-util/intltool-0.50
45 - >=dev-util/meson-0.40.0
46 - dev-util/ninja
47 >=sys-apps/coreutils-8.16
48 - virtual/os-headers
49 - virtual/pkgconfig
50 - >=sys-kernel/linux-headers-3.9
51 + virtual/pkgconfig[${MULTILIB_USEDEP}]
52 app-text/docbook-xml-dtd:4.2
53 app-text/docbook-xml-dtd:4.5
54 app-text/docbook-xsl-stylesheets
55 - dev-libs/libxslt"
56 + dev-libs/libxslt
57 +"
58 +COMMON_DEPEND="
59 + >=sys-apps/util-linux-2.30[${MULTILIB_USEDEP}]
60 + sys-libs/libcap:0=[${MULTILIB_USEDEP}]
61 + acl? ( sys-apps/acl )
62 + kmod? ( >=sys-apps/kmod-15 )
63 + selinux? ( >=sys-libs/libselinux-2.1.9 )
64 + !<sys-libs/glibc-2.11
65 +"
66 +DEPEND="${COMMON_DEPEND}
67 + >=sys-kernel/linux-headers-3.9
68 +"
69 RDEPEND="${COMMON_DEPEND}
70 acct-group/kmem
71 acct-group/tty
72 @@ -60,7 +60,10 @@ RDEPEND="${COMMON_DEPEND}
73 acct-group/tape
74 acct-group/video
75 !<sys-fs/lvm2-2.02.103
76 - !<sec-policy/selinux-base-2.20120725-r10"
77 + !<sec-policy/selinux-base-2.20120725-r10
78 + !sys-apps/gentoo-systemd-integration
79 + !sys-apps/systemd
80 +"
81 PDEPEND=">=sys-apps/hwids-20140304[udev]
82 >=sys-fs/udev-init-scripts-26"
83
84 @@ -227,110 +230,9 @@ multilib_src_install_all() {
85 }
86
87 pkg_postinst() {
88 - mkdir -p "${ROOT%/}"/run
89 -
90 - # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
91 - # So try to remove it here (will only work if empty).
92 - rmdir "${ROOT%/}"/dev/loop 2>/dev/null
93 - if [[ -d ${ROOT%/}/dev/loop ]]; then
94 - ewarn "Please make sure your remove /dev/loop,"
95 - ewarn "else losetup may be confused when looking for unused devices."
96 - fi
97 -
98 - local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
99 - while read -r dev path fstype rest; do
100 - if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
101 - ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
102 - ewarn "filesystem. Otherwise udev won't be able to boot."
103 - ewarn "See, https://bugs.gentoo.org/453186"
104 - fi
105 - done < "${fstab}"
106 -
107 - if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
108 - ewarn
109 - ewarn "Please re-emerge all packages on your system which install"
110 - ewarn "rules and helpers in /usr/lib/udev. They should now be in"
111 - ewarn "/lib/udev."
112 - ewarn
113 - ewarn "One way to do this is to run the following command:"
114 - ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
115 - ewarn "Note that qfile can be found in app-portage/portage-utils"
116 - fi
117 -
118 - local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
119 - local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
120 - for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
121 - if [[ -f ${old_rules} ]]; then
122 - ewarn
123 - ewarn "File ${old_rules} is from old udev installation but if you still use it,"
124 - ewarn "rename it to something else starting with 70- to silence this deprecation"
125 - ewarn "warning."
126 - fi
127 - done
128 -
129 - elog
130 - elog "Starting from version >= 197 the new predictable network interface names are"
131 - elog "used by default, see:"
132 - elog "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
133 - elog "https://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
134 - elog
135 - elog "Example command to get the information for the new interface name before booting"
136 - elog "(replace <ifname> with, for example, eth0):"
137 - elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
138 - elog
139 - elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
140 - elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
141 - elog "to disable the feature."
142 -
143 - if has_version 'sys-apps/biosdevname'; then
144 - ewarn
145 - ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
146 - ewarn "detected to be installed with the new predictable network interface names."
147 - fi
148 -
149 - ewarn
150 - ewarn "You need to restart udev as soon as possible to make the upgrade go"
151 - ewarn "into effect."
152 - ewarn "The method you use to do this depends on your init system."
153 - if has_version 'sys-apps/openrc'; then
154 - ewarn "For sys-apps/openrc users it is:"
155 - ewarn "# /etc/init.d/udev --nodeps restart"
156 - fi
157 -
158 - elog
159 - elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
160 - elog "fixing known issues visit:"
161 - elog "https://wiki.gentoo.org/wiki/Udev"
162 - elog "https://wiki.gentoo.org/wiki/Udev/upgrade"
163 -
164 - # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
165 - # do the same for 80-net-setup-link.rules to keep the old behavior
166 - local net_move=no
167 - local net_name_slot_sym=no
168 - local net_rules_path="${ROOT%/}"/etc/udev/rules.d
169 - local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
170 - local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
171 - if [[ ! -e ${net_setup_link} ]]; then
172 - [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
173 - if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
174 - net_move=yes
175 - net_name_slot_sym=yes
176 - fi
177 - fi
178 - if [[ ${net_move} == yes ]]; then
179 - ebegin "Copying ${net_name_slot} to ${net_setup_link}"
180 -
181 - if [[ ${net_name_slot_sym} == yes ]]; then
182 - ln -nfs /dev/null "${net_setup_link}"
183 - else
184 - cp "${net_name_slot}" "${net_setup_link}"
185 - fi
186 - eend $?
187 - fi
188 -
189 # Update hwdb database in case the format is changed by udev version.
190 if has_version 'sys-apps/hwids[udev]'; then
191 - udevadm hwdb --update --root="${ROOT%/}"
192 + udevadm hwdb --update --root="${ROOT}"
193 # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
194 # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
195 [[ -z ${REPLACING_VERSIONS} ]] && udev_reload