From 2b6f3b42897f2d1d71afa3f2ada60f2b22db449f Mon Sep 17 00:00:00 2001 From: Sandino Araico Sanchez Date: Sun, 1 Oct 2023 17:13:53 -0600 Subject: [PATCH] sys-fs/eudev-3.2.12-r2: sticky-tags from PR #32882 --- sys-fs/eudev/Manifest | 4 +- sys-fs/eudev/eudev-3.2.12-r2.ebuild | 282 ++++++++++++++++++ sys-fs/eudev/eudev-9999.ebuild | 4 + .../files/eudev-3.2.12-sticky-tags.patch | 125 ++++++++ 4 files changed, 414 insertions(+), 1 deletion(-) create mode 100644 sys-fs/eudev/eudev-3.2.12-r2.ebuild create mode 100644 sys-fs/eudev/files/eudev-3.2.12-sticky-tags.patch diff --git a/sys-fs/eudev/Manifest b/sys-fs/eudev/Manifest index 77c5b45..061815f 100644 --- a/sys-fs/eudev/Manifest +++ b/sys-fs/eudev/Manifest @@ -1,9 +1,11 @@ AUX 40-gentoo.rules 167 BLAKE2B 07116c6e5aab7de9fa8a88c6cdd9ad76a09d797d6f7bc3d0535c93ccf83486bbdae8f68d682714576b072a174df070505cce9c6f4b729e91a6f61ed89da72e8e SHA512 92e2be610839432f46cefab4d128825199dc9f2c5ef33119f9ff84dfe635ef56a4f7aaed64ba52ea2798868b00c3a1b7955caa33219aa298c6a2b8290181f94b +AUX eudev-3.2.12-sticky-tags.patch 4775 BLAKE2B e1eca0feb6f235aa69308673a523be4a702884f790609760ef198a9820b26617d6c1e7d8f6f3b2203b5d483dbd3658e60914d80fc1b17c8c79591c20a6a9cb6b SHA512 38d9395fe0d5ad637a756b01c861889d0794d6fa75f56ecfcacdd1ada0c3c19a17a78e556c07d851f7c3e34bf289d5e85d3a437e007c98133ba8079f6b138293 AUX udev-postmount 1208 BLAKE2B bcfbaee26ea666304091092deabcc068c533c7707252917a0d8617812f26744c0454f10f5f829031f8668a345c35034ec68396cbf07792a4a83a87e3816001bb SHA512 8ef1b911843ab13acb1c1b9b7a0a5cd76659f395c3db9e579429556f23eacebb414507dc0231e2455e7589bc70054fa1e6b6dd93dd833f7101c0da0597aabf88 DIST eudev-3.2.11.tar.gz 2254373 BLAKE2B cfa6235d6509b751fde93ff2b0961b93c3741458e561a7ad9b07b49a57779627532cff25ad3519e5f79320854fcedfcdc23642ef542505cebcd6b2803067389a SHA512 17b328365913af3e434abe667dd0498c3702a41c6cb66f3793ca2c195b05ac06397b0a401077f81df7dd25193e4eeea13657a221ca6cb3d237c4d91e31e30b33 DIST eudev-3.2.12.tar.gz 2195743 BLAKE2B 1d2dcc158432f722904f645749420cb44ff98f68b8b8fc11917e83750c95280d0dc2c4d9a322909a4acdb9455c6ec373eade77aacb1039096daa8e642076d3d1 SHA512 da63364e4337515b60a39d354344c03afa1f79d76e264f2ec859c8b8c922595cf24c046e5b0a1bbaa33c5eb6d47632e7853a51bc9304dce2c308318e094a6ec1 EBUILD eudev-3.2.11-r4.ebuild 7146 BLAKE2B b4961871e468c9f2f708b24be8f40f59ce54c0d9de8b14df833cae7764689c2c991b1fed806aaa1c8991f3c8d145ef7dd692eae7140601d3908f7dab1ccbd8a0 SHA512 75484b41d701334673c86fb4fc1066678d0ad9140aea68ce76febda8d4edc7df61af620656be093d6971640bab515670798a4212c6cac19b1e4b7fc7dd516674 EBUILD eudev-3.2.11-r5.ebuild 7378 BLAKE2B 56592f5ad0382ac944821d816310987d1a8cef10e73e19a92bbd012f1cbd49ed0bc8075367ff851145dcb5270fc9f0361f946c27eee02183da3b1d05d8e0c70d SHA512 f05ebe1e069664e612e14512d8c6a181075d356baabfe32e3990773b346c66d1f648f17ff311d603b1e022c520bf492c672f249606c5169225eda8125a2e0727 EBUILD eudev-3.2.12-r1.ebuild 7283 BLAKE2B dac57fec7b4dee0b087dec4583849f494608d9d5ee5a925dc0f5f7f0fcceaed5164d9489afbb9f74f1a68029dcc7d13e03ae2f5ff65b4544a89cac09e8d1c98d SHA512 793ffe32b13efcbd7fe4726c30dbca593a64bb294404b9b66b433c3f50215ecfda0cb371f238442adf5a66e6348b3b303b86fb0ad58b1f96c590d0dd8353cfaf -EBUILD eudev-9999.ebuild 7291 BLAKE2B 266fa1aa07735a92a10ed641a0652a84cc6a60f1edefe57eadbe25bb473600eef54359d2899953cb8209f9e1f6fa65cc7654cf8c2b464797b5d14b419bf0b711 SHA512 788a703376824c5f58e8f4d508aaa63dbda778234fcab7a6e7a073e7101fa17ec348dbbf0dca88a012dfea7d66f37750c25d4af5b3ff4ae87e05723a3cda7a19 +EBUILD eudev-3.2.12-r2.ebuild 7382 BLAKE2B 4e5b50d987a7433358b9b1c636723efb1809576b8b0bd5e0694ba64fa490abf4dafea0663a2eaa122b815b284816c4ea55d9a4092adedd339741b5f0637b5491 SHA512 c72a3f935a753f2c9c4226e6e0e34e07220fb04db7b141b3134346d9714732324632c87ed14589ee1af5dc6b18151e08e401ac035ff523ae381a91e592dbd22f +EBUILD eudev-9999.ebuild 7350 BLAKE2B 039c5b9fdaa82e2285a99561c3ebd9a4abbd81de6b566e485dc1e881ca6e9d76860aa6ab53f51f3af04600f66b610a18055b4469e87ed6229e5cfe977a225801 SHA512 c3b43c27a763cf4ef33a732379f9c1c5a6ffa4ebc0d7776ef0844f5eee98e3e45e61c3b40b26ff64cc908057f907357ed6c6a91895fb93f1f6d824387be4775c MISC metadata.xml 629 BLAKE2B c67407dd805c6e8d4fb0c5152e897263ca56649d1d5c7692c74a69a751e7824a2b6084fe1ce0f8cd1b13dbdd0ae3f082430d6552807690a9d52d83c907f43f64 SHA512 204a04a68ee53fe8fec226ad82fdbb3f2ee478f538379466343bbf55fd0146a71889ac11742d59261ef954bb9b8e09e8d2b9416079da63cc78ab400efd2ba49b diff --git a/sys-fs/eudev/eudev-3.2.12-r2.ebuild b/sys-fs/eudev/eudev-3.2.12-r2.ebuild new file mode 100644 index 0000000..e7815d7 --- /dev/null +++ b/sys-fs/eudev/eudev-3.2.12-r2.ebuild @@ -0,0 +1,282 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +KV_MIN=2.6.39 + +inherit autotools linux-info multilib-minimal toolchain-funcs udev + +if [[ ${PV} = 9999* ]]; then + EGIT_REPO_URI="https://github.com/eudev-project/eudev.git" + inherit git-r3 +else + MY_PV=${PV/_pre/-pre} + SRC_URI="https://github.com/eudev-project/eudev/releases/download/v${MY_PV}/${PN}-${MY_PV}.tar.gz" + S="${WORKDIR}"/${PN}-${MY_PV} + + if [[ ${PV} != *_pre* ]] ; then + KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" + fi +fi + +DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" +HOMEPAGE="https://github.com/eudev-project/eudev" + +LICENSE="LGPL-2.1 MIT GPL-2" +SLOT="0" +IUSE="+kmod rule-generator selinux split-usr static-libs test" +RESTRICT="!test? ( test )" + +DEPEND=" + >=sys-apps/util-linux-2.20 + >=sys-kernel/linux-headers-${KV_MIN} + virtual/libcrypt:= + kmod? ( >=sys-apps/kmod-16 ) + selinux? ( >=sys-libs/libselinux-2.1.9 ) + !sys-apps/gentoo-systemd-integration + !sys-apps/systemd +" +RDEPEND=" + ${DEPEND} + acct-group/input + acct-group/kvm + acct-group/render + acct-group/audio + acct-group/cdrom + acct-group/dialout + acct-group/disk + acct-group/floppy + acct-group/input + acct-group/kmem + acct-group/kvm + acct-group/lp + acct-group/render + acct-group/sgx + acct-group/tape + acct-group/tty + acct-group/usb + acct-group/video + !sys-apps/systemd-utils[udev] + !sys-fs/udev + !sys-apps/systemd + !sys-apps/hwids[udev] +" +BDEPEND=" + dev-util/gperf + virtual/os-headers + virtual/pkgconfig + test? ( + app-text/tree + dev-lang/perl + ) +" +PDEPEND=">=sys-fs/udev-init-scripts-26" + +MULTILIB_WRAPPED_HEADERS=( + /usr/include/udev.h +) + +PATCHES=( + "${FILESDIR}"/${PN}-3.2.12-sticky-tags.patch +) + +pkg_pretend() { + ewarn + ewarn "As of 2013-01-29, ${PN} provides the new interface renaming functionality," + ewarn "as described in the URL below:" + ewarn "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames" + ewarn + ewarn "This functionality is enabled BY DEFAULT because eudev has no means of synchronizing" + ewarn "between the default or user-modified choice of sys-fs/udev. If you wish to disable" + ewarn "this new iface naming, please be sure that /etc/udev/rules.d/80-net-name-slot.rules" + ewarn "exists: touch /etc/udev/rules.d/80-net-name-slot.rules" + ewarn +} + +pkg_setup() { + CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~UNIX" + linux-info_pkg_setup + get_running_version + + # These are required kernel options, but we don't error out on them + # because you can build under one kernel and run under another. + if kernel_is lt ${KV_MIN//./ }; then + ewarn + ewarn "Your current running kernel version ${KV_FULL} is too old to run ${P}." + ewarn "Make sure to run udev under kernel version ${KV_MIN} or above." + ewarn + fi +} + +src_prepare() { + default + + # Change rules back to group uucp instead of dialout for now + sed -e 's/GROUP="dialout"/GROUP="uucp"/' -i rules/*.rules \ + || die "failed to change group dialout to uucp" + + # required for the sticky-tags patch + #if [[ ${PV} == 9999* ]] ; then + eautoreconf + #fi +} + +rootprefix() { + usex split-usr '' /usr +} + +sbindir() { + usex split-usr sbin bin +} + +multilib_src_configure() { + # bug #463846 + tc-export CC + # bug #502950 + export cc_cv_CFLAGS__flto=no + + local myeconfargs=( + ac_cv_search_cap_init= + ac_cv_header_sys_capability_h=yes + + DBUS_CFLAGS=' ' + DBUS_LIBS=' ' + + --with-rootprefix="${EPREFIX}$(rootprefix)" + --with-rootrundir=/run + --exec-prefix="${EPREFIX}" + --bindir="${EPREFIX}$(rootprefix)/bin" + --sbindir="${EPREFIX}$(rootprefix)/$(sbindir)" + --includedir="${EPREFIX}"/usr/include + --libdir="${EPREFIX}/usr/$(get_libdir)" + --with-rootlibexecdir="${EPREFIX}$(rootprefix)/lib/udev" + $(use_enable split-usr) + --enable-manpages + ) + + # Only build libudev for non-native_abi, and only install it to libdir, + # that means all options only apply to native_abi + if multilib_is_native_abi ; then + myeconfargs+=( + --with-rootlibdir="${EPREFIX}$(rootprefix)/$(get_libdir)" + $(use_enable kmod) + $(use_enable static-libs static) + $(use_enable selinux) + $(use_enable rule-generator) + ) + else + myeconfargs+=( + --disable-static + --disable-kmod + --disable-selinux + --disable-rule-generator + --disable-hwdb + ) + fi + + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" +} + +multilib_src_compile() { + if multilib_is_native_abi ; then + emake + else + emake -C src/shared + emake -C src/libudev + fi +} + +multilib_src_test() { + # Make sandbox get out of the way. + # These are safe because there is a fake root filesystem put in place, + # but sandbox seems to evaluate the paths of the test i/o instead of the + # paths of the actual i/o that results. Also only test for native abi + if multilib_is_native_abi ; then + addread /sys + addwrite /dev + addwrite /run + + default + fi +} + +multilib_src_install() { + if multilib_is_native_abi ; then + emake DESTDIR="${D}" install + else + emake -C src/libudev DESTDIR="${D}" install + fi +} + +multilib_src_install_all() { + find "${ED}" -name '*.la' -delete || die + + insinto "$(rootprefix)/lib/udev/rules.d" + doins "${FILESDIR}"/40-gentoo.rules + + use rule-generator && doinitd "${FILESDIR}"/udev-postmount +} + +pkg_postrm() { + udev_reload +} + +pkg_postinst() { + udev_reload + + mkdir -p "${EROOT}"/run + + # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766 + # So try to remove it here (will only work if empty). + rmdir "${EROOT}"/dev/loop 2>/dev/null + if [[ -d ${EROOT}/dev/loop ]]; then + ewarn "Please make sure your remove /dev/loop," + ewarn "else losetup may be confused when looking for unused devices." + fi + + # REPLACING_VERSIONS should only ever have zero or 1 values but in case it doesn't, + # process it as a list. We only care about the zero case (new install) or the case where + # the same version is being re-emerged. If there is a second version, allow it to abort. + local rv rvres=doitnew + for rv in ${REPLACING_VERSIONS} ; do + if [[ ${rvres} == doit* ]]; then + if [[ ${rv%-r*} == ${PV} ]]; then + rvres=doit + else + rvres=${rv} + fi + fi + done + + if has_version 'sys-apps/hwids[udev]'; then + udevadm hwdb --update --root="${ROOT}" + + # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda + # reload database after it has be rebuilt, but only if we are not upgrading + # also pass if we are -9999 since who knows what hwdb related changes there might be + if [[ ${rvres} == doit* ]] && [[ -z ${ROOT} ]] && [[ ${PV} != "9999" ]]; then + udevadm control --reload + fi + fi + + if [[ ${rvres} != doitnew ]]; then + ewarn + ewarn "You need to restart eudev as soon as possible to make the" + ewarn "upgrade go into effect:" + ewarn "\t/etc/init.d/udev --nodeps restart" + fi + + if use rule-generator && \ + [[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qsv 'boot\|default\|sysinit'; then + ewarn + ewarn "Please add the udev-postmount init script to your default runlevel" + ewarn "to ensure the legacy rule-generator functionality works as reliably" + ewarn "as possible." + ewarn "\trc-update add udev-postmount default" + fi + + elog + elog "For more information on eudev on Gentoo, writing udev rules, and" + elog "fixing known issues visit: https://wiki.gentoo.org/wiki/Eudev" +} diff --git a/sys-fs/eudev/eudev-9999.ebuild b/sys-fs/eudev/eudev-9999.ebuild index 2097b56..2ca03c4 100644 --- a/sys-fs/eudev/eudev-9999.ebuild +++ b/sys-fs/eudev/eudev-9999.ebuild @@ -77,6 +77,10 @@ MULTILIB_WRAPPED_HEADERS=( /usr/include/udev.h ) +PATCHES=( + "${FILESDIR}"/${PN}-3.2.12-sticky-tags.patch +) + pkg_pretend() { ewarn ewarn "As of 2013-01-29, ${PN} provides the new interface renaming functionality," diff --git a/sys-fs/eudev/files/eudev-3.2.12-sticky-tags.patch b/sys-fs/eudev/files/eudev-3.2.12-sticky-tags.patch new file mode 100644 index 0000000..67dcb27 --- /dev/null +++ b/sys-fs/eudev/files/eudev-3.2.12-sticky-tags.patch @@ -0,0 +1,125 @@ +https://github.com/eudev-project/eudev/issues/249 +https://patch-diff.githubusercontent.com/raw/eudev-project/eudev/pull/253 + +From 7d2123ead5a15d4b2aff70eafc6f7b9b2f6527ac Mon Sep 17 00:00:00 2001 +From: Boian Bonev +Date: Fri, 11 Aug 2023 22:08:27 +0000 +Subject: [PATCH 1/3] Bump udev version to 251 + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 3e31b0ebc..069fdfb87 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,6 +1,6 @@ + AC_PREREQ([2.68]) + AC_INIT([eudev],[3.2.12],[https://github.com/gentoo/eudev/issues]) +-AC_SUBST(UDEV_VERSION, 243) ++AC_SUBST(UDEV_VERSION, 251) + AC_CONFIG_SRCDIR([src/udev/udevd.c]) + + AC_USE_SYSTEM_EXTENSIONS + +From dacff83d872c1dcb563439f98c9b974e244fcd46 Mon Sep 17 00:00:00 2001 +From: Boian Bonev +Date: Fri, 11 Aug 2023 23:14:02 +0000 +Subject: [PATCH 2/3] Export dummies for + + - udev_device_has_current_tag + - udev_device_get_current_tags_list_entry + +since the current eudev device database does not support the concept of +current tags +--- + src/libudev/libudev-device.c | 11 +++++++++++ + src/libudev/libudev.h | 2 ++ + src/libudev/libudev.sym | 6 ++++++ + 3 files changed, 19 insertions(+) + +diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c +index ac67ce846..7d7a6622e 100644 +--- a/src/libudev/libudev-device.c ++++ b/src/libudev/libudev-device.c +@@ -1819,6 +1819,12 @@ _public_ struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_dev + return udev_list_get_entry(&udev_device->tags_list); + } + ++_public_ struct udev_list_entry *udev_device_get_current_tags_list_entry(struct udev_device *udev_device) ++{ ++ // TODO: eudev database does not support current tags ++ return udev_device_get_tags_list_entry(udev_device); ++} ++ + /** + * udev_device_has_tag: + * @udev_device: udev device +@@ -1842,6 +1848,11 @@ _public_ int udev_device_has_tag(struct udev_device *udev_device, const char *ta + return false; + } + ++_public_ int udev_device_has_current_tag(struct udev_device *udev_device, const char *tag) { ++ // TODO: eudev database does not support current tags ++ return udev_device_has_tag(udev_device, tag); ++} ++ + #define ENVP_SIZE 128 + #define MONITOR_BUF_SIZE 4096 + static int update_envp_monitor_buf(struct udev_device *udev_device) +diff --git a/src/libudev/libudev.h b/src/libudev/libudev.h +index 8491d2b81..0202964d6 100644 +--- a/src/libudev/libudev.h ++++ b/src/libudev/libudev.h +@@ -100,6 +100,7 @@ int udev_device_get_is_initialized(struct udev_device *udev_device); + struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device); + struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device); + struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device); ++struct udev_list_entry *udev_device_get_current_tags_list_entry(struct udev_device *udev_device); + struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device); + const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key); + const char *udev_device_get_driver(struct udev_device *udev_device); +@@ -110,6 +111,7 @@ unsigned long long int udev_device_get_usec_since_initialized(struct udev_device + const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr); + int udev_device_set_sysattr_value(struct udev_device *udev_device, const char *sysattr, char *value); + int udev_device_has_tag(struct udev_device *udev_device, const char *tag); ++int udev_device_has_current_tag(struct udev_device *udev_device, const char *tag); + + /* + * udev_monitor +diff --git a/src/libudev/libudev.sym b/src/libudev/libudev.sym +index 76726fca7..d56c2aeab 100644 +--- a/src/libudev/libudev.sym ++++ b/src/libudev/libudev.sym +@@ -118,3 +118,9 @@ global: + udev_queue_flush; + udev_queue_get_fd; + } LIBUDEV_199; ++ ++LIBUDEV_247 { ++global: ++ udev_device_has_current_tag; ++ udev_device_get_current_tags_list_entry; ++} LIBUDEV_215; + +From df220edbc585d2e7a08ed8ad90770fefd0e60bb5 Mon Sep 17 00:00:00 2001 +From: Boian Bonev +Date: Fri, 11 Aug 2023 23:16:10 +0000 +Subject: [PATCH 3/3] bump version to 3.2.14 + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 069fdfb87..0d9a135bc 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,5 +1,5 @@ + AC_PREREQ([2.68]) +-AC_INIT([eudev],[3.2.12],[https://github.com/gentoo/eudev/issues]) ++AC_INIT([eudev],[3.2.14],[https://github.com/gentoo/eudev/issues]) + AC_SUBST(UDEV_VERSION, 251) + AC_CONFIG_SRCDIR([src/udev/udevd.c]) +