diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-fs/udev |
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-fs/udev')
-rw-r--r-- | sys-fs/udev/Manifest | 24 | ||||
-rw-r--r-- | sys-fs/udev/files/232-0002-build-sys-add-check-for-gperf-lookup-function-signat.patch | 302 | ||||
-rw-r--r-- | sys-fs/udev/files/233-format-warnings.patch | 84 | ||||
-rw-r--r-- | sys-fs/udev/files/234-uucp-group.patch | 11 | ||||
-rw-r--r-- | sys-fs/udev/files/systemd-232-pkgconfig.patch | 50 | ||||
-rw-r--r-- | sys-fs/udev/files/udev-229-sysmacros.patch | 82 | ||||
-rw-r--r-- | sys-fs/udev/metadata.xml | 16 | ||||
-rw-r--r-- | sys-fs/udev/udev-216.ebuild | 489 | ||||
-rw-r--r-- | sys-fs/udev/udev-225-r1.ebuild | 430 | ||||
-rw-r--r-- | sys-fs/udev/udev-233.ebuild | 408 | ||||
-rw-r--r-- | sys-fs/udev/udev-234-r1.ebuild | 329 | ||||
-rw-r--r-- | sys-fs/udev/udev-235.ebuild | 329 | ||||
-rw-r--r-- | sys-fs/udev/udev-9999.ebuild | 329 |
13 files changed, 2883 insertions, 0 deletions
diff --git a/sys-fs/udev/Manifest b/sys-fs/udev/Manifest new file mode 100644 index 000000000000..435773d01a01 --- /dev/null +++ b/sys-fs/udev/Manifest @@ -0,0 +1,24 @@ +AUX 232-0002-build-sys-add-check-for-gperf-lookup-function-signat.patch 13821 SHA256 089ecb3adf70be9ac80feaa43987b4ba65dba0e449e37f6afda443d2b46623b4 SHA512 1056b7d661b65a26ec77e01d61dd06a1e244ddb0a70ed9cbefbfa3ade2368da18247d96a7d0fd0ccdd087eb9157e79be9a5751c3fe30535a12532479eedbbe44 WHIRLPOOL 598445d0449ccc951879f46fd606c34cc439d973509efcd3bc5709ec150b062d38afb508a3c6c93843bbefb5f2ee66866cd3fa032859eeab2c8fed3009798846 +AUX 233-format-warnings.patch 3837 SHA256 20c4caf0bb173dbf60a7c98e581adefe8428f8be322412ab89edeab704542cbf SHA512 491cdbdb75e1ef338cd660fd89c776e3dd2881922eb04f505dda985104f14813e9da9e758393d906ff224e9e03888cafd05f7e665f71c43580a2989af54981bc WHIRLPOOL 669c61cb4a6f5c435722d8602b4c2634d3231c9ea43ba280132ee7e4999af45cfd7eb49bfa4a8a20d87ffb56074783c8c0c6c9568f13b754f805a165ac6ccdfe +AUX 234-uucp-group.patch 536 SHA256 b3ef6c7d40d86dfc801ff7839876dcffb299d0b6d5b11fbf081adfe51ee0d8e6 SHA512 6ffaa3b50f36598682019c1c6b171ad121d57ba9cfd379be5f46f64621dc026a82069922b78a62a5c477bb117e700a31e0315872d78378755cd4150abd22a912 WHIRLPOOL dc9bbd2879af33a8ff27e7a13052c51b4ddc1b336bbd58ed0b5e28bb63229acbb355b6316cc58555b12eee8ed2d73ba25ee21286e8e0f429d6760e70dc6de5a4 +AUX systemd-232-pkgconfig.patch 1472 SHA256 e43b9faf789c7cb370be2961d4064714bf6bec6210e05b0079cf5d2dc4ac16db SHA512 eba2c6f84fcc7215e0ca1ac11e672e3f03b2494e1d4b2aa623b4eeb15986a0bc828d6d867baa9123789467ae81a44f636630a090ac3336998434bae286475ae7 WHIRLPOOL 1a4c84beb2d27a4cd56aedb0443bd1478a0b8fb0b8d49ed639c435b49cfdcd3815e2fe6b9a739dd5f9a08df60e338bca358dbfa6082c908d84dc35b904348ab7 +AUX udev-229-sysmacros.patch 2172 SHA256 ed4497a6478f198ec663b919d5e0fad829a1488f35842672719dcb797786106b SHA512 003f32b3cc0c070bd524ea708b26ea50b570cf10ebdb6588012d060395db41b409da71b438c6d1718aae6b50ce92e1a21aaab32b23284c72ab8c147480bc369a WHIRLPOOL 923b44df613373a70b72022f5fa6b2faa7396ed3d57b7fffe66345616aedc3d8e510cc78430e4c1d22ee5c39504c719fea287f6095500cde65525819231e659e +DIST systemd-216.tar.xz 3612960 SHA256 945d3db7d840d6ffe98aa68394428e13317161ae79905397faab6671619728f3 SHA512 f4eee6664368168eafd61939f1355ac21c7eeecce6247de98ef36f40bb6a942d12c006ced4ee15f3d8f11699c194990222d5a5115b45f2aa81f2a1abafebbdd2 WHIRLPOOL 505e09b55209a4f9d8cec077970571b2e1298e8db02946a6c79df139dece9d1a08e46c86ef6c8053274abfd46c9a5ea09157f5bc9dc1f7461322c596e84ef494 +DIST systemd-225.tar.gz 3878442 SHA256 b2f576bb3688e9315f2f49b98e141ac6f964567370e98ebd8fd7332a0a6f9701 SHA512 35b3946509c7b01660da4370d3c51ff0e6a537dadd9dbb0a039c4f7ed552fd4e02ebac6eb8a788f61f1e3ba99444238d959051dd004c174b027729a80368ac19 WHIRLPOOL 47cd3b5690dafdf3c0ef6a9767e947666b1853541f8aefd17eb5c07eee1477daf32f3b249b04327b1c56d8ec430745725383750b97755bb6cf594d354a7ffdf8 +DIST systemd-233.tar.gz 4660737 SHA256 8b3e99da3d4164b66581830a7f2436c0c8fe697b5fbdc3927bdb960646be0083 SHA512 5ad5329ea116d973cf67096f7e7ad28e9ea0905696e9451291f1d25e5064f4a9bfcfae87e912996c6a38397e9f4a148d4ccecfa9b70f7ecdf04deadb61784c8e WHIRLPOOL ce19f6a546b8f899cfa952e49d47f063fd29186be4a53391bc30ea2c487eb2c140a74ad843a1dc499bb61bba3e9ca055613852291e38b85af5d79c59409dc176 +DIST systemd-234.tar.gz 4800186 SHA256 da3e69d10aa1c983d33833372ad4929037b411ac421fb085c8cee79ae1d80b6a SHA512 762336a7d96c6583cf71cad62efce95a0ed93cd0a0d7251f128d10dba8200c0c8df0e5a7d168179ababa5b221295a231e73b7e7ea2697cb3fb5c1b33538efa68 WHIRLPOOL 9ff9f25ce82514db969a427eee51c0483b2bcaaa611f93c1fc17c356ea25eee712217708c54101ecaafd835cd8ac988b16e8ad411b48541a32442b9a0d148f07 +DIST systemd-235.tar.gz 6586406 SHA256 25811f96f5a027bf2a4c9383495cf5b623e385d84da31e473cf375932b3e9c52 SHA512 243f2eb5340fa37dd1286eaa63e83387bda9e03953af266cd6196a37535a13491482caf14c6ab10608bba4ed23b6c41923608e52017e0c26988ed72ddd2b9993 WHIRLPOOL 05e50b31f7b3b1cd756abd1580dddae0e114953857564133784fc43b9ecd0e203ee534aaf76531ca7af5c43b03b9b73c6cbbbb1caf5afb17502555cc52fe06cd +DIST udev-216-patches-2.tar.xz 1264 SHA256 18b7b8f852f11c2ac2a58458462ce686ebec48859562df99c5b9c29c95ddfa3c SHA512 1f5912f3bbc3e40a4efad9de8b1fab2b3a750f3f23c9f2e33a581658959d22cf23f9ff1b8f51597874e7bca1d0f757f37fd5550b4112160261559524eda261f4 WHIRLPOOL 8f93f982de2d1fa10f7e3c6541c559f2c881730276498b14d4d27b8577bdb340d49b2dc7a50a40e8a13fcabbbabb3dfa5f1605aa842e325d12c17e82d2dc787b +EBUILD udev-216.ebuild 15211 SHA256 1956446711ae573820ba9c7eb62d02d7d639e92c2639aa862997a22c02f2ff23 SHA512 bf4e3c887eaca0ab747b5ffbcceeba94ed6662a27838cc9f5c09bb248483ececbe37cc9db17a3fd246f789874cc62b2ed831e7f452f9c5163e735da33c924b68 WHIRLPOOL ac87169c63ff6c8abc319ea5e95235f3887a78be99a4e53dffd162c79353832b5905fa7ac43b0d8327655062f9fa44012f890cc2b9b37f2418d289772f8ad739 +EBUILD udev-225-r1.ebuild 13566 SHA256 0a6db545084e5f3fdb9ff3fa023ac4150247a5fc2344b74497171219ce1b9d1a SHA512 ea3955b5cee2d1a1adfe21cc00eda4e6378a344f5862e1825fdb4bf313077b6e2b5fbb8ee80e786ab4809644d1b3c39dcdcbe14bd01e17e94ca2726d1f3de33d WHIRLPOOL 0999164d1b298817fd93d70a0db00463082a6c42a39778252387f90097d17dac0b80beeb1ffdb145e30ddad06381b0dcd3f78b542efb952c40fa04d41f4d3caf +EBUILD udev-233.ebuild 12992 SHA256 7221682da2b730dfbeee68fd1f0f879d7dfd1d9d96b8aba2247f77765fa21f4a SHA512 43a241d81d922547ae4477c57aaf4f9007fb1d47dbe542185673f14d6cc4e5efec467b7f4e2d79ed4bcde498bb8fef57d0fa43e8be9791aebb0bae321b18495d WHIRLPOOL 3f9ecc1d8b605c9b3a36f402b3b25a143c20b26815df47f44bf14550b284dd305db48a48140a6e00703eb0fe5b5f58d0991691f409933dafb801d1fd6d3dfd83 +EBUILD udev-234-r1.ebuild 9955 SHA256 d896ac8a8233703a6b3eb004f187e02c68765261984a6335d424c74405fbcf06 SHA512 f8717265cb3ab78525381eec12c40d9194610df22f6eecdbd08e7f275bd760a1fd7e17ba0d4c2860df5ecc3f5363ae065d88b7cd4b0f381b29e7a9749da800cc WHIRLPOOL 23d4a029a70b6b47c0b15178ef3a34572008d2b228c25d2a15606cf897704fc9e833f58b37803c20e6560e4bb5f4b92a16bdd48db28d92206a3ee5a3f566d247 +EBUILD udev-235.ebuild 9953 SHA256 9ffba1659586008768a47d629ac5ac6b3058f77e3c3df063db11db72b98a2511 SHA512 dc6614e41e872907f151ce6a5b4d11e68f4d247982f24845a330042c2130d5c14381bf5ff70c03b71f77e0a54eb1a6b6eff3a38c8628d0397b960bda832f6073 WHIRLPOOL 4beefb5af73c18f58c5e2a3fbaa4bbaa2ae465d0e09f4ed168c587a115e058df79e95f9d231c4528a40661168549f8e7f48dfa8b589251a757ac0e68d547f11b +EBUILD udev-9999.ebuild 9953 SHA256 9ffba1659586008768a47d629ac5ac6b3058f77e3c3df063db11db72b98a2511 SHA512 dc6614e41e872907f151ce6a5b4d11e68f4d247982f24845a330042c2130d5c14381bf5ff70c03b71f77e0a54eb1a6b6eff3a38c8628d0397b960bda832f6073 WHIRLPOOL 4beefb5af73c18f58c5e2a3fbaa4bbaa2ae465d0e09f4ed168c587a115e058df79e95f9d231c4528a40661168549f8e7f48dfa8b589251a757ac0e68d547f11b +MISC ChangeLog 11624 SHA256 cf398f01e452cb0c3e73fa8f13539ac77cd3169d57829de8dd2a15f4084ea7ae SHA512 920e25d3eee9b85b43d59307108a552a935ee6d2df667fa0727c8eaab7c092bddffa3e6d03099a6bbbfb39bf41db2e337a60970f9ea7f9f7348810e56db0fd3d WHIRLPOOL 28685743fb3bdbdda52173630ebf6e3b8c622f50d591a793d9713f966109f28c20593705507a07ff29c774815bc0157d12a2acc16ded1c11273d3b7ba32b5784 +MISC ChangeLog-2009 105929 SHA256 94137298457e8d6361cf25e664279d2f9b424f6758814e7ba90e9e2cbf1ea7e5 SHA512 f110e1aa70b11c28263ec5e88973c99426717bce62400c8e9ad860b9e7b67d4aadc053596a9e54faa9435a774c1e8aa0954ae8541760cf061beef26867871548 WHIRLPOOL 215252c0a5c249241813d1bb208da62e68c858e07d1df327cf9175ac739f214813a33c09a64afb4821445e93394dd6d6d500b33e35ed912c1eeccff3365cb7fb +MISC ChangeLog-2010 10729 SHA256 44fe328d57b1ba342b328c7a256632e7960976a12e8e9c9791a5fc8ce52c67ca SHA512 a8c371aafe757923e24c023cbf55f3ad084f15f0f038eceaee0dffe58919a17b17bc16cb4b7b1d3f65a19c82b20330a854ec2c801f6d7c7799723ab92d255b49 WHIRLPOOL 3d34e758def921d3d2ed7369392ba5f833fc3a899181c2895fd3da6c9846cf41c9eddbf56de60a52fadd76ffd4c66d92b660b0bc6ca4dddbb2fa49fe0f93cb0b +MISC ChangeLog-2011 11721 SHA256 363429a267f251b1ac1c34479e7afa5d7ea13811aa1ba46d7c5489860e542276 SHA512 be7bbaa68602c30ba9cb3e5037ee91ff94c35a0c2ff0b96c5eee14c0e81f8e52232bae44f1d01ff23acedabdb03fdc78f3d11a40cfed2cfef1c45fe2492f7bf4 WHIRLPOOL 3e85eb967f26a8224fd0ed5824009c62271fa5269a6a207da8c8abd7b09cc4308ff847021afcae5a86cedd723a5aeca1ce2f6712a187dfbd36118e097d74510f +MISC ChangeLog-2012 23242 SHA256 5466af35dd494cc2a4d0bc9cc0f4ff03e0d3d7ac7ec595a70b2b15896f33658f SHA512 8488fe00da8ba8b3db5d72c35ee3ed5b372a673a09eb0422102583a76d6671ffded8d0086362fddb2bb056a9b9a1f7c3139dfbb48d0bcd12a53ac07ad9473e68 WHIRLPOOL 0352206d82c41cbf3ac0fcbf3392e8e7ae94e8bcf35d8cb8a99c48bf790aa94b9f90a627deb155ab41d8c2f028658720f55347a6e1048e5c798060cc579d2c49 +MISC ChangeLog-2015 62813 SHA256 37450fd0c56453744f0db76a9d517168aafb39c5fdda58f097c58184ecc3885d SHA512 27316fc6d1eb4bb701ab03f36e426d960d8ff78c96a0d0f99a80d6e30f728f85f5faaa02e9166f566245d82b616a3d699fecef66a5c7f9affdbdf4e20384cc21 WHIRLPOOL 92c2d292e48ef211e148a09b4cddef6c583913e3d1b9077e35f2848472b3f1685b3d8b9e5fa213003dc56f1dcd91d4622e4982ac151ad15c3d42ebfd47a4ba09 +MISC metadata.xml 680 SHA256 b96171ebeb342056836865bcb506e97f3eca86bd2c30144ac84bc7ad48990593 SHA512 2e90cdfb013904211fba8404c6b96ad940dfaea05eebe7592e3fa185dec9b16b738cc7661fd466990788accf8c261a596bcb08477e879e0e18fcc91cdce65c5e WHIRLPOOL d14b62241983ba8929771a68d070da5d8b13bc745b09535694caeb3d3c2d8782cc4a1ced02cb983b884600c783cc1aa0a4879cc2ced8a3475f179c972c2b8266 diff --git a/sys-fs/udev/files/232-0002-build-sys-add-check-for-gperf-lookup-function-signat.patch b/sys-fs/udev/files/232-0002-build-sys-add-check-for-gperf-lookup-function-signat.patch new file mode 100644 index 000000000000..440ec75bd3bb --- /dev/null +++ b/sys-fs/udev/files/232-0002-build-sys-add-check-for-gperf-lookup-function-signat.patch @@ -0,0 +1,302 @@ +From 016fb3b83b861cfe58694996076a9764dcb46475 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppymaster@gmail.com> +Date: Tue, 10 Jan 2017 02:39:05 -0500 +Subject: [PATCH 2/2] build-sys: add check for gperf lookup function signature + (#5055) + +gperf-3.1 generates lookup functions that take a size_t length +parameter instead of unsigned int. Test for this at configure time. + +Fixes: https://github.com/systemd/systemd/issues/5039 +--- + configure.ac | 22 ++++++++++++++++++++++ + src/basic/af-list.c | 2 +- + src/basic/arphrd-list.c | 2 +- + src/basic/cap-list.c | 2 +- + src/basic/errno-list.c | 2 +- + src/core/load-fragment.h | 2 +- + src/journal/journald-server.h | 2 +- + src/login/logind.h | 2 +- + src/network/networkd-conf.h | 2 +- + src/network/networkd-netdev.h | 2 +- + src/network/networkd-network.h | 2 +- + src/nspawn/nspawn-settings.h | 2 +- + src/resolve/dns-type.c | 2 +- + src/resolve/resolved-conf.h | 2 +- + src/test/test-af-list.c | 2 +- + src/test/test-arphrd-list.c | 2 +- + src/timesync/timesyncd-conf.h | 2 +- + src/udev/net/link-config.h | 2 +- + src/udev/udev-builtin-keyboard.c | 2 +- + 19 files changed, 40 insertions(+), 18 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 1928e65bd..5c639e32d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -258,6 +258,28 @@ AC_CHECK_SIZEOF(rlim_t,,[ + #include <sys/resource.h> + ]) + ++GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)" ++ ++AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM([ ++ #include <string.h> ++ const char * in_word_set(const char *, size_t); ++ $GPERF_TEST] ++ )], ++ [GPERF_LEN_TYPE=size_t], ++ [AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM([ ++ #include <string.h> ++ const char * in_word_set(const char *, unsigned); ++ $GPERF_TEST] ++ )], ++ [GPERF_LEN_TYPE=unsigned], ++ [AC_MSG_ERROR([** unable to determine gperf len type])] ++ )] ++) ++ ++AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type]) ++ + # ------------------------------------------------------------------------------ + # we use python to build the man page index + have_python=no +diff --git a/src/basic/af-list.c b/src/basic/af-list.c +index 3fac9c508..4b291d177 100644 +--- a/src/basic/af-list.c ++++ b/src/basic/af-list.c +@@ -23,7 +23,7 @@ + #include "af-list.h" + #include "macro.h" + +-static const struct af_name* lookup_af(register const char *str, register unsigned int len); ++static const struct af_name* lookup_af(register const char *str, register GPERF_LEN_TYPE len); + + #include "af-from-name.h" + #include "af-to-name.h" +diff --git a/src/basic/arphrd-list.c b/src/basic/arphrd-list.c +index 6792d1ee3..2d598dc66 100644 +--- a/src/basic/arphrd-list.c ++++ b/src/basic/arphrd-list.c +@@ -23,7 +23,7 @@ + #include "arphrd-list.h" + #include "macro.h" + +-static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len); ++static const struct arphrd_name* lookup_arphrd(register const char *str, register GPERF_LEN_TYPE len); + + #include "arphrd-from-name.h" + #include "arphrd-to-name.h" +diff --git a/src/basic/cap-list.c b/src/basic/cap-list.c +index 3e773a06f..d68cc78d0 100644 +--- a/src/basic/cap-list.c ++++ b/src/basic/cap-list.c +@@ -26,7 +26,7 @@ + #include "parse-util.h" + #include "util.h" + +-static const struct capability_name* lookup_capability(register const char *str, register unsigned int len); ++static const struct capability_name* lookup_capability(register const char *str, register GPERF_LEN_TYPE len); + + #include "cap-from-name.h" + #include "cap-to-name.h" +diff --git a/src/basic/errno-list.c b/src/basic/errno-list.c +index 31b66bad5..c6a01eec8 100644 +--- a/src/basic/errno-list.c ++++ b/src/basic/errno-list.c +@@ -23,7 +23,7 @@ + #include "macro.h" + + static const struct errno_name* lookup_errno(register const char *str, +- register unsigned int len); ++ register GPERF_LEN_TYPE len); + + #include "errno-from-name.h" + #include "errno-to-name.h" +diff --git a/src/core/load-fragment.h b/src/core/load-fragment.h +index c05f205c3..ede6b1f73 100644 +--- a/src/core/load-fragment.h ++++ b/src/core/load-fragment.h +@@ -118,7 +118,7 @@ int config_parse_user_group(const char *unit, const char *filename, unsigned lin + int config_parse_user_group_strv(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + + /* gperf prototypes */ +-const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, unsigned length); ++const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, GPERF_LEN_TYPE length); + extern const char load_fragment_gperf_nulstr[]; + + typedef enum Disabled { +diff --git a/src/journal/journald-server.h b/src/journal/journald-server.h +index 99d91496b..d1520c45d 100644 +--- a/src/journal/journald-server.h ++++ b/src/journal/journald-server.h +@@ -179,7 +179,7 @@ void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, unsigne + void server_driver_message(Server *s, sd_id128_t message_id, const char *format, ...) _printf_(3,0) _sentinel_; + + /* gperf lookup function */ +-const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigned length); ++const struct ConfigPerfItem* journald_gperf_lookup(const char *key, GPERF_LEN_TYPE length); + + int config_parse_storage(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + +diff --git a/src/login/logind.h b/src/login/logind.h +index 086fa1eeb..7556ee2e4 100644 +--- a/src/login/logind.h ++++ b/src/login/logind.h +@@ -182,7 +182,7 @@ int manager_unit_is_active(Manager *manager, const char *unit); + int manager_job_is_active(Manager *manager, const char *path); + + /* gperf lookup function */ +-const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned length); ++const struct ConfigPerfItem* logind_gperf_lookup(const char *key, GPERF_LEN_TYPE length); + + int manager_set_lid_switch_ignore(Manager *m, usec_t until); + +diff --git a/src/network/networkd-conf.h b/src/network/networkd-conf.h +index c7bfb42a7..00ddb7672 100644 +--- a/src/network/networkd-conf.h ++++ b/src/network/networkd-conf.h +@@ -23,7 +23,7 @@ + + int manager_parse_config_file(Manager *m); + +-const struct ConfigPerfItem* networkd_gperf_lookup(const char *key, unsigned length); ++const struct ConfigPerfItem* networkd_gperf_lookup(const char *key, GPERF_LEN_TYPE length); + + int config_parse_duid_type( + const char *unit, +diff --git a/src/network/networkd-netdev.h b/src/network/networkd-netdev.h +index 70ff947b9..37c743121 100644 +--- a/src/network/networkd-netdev.h ++++ b/src/network/networkd-netdev.h +@@ -175,7 +175,7 @@ NetDevKind netdev_kind_from_string(const char *d) _pure_; + int config_parse_netdev_kind(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + + /* gperf */ +-const struct ConfigPerfItem* network_netdev_gperf_lookup(const char *key, unsigned length); ++const struct ConfigPerfItem* network_netdev_gperf_lookup(const char *key, GPERF_LEN_TYPE length); + + /* Macros which append INTERFACE= to the message */ + +diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h +index 42fc82d39..09c3b3a3a 100644 +--- a/src/network/networkd-network.h ++++ b/src/network/networkd-network.h +@@ -236,7 +236,7 @@ int config_parse_dhcp_route_table(const char *unit, const char *filename, unsign + /* Legacy IPv4LL support */ + int config_parse_ipv4ll(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + +-const struct ConfigPerfItem* network_network_gperf_lookup(const char *key, unsigned length); ++const struct ConfigPerfItem* network_network_gperf_lookup(const char *key, GPERF_LEN_TYPE length); + + extern const sd_bus_vtable network_vtable[]; + +diff --git a/src/nspawn/nspawn-settings.h b/src/nspawn/nspawn-settings.h +index 231e6d726..4ae34f8e2 100644 +--- a/src/nspawn/nspawn-settings.h ++++ b/src/nspawn/nspawn-settings.h +@@ -103,7 +103,7 @@ bool settings_private_network(Settings *s); + + DEFINE_TRIVIAL_CLEANUP_FUNC(Settings*, settings_free); + +-const struct ConfigPerfItem* nspawn_gperf_lookup(const char *key, unsigned length); ++const struct ConfigPerfItem* nspawn_gperf_lookup(const char *key, GPERF_LEN_TYPE length); + + int config_parse_capability(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + int config_parse_id128(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); +diff --git a/src/resolve/dns-type.c b/src/resolve/dns-type.c +index aaf5ed62c..d89ae28dc 100644 +--- a/src/resolve/dns-type.c ++++ b/src/resolve/dns-type.c +@@ -29,7 +29,7 @@ typedef const struct { + } dns_type; + + static const struct dns_type_name * +-lookup_dns_type (register const char *str, register unsigned int len); ++lookup_dns_type (register const char *str, register GPERF_LEN_TYPE len); + + #include "dns_type-from-name.h" + #include "dns_type-to-name.h" +diff --git a/src/resolve/resolved-conf.h b/src/resolve/resolved-conf.h +index fc425a36b..8184d6cad 100644 +--- a/src/resolve/resolved-conf.h ++++ b/src/resolve/resolved-conf.h +@@ -41,7 +41,7 @@ int manager_parse_search_domains_and_warn(Manager *m, const char *string); + int manager_add_dns_server_by_string(Manager *m, DnsServerType type, const char *word); + int manager_parse_dns_server_string_and_warn(Manager *m, DnsServerType type, const char *string); + +-const struct ConfigPerfItem* resolved_gperf_lookup(const char *key, unsigned length); ++const struct ConfigPerfItem* resolved_gperf_lookup(const char *key, GPERF_LEN_TYPE length); + + int config_parse_dns_servers(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + int config_parse_search_domains(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); +diff --git a/src/test/test-af-list.c b/src/test/test-af-list.c +index aeaa0929b..e2479133d 100644 +--- a/src/test/test-af-list.c ++++ b/src/test/test-af-list.c +@@ -24,7 +24,7 @@ + #include "string-util.h" + #include "util.h" + +-static const struct af_name* lookup_af(register const char *str, register unsigned int len); ++static const struct af_name* lookup_af(register const char *str, register GPERF_LEN_TYPE len); + + #include "af-from-name.h" + #include "af-list.h" +diff --git a/src/test/test-arphrd-list.c b/src/test/test-arphrd-list.c +index f3989ad20..8f4f342fa 100644 +--- a/src/test/test-arphrd-list.c ++++ b/src/test/test-arphrd-list.c +@@ -24,7 +24,7 @@ + #include "string-util.h" + #include "util.h" + +-static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len); ++static const struct arphrd_name* lookup_arphrd(register const char *str, register GPERF_LEN_TYPE len); + + #include "arphrd-from-name.h" + #include "arphrd-list.h" +diff --git a/src/timesync/timesyncd-conf.h b/src/timesync/timesyncd-conf.h +index cba0724b1..0280697e9 100644 +--- a/src/timesync/timesyncd-conf.h ++++ b/src/timesync/timesyncd-conf.h +@@ -22,7 +22,7 @@ + #include "conf-parser.h" + #include "timesyncd-manager.h" + +-const struct ConfigPerfItem* timesyncd_gperf_lookup(const char *key, unsigned length); ++const struct ConfigPerfItem* timesyncd_gperf_lookup(const char *key, GPERF_LEN_TYPE length); + + int manager_parse_server_string(Manager *m, ServerType type, const char *string); + +diff --git a/src/udev/net/link-config.h b/src/udev/net/link-config.h +index 91cc0357c..b0d8ceb76 100644 +--- a/src/udev/net/link-config.h ++++ b/src/udev/net/link-config.h +@@ -93,7 +93,7 @@ const char *mac_policy_to_string(MACPolicy p) _const_; + MACPolicy mac_policy_from_string(const char *p) _pure_; + + /* gperf lookup function */ +-const struct ConfigPerfItem* link_config_gperf_lookup(const char *key, unsigned length); ++const struct ConfigPerfItem* link_config_gperf_lookup(const char *key, GPERF_LEN_TYPE length); + + int config_parse_mac_policy(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + int config_parse_name_policy(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); +diff --git a/src/udev/udev-builtin-keyboard.c b/src/udev/udev-builtin-keyboard.c +index aa10beafb..09024116f 100644 +--- a/src/udev/udev-builtin-keyboard.c ++++ b/src/udev/udev-builtin-keyboard.c +@@ -29,7 +29,7 @@ + #include "string-util.h" + #include "udev.h" + +-static const struct key *keyboard_lookup_key(const char *str, unsigned len); ++static const struct key *keyboard_lookup_key(const char *str, GPERF_LEN_TYPE len); + #include "keyboard-keys-from-name.h" + + static int install_force_release(struct udev_device *dev, const unsigned *release, unsigned release_count) { +-- +2.11.0 + diff --git a/sys-fs/udev/files/233-format-warnings.patch b/sys-fs/udev/files/233-format-warnings.patch new file mode 100644 index 000000000000..7bb08f0a3201 --- /dev/null +++ b/sys-fs/udev/files/233-format-warnings.patch @@ -0,0 +1,84 @@ +From 3e7d14d78c4d15ec7789299216cbf5c58e61547b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> +Date: Sat, 3 Jun 2017 05:41:17 -0400 +Subject: [PATCH] sd-bus: silence format warnings in kdbus code (#6072) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The code is mostly correct, but gcc is trying to outsmart us, and emits a +warning for a "llu vs lu" mismatch, even though they are the same size (on alpha): + +src/libsystemd/sd-bus/bus-control.c: In function ‘kernel_get_list’: +src/libsystemd/sd-bus/bus-control.c:267:42: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=] + if (asprintf(&n, ":1.%llu", name->id) < 0) { + ^ +src/libsystemd/sd-bus/bus-control.c: In function ‘bus_get_name_creds_kdbus’: +src/libsystemd/sd-bus/bus-control.c:714:47: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=] + if (asprintf(&c->unique_name, ":1.%llu", conn_info->id) < 0) { + ^ +This is hard to work around properly, because kdbus.h uses __u64 which is +defined-differently-despite-being-the-same-size then uint64_t. Thus the simple +solution of using %PRIu64 fails on amd64: + +src/libsystemd/sd-bus/bus-control.c:714:47: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘__u64 {aka long long unsigned int}’ [-Werror=format=] + if (asprintf(&c->unique_name, ":1.%"PRIu64, conn_info->id) < 0) { + ^~~~~~ + +Let's just avoid the whole issue for now by silencing the warning. +After the next release, we should just get rid of the kdbus code. + +Fixes #5561. +--- + src/libsystemd/sd-bus/bus-control.c | 6 ++++++ + src/libsystemd/sd-bus/bus-kernel.c | 2 ++ + 2 files changed, 8 insertions(+) + +diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c +index 9e58ffbd8..303ae0f23 100644 +--- a/src/libsystemd/sd-bus/bus-control.c ++++ b/src/libsystemd/sd-bus/bus-control.c +@@ -264,10 +264,13 @@ static int kernel_get_list(sd_bus *bus, uint64_t flags, char ***x) { + if ((flags & KDBUS_LIST_UNIQUE) && name->id != previous_id && !(name->flags & KDBUS_HELLO_ACTIVATOR)) { + char *n; + ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat" + if (asprintf(&n, ":1.%llu", name->id) < 0) { + r = -ENOMEM; + goto fail; + } ++#pragma GCC diagnostic pop + + r = strv_consume(x, n); + if (r < 0) +@@ -711,10 +714,13 @@ int bus_get_name_creds_kdbus( + } + + if (mask & SD_BUS_CREDS_UNIQUE_NAME) { ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat" + if (asprintf(&c->unique_name, ":1.%llu", conn_info->id) < 0) { + r = -ENOMEM; + goto fail; + } ++#pragma GCC diagnostic pop + + c->mask |= SD_BUS_CREDS_UNIQUE_NAME; + } +diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c +index c82caeb3f..ca6aee7c0 100644 +--- a/src/libsystemd/sd-bus/bus-kernel.c ++++ b/src/libsystemd/sd-bus/bus-kernel.c +@@ -51,6 +51,8 @@ + #include "user-util.h" + #include "util.h" + ++#pragma GCC diagnostic ignored "-Wformat" ++ + #define UNIQUE_NAME_MAX (3+DECIMAL_STR_MAX(uint64_t)) + + int bus_kernel_parse_unique_name(const char *s, uint64_t *id) { +-- +2.13.2 + diff --git a/sys-fs/udev/files/234-uucp-group.patch b/sys-fs/udev/files/234-uucp-group.patch new file mode 100644 index 000000000000..89cf552c8295 --- /dev/null +++ b/sys-fs/udev/files/234-uucp-group.patch @@ -0,0 +1,11 @@ +--- a/rules/50-udev-default.rules.in ++++ b/rules/50-udev-default.rules.in +@@ -22,7 +22,7 @@ + SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620" + SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620" + SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty" +-KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout" ++KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="uucp" + + SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640" + diff --git a/sys-fs/udev/files/systemd-232-pkgconfig.patch b/sys-fs/udev/files/systemd-232-pkgconfig.patch new file mode 100644 index 000000000000..50f7921b565d --- /dev/null +++ b/sys-fs/udev/files/systemd-232-pkgconfig.patch @@ -0,0 +1,50 @@ +From a36dad95c447a5cf65f9e3b66c86e906e7f05890 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Sat, 5 Nov 2016 09:17:34 -0400 +Subject: [PATCH] Adjust pkgconfig files to point at rootlibdir + +The .so symlinks got moved to rootlibdir in 082210c7. +--- + Makefile.am | 1 + + src/libsystemd/libsystemd.pc.in | 2 +- + src/libudev/libudev.pc.in | 2 +- + 3 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index f2d8bf5..73144b1 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -6054,6 +6054,7 @@ EXTRA_DIST += \ + + # ------------------------------------------------------------------------------ + substitutions = \ ++ '|rootlibdir=$(rootlibdir)|' \ + '|rootlibexecdir=$(rootlibexecdir)|' \ + '|rootbindir=$(rootbindir)|' \ + '|bindir=$(bindir)|' \ +diff --git a/src/libsystemd/libsystemd.pc.in b/src/libsystemd/libsystemd.pc.in +index e8f7950..7e6d499 100644 +--- a/src/libsystemd/libsystemd.pc.in ++++ b/src/libsystemd/libsystemd.pc.in +@@ -7,7 +7,7 @@ + + prefix=@prefix@ + exec_prefix=@exec_prefix@ +-libdir=@libdir@ ++libdir=@rootlibdir@ + includedir=@includedir@ + + Name: systemd +diff --git a/src/libudev/libudev.pc.in b/src/libudev/libudev.pc.in +index a0f3f52..770c922 100644 +--- a/src/libudev/libudev.pc.in ++++ b/src/libudev/libudev.pc.in +@@ -7,7 +7,7 @@ + + prefix=@prefix@ + exec_prefix=@exec_prefix@ +-libdir=@libdir@ ++libdir=@rootlibdir@ + includedir=@includedir@ + + Name: libudev diff --git a/sys-fs/udev/files/udev-229-sysmacros.patch b/sys-fs/udev/files/udev-229-sysmacros.patch new file mode 100644 index 000000000000..d72eb5907da7 --- /dev/null +++ b/sys-fs/udev/files/udev-229-sysmacros.patch @@ -0,0 +1,82 @@ +https://bugs.gentoo.org/580200 +https://github.com/systemd/systemd/commit/27d13af71c3af6b2f9b60556d2c046dbb6e36e23 + +From 27d13af71c3af6b2f9b60556d2c046dbb6e36e23 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Mon, 14 Mar 2016 17:44:49 -0400 +Subject: [PATCH] include sys/sysmacros.h in more places + +Since glibc is moving away from implicitly including sys/sysmacros.h +all the time via sys/types.h, include the header directly in more +places. This seems to cover most makedev/major/minor usage. +--- + src/basic/macro.h | 1 + + src/basic/util.h | 1 + + src/libudev/libudev.h | 1 + + src/systemd/sd-device.h | 1 + + src/udev/udev.h | 1 + + 5 files changed, 5 insertions(+) + +diff --git a/src/basic/macro.h b/src/basic/macro.h +index c34441d..b36a956 100644 +--- a/src/basic/macro.h ++++ b/src/basic/macro.h +@@ -23,6 +23,7 @@ + #include <inttypes.h> + #include <stdbool.h> + #include <sys/param.h> ++#include <sys/sysmacros.h> + #include <sys/types.h> + + #define _printf_(a,b) __attribute__ ((format (printf, a, b))) +diff --git a/src/basic/util.h b/src/basic/util.h +index e095254..286db05 100644 +--- a/src/basic/util.h ++++ b/src/basic/util.h +@@ -36,6 +36,7 @@ + #include <sys/socket.h> + #include <sys/stat.h> + #include <sys/statfs.h> ++#include <sys/sysmacros.h> + #include <sys/types.h> + #include <time.h> + #include <unistd.h> +diff --git a/src/libudev/libudev.h b/src/libudev/libudev.h +index eb58740..3f6d0ed 100644 +--- a/src/libudev/libudev.h ++++ b/src/libudev/libudev.h +@@ -21,6 +21,7 @@ + #define _LIBUDEV_H_ + + #include <stdarg.h> ++#include <sys/sysmacros.h> + #include <sys/types.h> + + #ifdef __cplusplus +diff --git a/src/systemd/sd-device.h b/src/systemd/sd-device.h +index 5bfca6e..c1d0756 100644 +--- a/src/systemd/sd-device.h ++++ b/src/systemd/sd-device.h +@@ -22,6 +22,7 @@ + ***/ + + #include <inttypes.h> ++#include <sys/sysmacros.h> + #include <sys/types.h> + + #include "_sd-common.h" +diff --git a/src/udev/udev.h b/src/udev/udev.h +index 5659051..8433e8d 100644 +--- a/src/udev/udev.h ++++ b/src/udev/udev.h +@@ -19,6 +19,7 @@ + */ + + #include <sys/param.h> ++#include <sys/sysmacros.h> + #include <sys/types.h> + + #include "libudev.h" +-- +2.7.4 + diff --git a/sys-fs/udev/metadata.xml b/sys-fs/udev/metadata.xml new file mode 100644 index 000000000000..e6e0979044dd --- /dev/null +++ b/sys-fs/udev/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>udev-bugs@gentoo.org</email> + </maintainer> + <use> + <flag name="firmware-loader">Enable the userspace firmware loader (DEPRECATED, replaced by the in-kernel loader starting from 3.8)</flag> + <flag name="gudev">Build the gobject interface library</flag> + <flag name="kmod">Enable kernel module loading/unloading support using <pkg>sys-apps/kmod</pkg></flag> + </use> + <upstream> + <remote-id type="cpe">cpe:/a:kernel:udev</remote-id> + <remote-id type="github">systemd/systemd</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-fs/udev/udev-216.ebuild b/sys-fs/udev/udev-216.ebuild new file mode 100644 index 000000000000..39ea2e597567 --- /dev/null +++ b/sys-fs/udev/udev-216.ebuild @@ -0,0 +1,489 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit autotools bash-completion-r1 eutils linux-info multilib multilib-minimal toolchain-funcs udev user versionator + +if [[ ${PV} = 9999* ]]; then + EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd" + inherit git-2 + patchset= +else + patchset=2 + SRC_URI="https://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz" + if [[ -n "${patchset}" ]]; then + SRC_URI+=" + https://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz + https://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz" + fi + KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86" +fi + +DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" + +LICENSE="LGPL-2.1 MIT GPL-2" +SLOT="0" +IUSE="acl doc +firmware-loader gudev introspection +kmod selinux static-libs" + +RESTRICT="test" + +COMMON_DEPEND=">=sys-apps/util-linux-2.20 + acl? ( sys-apps/acl ) + gudev? ( >=dev-libs/glib-2.34.3[${MULTILIB_USEDEP}] ) + introspection? ( >=dev-libs/gobject-introspection-1.38 ) + kmod? ( >=sys-apps/kmod-16 ) + selinux? ( >=sys-libs/libselinux-2.1.9 ) + !<sys-libs/glibc-2.11 + !sys-apps/gentoo-systemd-integration + !sys-apps/systemd + abi_x86_32? ( + !<=app-emulation/emul-linux-x86-baselibs-20130224-r7 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] + )" +# Force new make >= -r4 to skip some parallel build issues +DEPEND="${COMMON_DEPEND} + dev-util/gperf + >=sys-apps/coreutils-8.16 + sys-libs/libcap + virtual/os-headers + virtual/pkgconfig + >=sys-devel/make-3.82-r4 + >=sys-kernel/linux-headers-3.7 + doc? ( >=dev-util/gtk-doc-1.18 )" +# Try with `emerge -C docbook-xml-dtd` to see the build failure without DTDs +if [[ ${PV} = 9999* ]]; then + DEPEND="${DEPEND} + app-text/docbook-xml-dtd:4.2 + app-text/docbook-xml-dtd:4.5 + app-text/docbook-xsl-stylesheets + dev-libs/libxslt" +fi +RDEPEND="${COMMON_DEPEND} + !<sys-fs/lvm2-2.02.103 + !<sec-policy/selinux-base-2.20120725-r10 + gudev? ( !dev-libs/libgudev )" +PDEPEND=">=sys-apps/hwids-20140304[udev] + >=sys-fs/udev-init-scripts-26" + +S=${WORKDIR}/systemd-${PV} + +# The multilib-build.eclass doesn't handle situation where the installed headers +# are different in ABIs. In this case, we install libgudev headers in native +# ABI but not for non-native ABI. +multilib_check_headers() { :; } + +check_default_rules() { + # Make sure there are no sudden changes to upstream rules file + # (more for my own needs than anything else ...) + local udev_rules_md5=c18b74c4f8bf4a397ee667ee419f3a8e + MD5=$(md5sum < "${S}"/rules/50-udev-default.rules) + MD5=${MD5/ -/} + if [[ ${MD5} != ${udev_rules_md5} ]]; then + eerror "50-udev-default.rules has been updated, please validate!" + eerror "md5sum: ${MD5}" + die "50-udev-default.rules has been updated, please validate!" + fi +} + +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 + + # CONFIG_FHANDLE was introduced by 2.6.39 + local MINKV=2.6.39 + + if kernel_is -lt ${MINKV//./ }; then + eerror "Your running kernel is too old to run this version of ${P}" + eerror "You need to upgrade kernel at least to ${MINKV}" + fi +} + +src_prepare() { + if ! [[ ${PV} = 9999* ]]; then + # secure_getenv() disable for non-glibc systems wrt bug #443030 + if ! [[ $(grep -r secure_getenv * | wc -l) -eq 28 ]]; then + eerror "The line count for secure_getenv() failed, see bug #443030" + die + fi + fi + + # backport some patches + if [[ -n "${patchset}" ]]; then + EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch + fi + + cat <<-EOF > "${T}"/40-gentoo.rules + # Gentoo specific floppy and usb groups + SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy" + SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb" + EOF + + # change rules back to group uucp instead of dialout for now wrt #454556 + sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die + + # apply user patches + epatch_user + + if [[ ! -e configure ]]; then + if use doc; then + gtkdocize --docdir docs || die "gtkdocize failed" + else + echo 'EXTRA_DIST =' > docs/gtk-doc.make + fi + eautoreconf + else + check_default_rules + elibtoolize + fi + + # Restore possibility of running --enable-static wrt #472608 + sed -i \ + -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \ + configure || die + + if ! use elibc_glibc; then #443030 + echo '#define secure_getenv(x) NULL' >> config.h.in + sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die + fi +} + +multilib_src_configure() { + tc-export CC #463846 + export cc_cv_CFLAGS__flto=no #502950 + + # Keep sorted by ./configure --help and only pass --disable flags + # when *required* to avoid external deps or unnecessary compile + local econf_args + econf_args=( + ac_cv_search_cap_init= + --libdir=/usr/$(get_libdir) + --docdir=/usr/share/doc/${PF} + $(multilib_native_use_enable static-libs static) + --disable-nls + $(multilib_native_use_enable doc gtk-doc) + $(multilib_native_use_enable introspection) + --disable-python-devel + --disable-dbus + $(multilib_native_use_enable kmod) + --disable-seccomp + $(multilib_native_use_enable selinux) + --disable-xz + --disable-lz4 + --disable-pam + $(multilib_native_use_enable acl) + --disable-gcrypt + --disable-audit + --disable-libcryptsetup + --disable-qrencode + --disable-microhttpd + --disable-gnutls + --disable-libcurl + --disable-libidn + --disable-readahead + --disable-quotacheck + --disable-logind + --disable-polkit + --disable-myhostname + $(use_enable gudev) + $(multilib_is_native_abi || echo "--disable-manpages") + --enable-split-usr + --with-html-dir=/usr/share/doc/${PF}/html + --without-python + --with-bashcompletiondir="$(get_bashcompdir)" + $(use firmware-loader && echo "--with-firmware-path=/lib/firmware/updates:/lib/firmware") + --with-rootprefix= + $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)") + ) + + # Use pregenerated copies when possible wrt #480924 + [[ ${PV} = 9999* ]] || econf_args+=( --disable-manpages ) + + ECONF_SOURCE=${S} econf "${econf_args[@]}" +} + +multilib_src_compile() { + echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra + emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES + + # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4, + # but not everything -- separate building of the binaries as a workaround, + # which will force internal libraries required for the helpers to be built + # early enough, like eg. libsystemd-shared.la + if multilib_is_native_abi; then + local lib_targets=( libudev.la ) + use gudev && lib_targets+=( libgudev-1.0.la ) + emake "${lib_targets[@]}" + + local exec_targets=( + systemd-udevd + udevadm + ) + emake "${exec_targets[@]}" + + local helper_targets=( + ata_id + cdrom_id + collect + scsi_id + v4l_id + accelerometer + mtd_probe + ) + emake "${helper_targets[@]}" + + if [[ ${PV} = 9999* ]]; then + local man_targets=( + man/udev.conf.5 + man/systemd.link.5 + man/udev.7 + man/systemd-udevd.service.8 + man/udevadm.8 + ) + emake "${man_targets[@]}" + fi + + if use doc; then + emake -C docs/libudev + use gudev && emake -C docs/gudev + fi + else + local lib_targets=( libudev.la ) + use gudev && lib_targets+=( libgudev-1.0.la ) + emake "${lib_targets[@]}" + fi +} + +multilib_src_install() { + if multilib_is_native_abi; then + local lib_LTLIBRARIES="libudev.la" \ + pkgconfiglib_DATA="src/libudev/libudev.pc" + + local targets=( + install-libLTLIBRARIES + install-includeHEADERS + install-libgudev_includeHEADERS + install-rootbinPROGRAMS + install-rootlibexecPROGRAMS + install-udevlibexecPROGRAMS + install-dist_udevconfDATA + install-dist_udevrulesDATA + install-girDATA + install-pkgconfiglibDATA + install-sharepkgconfigDATA + install-typelibsDATA + install-dist_docDATA + libudev-install-hook + install-directories-hook + install-dist_bashcompletionDATA + install-dist_networkDATA + ) + + if use gudev; then + lib_LTLIBRARIES+=" libgudev-1.0.la" + pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc" + fi + + # add final values of variables: + targets+=( + rootlibexec_PROGRAMS=systemd-udevd + rootbin_PROGRAMS=udevadm + lib_LTLIBRARIES="${lib_LTLIBRARIES}" + pkgconfiglib_DATA="${pkgconfiglib_DATA}" + INSTALL_DIRS='$(sysconfdir)/udev/rules.d \ + $(sysconfdir)/udev/hwdb.d \ + $(sysconfdir)/systemd/network' + dist_bashcompletion_DATA="shell-completion/bash/udevadm" + dist_network_DATA="network/99-default.link" + ) + emake -j1 DESTDIR="${D}" "${targets[@]}" + + if use doc; then + emake -C docs/libudev DESTDIR="${D}" install + use gudev && emake -C docs/gudev DESTDIR="${D}" install + fi + + if [[ ${PV} = 9999* ]]; then + doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8} + else + doman "${S}"/man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8} + fi + else + local lib_LTLIBRARIES="libudev.la" \ + pkgconfiglib_DATA="src/libudev/libudev.pc" \ + include_HEADERS="src/libudev/libudev.h" + + local targets=( + install-libLTLIBRARIES + install-includeHEADERS + install-pkgconfiglibDATA + ) + + if use gudev; then + lib_LTLIBRARIES+=" libgudev-1.0.la" + pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc" + fi + + targets+=( + lib_LTLIBRARIES="${lib_LTLIBRARIES}" + pkgconfiglib_DATA="${pkgconfiglib_DATA}" + include_HEADERS="${include_HEADERS}" + ) + emake -j1 DESTDIR="${D}" "${targets[@]}" + fi +} + +multilib_src_install_all() { + dodoc TODO + + prune_libtool_files --all + rm -f \ + "${D}"/lib/udev/rules.d/99-systemd.rules \ + "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h} + + # see src_prepare() for content of 40-gentoo.rules + insinto /lib/udev/rules.d + doins "${T}"/40-gentoo.rules + + # maintainer note: by not letting the upstream build-sys create the .so + # link, you also avoid a parallel make problem + mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8 + + if ! [[ ${PV} = 9999* ]]; then + insinto /usr/share/doc/${PF}/html/gudev + doins "${S}"/docs/gudev/html/* + + insinto /usr/share/doc/${PF}/html/libudev + doins "${S}"/docs/libudev/html/* + fi +} + +pkg_preinst() { + local htmldir + for htmldir in gudev libudev; do + if [[ -d ${ROOT%/}/usr/share/gtk-doc/html/${htmldir} ]]; then + rm -rf "${ROOT%/}"/usr/share/gtk-doc/html/${htmldir} + fi + if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then + dosym ../../doc/${PF}/html/${htmldir} \ + /usr/share/gtk-doc/html/${htmldir} + fi + done +} + +pkg_postinst() { + mkdir -p "${ROOT%/}"/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 "${ROOT%/}"/dev/loop 2>/dev/null + if [[ -d ${ROOT%/}/dev/loop ]]; then + ewarn "Please make sure your remove /dev/loop," + ewarn "else losetup may be confused when looking for unused devices." + fi + + local fstab="${ROOT%/}"/etc/fstab dev path fstype rest + while read -r dev path fstype rest; do + if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then + ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs" + ewarn "filesystem. Otherwise udev won't be able to boot." + ewarn "See, https://bugs.gentoo.org/453186" + fi + done < "${fstab}" + + if [[ -d ${ROOT%/}/usr/lib/udev ]]; then + ewarn + ewarn "Please re-emerge all packages on your system which install" + ewarn "rules and helpers in /usr/lib/udev. They should now be in" + ewarn "/lib/udev." + ewarn + ewarn "One way to do this is to run the following command:" + ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)" + ewarn "Note that qfile can be found in app-portage/portage-utils" + fi + + local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules + local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules + for old_rules in "${old_cd_rules}" "${old_net_rules}"; do + if [[ -f ${old_rules} ]]; then + ewarn + ewarn "File ${old_rules} is from old udev installation but if you still use it," + ewarn "rename it to something else starting with 70- to silence this deprecation" + ewarn "warning." + fi + done + + elog + elog "Starting from version >= 197 the new predictable network interface names are" + elog "used by default, see:" + elog "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames" + elog "https://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c" + elog + elog "Example command to get the information for the new interface name before booting" + elog "(replace <ifname> with, for example, eth0):" + elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null" + elog + elog "You can use either kernel parameter \"net.ifnames=0\", create empty" + elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null" + elog "to disable the feature." + + if has_version 'sys-apps/biosdevname'; then + ewarn + ewarn "You can replace the functionality of sys-apps/biosdevname which has been" + ewarn "detected to be installed with the new predictable network interface names." + fi + + ewarn + ewarn "You need to restart udev as soon as possible to make the upgrade go" + ewarn "into effect." + ewarn "The method you use to do this depends on your init system." + if has_version 'sys-apps/openrc'; then + ewarn "For sys-apps/openrc users it is:" + ewarn "# /etc/init.d/udev --nodeps restart" + fi + + elog + elog "For more information on udev on Gentoo, upgrading, writing udev rules, and" + elog "fixing known issues visit:" + elog "https://wiki.gentoo.org/wiki/Udev" + elog "https://wiki.gentoo.org/wiki/Udev/upgrade" + + # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null, + # do the same for 80-net-setup-link.rules to keep the old behavior + local net_move=no + local net_name_slot_sym=no + local net_rules_path="${ROOT%/}"/etc/udev/rules.d + local net_name_slot="${net_rules_path}"/80-net-name-slot.rules + local net_setup_link="${net_rules_path}"/80-net-setup-link.rules + if [[ ! -e ${net_setup_link} ]]; then + [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes + if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then + net_move=yes + net_name_slot_sym=yes + fi + fi + if [[ ${net_move} == yes ]]; then + ebegin "Copying ${net_name_slot} to ${net_setup_link}" + + if [[ ${net_name_slot_sym} == yes ]]; then + ln -nfs /dev/null "${net_setup_link}" + else + cp "${net_name_slot}" "${net_setup_link}" + fi + eend $? + fi + + # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 + # https://bugs.gentoo.org/246847 + # https://bugs.gentoo.org/514174 + enewgroup input + + # Update hwdb database in case the format is changed by udev version. + if has_version 'sys-apps/hwids[udev]'; then + udevadm hwdb --update --root="${ROOT%/}" + # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd + # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda + [[ -z ${REPLACING_VERSIONS} ]] && udev_reload + fi +} diff --git a/sys-fs/udev/udev-225-r1.ebuild b/sys-fs/udev/udev-225-r1.ebuild new file mode 100644 index 000000000000..8108a9b3c74b --- /dev/null +++ b/sys-fs/udev/udev-225-r1.ebuild @@ -0,0 +1,430 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit autotools bash-completion-r1 eutils linux-info multilib multilib-minimal toolchain-funcs udev user versionator + +if [[ ${PV} = 9999* ]]; then + EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd" + inherit git-r3 +else + patchset= + SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> systemd-${PV}.tar.gz" + if [[ -n "${patchset}" ]]; then + SRC_URI+=" + https://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz + https://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz" + fi + KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86" +fi + +DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" + +LICENSE="LGPL-2.1 MIT GPL-2" +SLOT="0" +IUSE="acl +kmod selinux static-libs" + +RESTRICT="test" + +COMMON_DEPEND=">=sys-apps/util-linux-2.24 + sys-libs/libcap[${MULTILIB_USEDEP}] + acl? ( sys-apps/acl ) + kmod? ( >=sys-apps/kmod-16 ) + selinux? ( >=sys-libs/libselinux-2.1.9 ) + !<sys-libs/glibc-2.11 + !sys-apps/gentoo-systemd-integration + !sys-apps/systemd + abi_x86_32? ( + !<=app-emulation/emul-linux-x86-baselibs-20130224-r7 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] + )" +# Force new make >= -r4 to skip some parallel build issues +DEPEND="${COMMON_DEPEND} + dev-util/gperf + >=dev-util/intltool-0.50 + >=sys-apps/coreutils-8.16 + virtual/os-headers + virtual/pkgconfig + >=sys-devel/make-3.82-r4 + >=sys-kernel/linux-headers-3.9 + app-text/docbook-xml-dtd:4.2 + app-text/docbook-xml-dtd:4.5 + app-text/docbook-xsl-stylesheets + dev-libs/libxslt" +RDEPEND="${COMMON_DEPEND} + !<sys-fs/lvm2-2.02.103 + !<sec-policy/selinux-base-2.20120725-r10" +PDEPEND=">=sys-apps/hwids-20140304[udev] + >=sys-fs/udev-init-scripts-26" + +S=${WORKDIR}/systemd-${PV} + +check_default_rules() { + # Make sure there are no sudden changes to upstream rules file + # (more for my own needs than anything else ...) + local udev_rules_md5=b8ad860dccae0ca51656b33c405ea2ca + MD5=$(md5sum < "${S}"/rules/50-udev-default.rules) + MD5=${MD5/ -/} + if [[ ${MD5} != ${udev_rules_md5} ]]; then + eerror "50-udev-default.rules has been updated, please validate!" + eerror "md5sum: ${MD5}" + die "50-udev-default.rules has been updated, please validate!" + fi +} + +pkg_setup() { + if [[ ${MERGE_TYPE} != buildonly ]]; then + CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER ~UNIX" + linux-info_pkg_setup + + # CONFIG_FHANDLE was introduced by 2.6.39 + local MINKV=2.6.39 + + if kernel_is -lt ${MINKV//./ }; then + eerror "Your running kernel is too old to run this version of ${P}" + eerror "You need to upgrade kernel at least to ${MINKV}" + fi + + if kernel_is -lt 3 7; then + ewarn "Your running kernel is too old to have firmware loader and" + ewarn "this version of ${P} doesn't have userspace firmware loader" + ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7" + fi + fi +} + +src_prepare() { + if ! [[ ${PV} = 9999* ]]; then + # secure_getenv() disable for non-glibc systems wrt bug #443030 + if ! [[ $(grep -r secure_getenv * | wc -l) -eq 25 ]]; then + eerror "The line count for secure_getenv() failed, see bug #443030" + die + fi + fi + + # backport some patches + if [[ -n "${patchset}" ]]; then + EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch + fi + + cat <<-EOF > "${T}"/40-gentoo.rules + # Gentoo specific floppy and usb groups + SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy" + SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb" + EOF + + # change rules back to group uucp instead of dialout for now wrt #454556 + sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die + + # stub out the am_path_libcrypt function + echo 'AC_DEFUN([AM_PATH_LIBGCRYPT],[:])' > m4/gcrypt.m4 + + # apply user patches + epatch_user + + eautoreconf + + if ! [[ ${PV} = 9999* ]]; then + check_default_rules + fi + + # Restore possibility of running --enable-static wrt #472608 + sed -i \ + -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \ + configure || die + + if ! use elibc_glibc; then #443030 + echo '#define secure_getenv(x) NULL' >> config.h.in + sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die + fi +} + +src_configure() { + # Prevent conflicts with i686 cross toolchain, bug 559726 + tc-export AR CC NM OBJCOPY RANLIB + multilib-minimal_src_configure +} + +multilib_src_configure() { + tc-export CC #463846 + export cc_cv_CFLAGS__flto=no #502950 + export cc_cv_CFLAGS__Werror_shadow=no #554454 + + # Keep sorted by ./configure --help and only pass --disable flags + # when *required* to avoid external deps or unnecessary compile + local econf_args + econf_args=( + --libdir=/usr/$(get_libdir) + --docdir=/usr/share/doc/${PF} + $(multilib_native_use_enable static-libs static) + --disable-nls + --disable-dbus + $(multilib_native_use_enable kmod) + --disable-xkbcommon + --disable-seccomp + $(multilib_native_use_enable selinux) + --disable-xz + --disable-lz4 + --disable-pam + $(multilib_native_use_enable acl) + --disable-gcrypt + --disable-audit + --disable-libcryptsetup + --disable-qrencode + --disable-microhttpd + --disable-gnuefi + --disable-gnutls + --disable-libcurl + --disable-libidn + --disable-quotacheck + --disable-logind + --disable-polkit + --disable-myhostname + $(multilib_is_native_abi || echo "--disable-manpages") + --enable-split-usr + --without-python + --with-bashcompletiondir="$(get_bashcompdir)" + --with-rootprefix= + $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)") + --disable-elfutils + ) + + if ! multilib_is_native_abi; then + econf_args+=( + MOUNT_{CFLAGS,LIBS}=' ' + ) + fi + + ECONF_SOURCE=${S} econf "${econf_args[@]}" +} + +multilib_src_compile() { + echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra + emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES + + # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4, + # but not everything -- separate building of the binaries as a workaround, + # which will force internal libraries required for the helpers to be built + # early enough, like eg. libsystemd-shared.la + if multilib_is_native_abi; then + local lib_targets=( libudev.la ) + emake "${lib_targets[@]}" + + local exec_targets=( + systemd-udevd + udevadm + ) + emake "${exec_targets[@]}" + + local helper_targets=( + ata_id + cdrom_id + collect + scsi_id + v4l_id + mtd_probe + ) + emake "${helper_targets[@]}" + + local man_targets=( + man/udev.conf.5 + man/systemd.link.5 + man/udev.7 + man/systemd-udevd.service.8 + man/udevadm.8 + ) + emake "${man_targets[@]}" + else + local lib_targets=( libudev.la ) + emake "${lib_targets[@]}" + fi +} + +multilib_src_install() { + if multilib_is_native_abi; then + local lib_LTLIBRARIES="libudev.la" + local pkgconfiglib_DATA="src/libudev/libudev.pc" + + local targets=( + install-libLTLIBRARIES + install-includeHEADERS + install-rootbinPROGRAMS + install-rootlibexecPROGRAMS + install-udevlibexecPROGRAMS + install-dist_udevconfDATA + install-dist_udevrulesDATA + install-pkgconfiglibDATA + install-pkgconfigdataDATA + install-dist_docDATA + libudev-install-hook + install-directories-hook + install-dist_bashcompletionDATA + install-dist_networkDATA + ) + + # add final values of variables: + targets+=( + rootlibexec_PROGRAMS=systemd-udevd + rootbin_PROGRAMS=udevadm + lib_LTLIBRARIES="${lib_LTLIBRARIES}" + pkgconfiglib_DATA="${pkgconfiglib_DATA}" + pkgconfigdata_DATA="src/udev/udev.pc" + INSTALL_DIRS='$(sysconfdir)/udev/rules.d $(sysconfdir)/udev/hwdb.d $(sysconfdir)/systemd/network' + dist_bashcompletion_DATA="shell-completion/bash/udevadm" + dist_network_DATA="network/99-default.link" + ) + emake -j1 DESTDIR="${D}" "${targets[@]}" + doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8} + else + local lib_LTLIBRARIES="libudev.la" + local pkgconfiglib_DATA="src/libudev/libudev.pc" + local include_HEADERS="src/libudev/libudev.h" + + local targets=( + install-libLTLIBRARIES + install-includeHEADERS + install-pkgconfiglibDATA + ) + + targets+=( + lib_LTLIBRARIES="${lib_LTLIBRARIES}" + pkgconfiglib_DATA="${pkgconfiglib_DATA}" + include_HEADERS="${include_HEADERS}" + ) + emake -j1 DESTDIR="${D}" "${targets[@]}" + fi +} + +multilib_src_install_all() { + dodoc TODO + + prune_libtool_files --all + rm -f "${D}"/lib/udev/rules.d/99-systemd.rules + rm -f "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h} + + # see src_prepare() for content of 40-gentoo.rules + insinto /lib/udev/rules.d + doins "${T}"/40-gentoo.rules + + # maintainer note: by not letting the upstream build-sys create the .so + # link, you also avoid a parallel make problem + mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8 +} + +pkg_postinst() { + mkdir -p "${ROOT%/}"/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 "${ROOT%/}"/dev/loop 2>/dev/null + if [[ -d ${ROOT%/}/dev/loop ]]; then + ewarn "Please make sure your remove /dev/loop," + ewarn "else losetup may be confused when looking for unused devices." + fi + + local fstab="${ROOT%/}"/etc/fstab dev path fstype rest + while read -r dev path fstype rest; do + if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then + ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs" + ewarn "filesystem. Otherwise udev won't be able to boot." + ewarn "See, https://bugs.gentoo.org/453186" + fi + done < "${fstab}" + + if [[ -d ${ROOT%/}/usr/lib/udev ]]; then + ewarn + ewarn "Please re-emerge all packages on your system which install" + ewarn "rules and helpers in /usr/lib/udev. They should now be in" + ewarn "/lib/udev." + ewarn + ewarn "One way to do this is to run the following command:" + ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)" + ewarn "Note that qfile can be found in app-portage/portage-utils" + fi + + local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules + local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules + for old_rules in "${old_cd_rules}" "${old_net_rules}"; do + if [[ -f ${old_rules} ]]; then + ewarn + ewarn "File ${old_rules} is from old udev installation but if you still use it," + ewarn "rename it to something else starting with 70- to silence this deprecation" + ewarn "warning." + fi + done + + elog + elog "Starting from version >= 197 the new predictable network interface names are" + elog "used by default, see:" + elog "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames" + elog "https://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c" + elog + elog "Example command to get the information for the new interface name before booting" + elog "(replace <ifname> with, for example, eth0):" + elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null" + elog + elog "You can use either kernel parameter \"net.ifnames=0\", create empty" + elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null" + elog "to disable the feature." + + if has_version 'sys-apps/biosdevname'; then + ewarn + ewarn "You can replace the functionality of sys-apps/biosdevname which has been" + ewarn "detected to be installed with the new predictable network interface names." + fi + + ewarn + ewarn "You need to restart udev as soon as possible to make the upgrade go" + ewarn "into effect." + ewarn "The method you use to do this depends on your init system." + if has_version 'sys-apps/openrc'; then + ewarn "For sys-apps/openrc users it is:" + ewarn "# /etc/init.d/udev --nodeps restart" + fi + + elog + elog "For more information on udev on Gentoo, upgrading, writing udev rules, and" + elog "fixing known issues visit:" + elog "https://wiki.gentoo.org/wiki/Udev" + elog "https://wiki.gentoo.org/wiki/Udev/upgrade" + + # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null, + # do the same for 80-net-setup-link.rules to keep the old behavior + local net_move=no + local net_name_slot_sym=no + local net_rules_path="${ROOT%/}"/etc/udev/rules.d + local net_name_slot="${net_rules_path}"/80-net-name-slot.rules + local net_setup_link="${net_rules_path}"/80-net-setup-link.rules + if [[ ! -e ${net_setup_link} ]]; then + [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes + if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then + net_move=yes + net_name_slot_sym=yes + fi + fi + if [[ ${net_move} == yes ]]; then + ebegin "Copying ${net_name_slot} to ${net_setup_link}" + + if [[ ${net_name_slot_sym} == yes ]]; then + ln -nfs /dev/null "${net_setup_link}" + else + cp "${net_name_slot}" "${net_setup_link}" + fi + eend $? + fi + + # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 + # https://bugs.gentoo.org/246847 + # https://bugs.gentoo.org/514174 + enewgroup input + + # Update hwdb database in case the format is changed by udev version. + if has_version 'sys-apps/hwids[udev]'; then + udevadm hwdb --update --root="${ROOT%/}" + # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd + # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda + [[ -z ${REPLACING_VERSIONS} ]] && udev_reload + fi +} diff --git a/sys-fs/udev/udev-233.ebuild b/sys-fs/udev/udev-233.ebuild new file mode 100644 index 000000000000..c42ecc2c0be4 --- /dev/null +++ b/sys-fs/udev/udev-233.ebuild @@ -0,0 +1,408 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools bash-completion-r1 linux-info multilib-minimal toolchain-funcs udev user versionator + +if [[ ${PV} = 9999* ]]; then + EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd" + inherit git-r3 +else + SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> systemd-${PV}.tar.gz" + KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86" +fi + +DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" + +LICENSE="LGPL-2.1 MIT GPL-2" +SLOT="0" +IUSE="acl +kmod selinux" + +RESTRICT="test" + +COMMON_DEPEND=">=sys-apps/util-linux-2.27.1[${MULTILIB_USEDEP}] + sys-libs/libcap[${MULTILIB_USEDEP}] + acl? ( sys-apps/acl ) + kmod? ( >=sys-apps/kmod-16 ) + selinux? ( >=sys-libs/libselinux-2.1.9 ) + !<sys-libs/glibc-2.11 + !sys-apps/gentoo-systemd-integration + !sys-apps/systemd + abi_x86_32? ( + !<=app-emulation/emul-linux-x86-baselibs-20130224-r7 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] + )" +# Force new make >= -r4 to skip some parallel build issues +DEPEND="${COMMON_DEPEND} + dev-util/gperf + >=dev-util/intltool-0.50 + >=sys-apps/coreutils-8.16 + virtual/os-headers + virtual/pkgconfig + >=sys-devel/make-3.82-r4 + >=sys-kernel/linux-headers-3.9 + app-text/docbook-xml-dtd:4.2 + app-text/docbook-xml-dtd:4.5 + app-text/docbook-xsl-stylesheets + dev-libs/libxslt" +RDEPEND="${COMMON_DEPEND} + !<sys-fs/lvm2-2.02.103 + !<sec-policy/selinux-base-2.20120725-r10" +PDEPEND=">=sys-apps/hwids-20140304[udev] + >=sys-fs/udev-init-scripts-26" + +S=${WORKDIR}/systemd-${PV} + +PATCHES=( + "${FILESDIR}"/233-format-warnings.patch +) + +check_default_rules() { + # Make sure there are no sudden changes to upstream rules file + # (more for my own needs than anything else ...) + local udev_rules_md5=c6ee9def75c5c082bf083a7248991935 + MD5=$(md5sum < "${S}"/rules/50-udev-default.rules) + MD5=${MD5/ -/} + if [[ ${MD5} != ${udev_rules_md5} ]]; then + eerror "50-udev-default.rules has been updated, please validate!" + eerror "md5sum: ${MD5}" + die "50-udev-default.rules has been updated, please validate!" + fi +} + +pkg_setup() { + if [[ ${MERGE_TYPE} != buildonly ]]; then + CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER ~UNIX" + linux-info_pkg_setup + + # CONFIG_FHANDLE was introduced by 2.6.39 + local MINKV=2.6.39 + + if kernel_is -lt ${MINKV//./ }; then + eerror "Your running kernel is too old to run this version of ${P}" + eerror "You need to upgrade kernel at least to ${MINKV}" + fi + + if kernel_is -lt 3 7; then + ewarn "Your running kernel is too old to have firmware loader and" + ewarn "this version of ${P} doesn't have userspace firmware loader" + ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7" + fi + fi +} + +src_prepare() { + if ! [[ ${PV} = 9999* ]]; then + # secure_getenv() disable for non-glibc systems wrt bug #443030 + if ! [[ $(grep -r secure_getenv * | wc -l) -eq 30 ]]; then + eerror "The line count for secure_getenv() failed, see bug #443030" + die + fi + fi + + cat <<-EOF > "${T}"/40-gentoo.rules + # Gentoo specific floppy and usb groups + ACTION=="add", SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy" + ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb" + EOF + + # change rules back to group uucp instead of dialout for now wrt #454556 + sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die + + # stub out the am_path_libcrypt function + echo 'AC_DEFUN([AM_PATH_LIBGCRYPT],[:])' > m4/gcrypt.m4 + + default + + eautoreconf + + if ! [[ ${PV} = 9999* ]]; then + check_default_rules + fi + + if ! use elibc_glibc; then #443030 + echo '#define secure_getenv(x) NULL' >> config.h.in + sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die + fi +} + +src_configure() { + # Prevent conflicts with i686 cross toolchain, bug 559726 + tc-export AR CC NM OBJCOPY RANLIB + multilib-minimal_src_configure +} + +multilib_src_configure() { + tc-export CC #463846 + export cc_cv_CFLAGS__flto=no #502950 + export cc_cv_CFLAGS__Werror_shadow=no #554454 + export cc_cv_LDFLAGS__Wl__fuse_ld_gold=no #573874 + + # Keep sorted by ./configure --help and only pass --disable flags + # when *required* to avoid external deps or unnecessary compile + local econf_args + econf_args=( + --libdir=/usr/$(get_libdir) + --docdir=/usr/share/doc/${PF} + --disable-nls + --disable-dbus + $(multilib_native_use_enable kmod) + --disable-xkbcommon + --disable-seccomp + $(multilib_native_use_enable selinux) + --disable-xz + --disable-lz4 + --disable-pam + $(multilib_native_use_enable acl) + --disable-gcrypt + --disable-audit + --disable-libcryptsetup + --disable-qrencode + --disable-microhttpd + --disable-gnuefi + --disable-gnutls + --disable-libcurl + --disable-libidn + --disable-quotacheck + --disable-logind + --disable-polkit + --disable-myhostname + $(multilib_is_native_abi || echo "--disable-manpages") + --enable-split-usr + --without-python + --with-bashcompletiondir="$(get_bashcompdir)" + --with-rootprefix= + $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)") + --disable-elfutils + ) + + if ! multilib_is_native_abi; then + econf_args+=( + MOUNT_{CFLAGS,LIBS}=' ' + ) + fi + + ECONF_SOURCE=${S} econf "${econf_args[@]}" +} + +multilib_src_compile() { + echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra + emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES + + # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4, + # but not everything -- separate building of the binaries as a workaround, + # which will force internal libraries required for the helpers to be built + # early enough, like eg. libsystemd-shared.la + if multilib_is_native_abi; then + local lib_targets=( libudev.la ) + emake "${lib_targets[@]}" + + local exec_targets=( + systemd-udevd + udevadm + ) + emake "${exec_targets[@]}" + + local helper_targets=( + ata_id + cdrom_id + collect + scsi_id + v4l_id + mtd_probe + ) + emake "${helper_targets[@]}" + + local man_targets=( + man/udev.conf.5 + man/systemd.link.5 + man/udev.7 + man/systemd-udevd.service.8 + man/udevadm.8 + ) + emake "${man_targets[@]}" + else + local lib_targets=( libudev.la ) + emake "${lib_targets[@]}" + fi +} + +multilib_src_install() { + if multilib_is_native_abi; then + local targets=( + install-includeHEADERS + install-rootbinPROGRAMS + install-rootlibLTLIBRARIES + install-rootlibexecPROGRAMS + install-udevlibexecPROGRAMS + install-dist_udevconfDATA + install-dist_udevrulesDATA + install-pkgconfiglibDATA + install-pkgconfigdataDATA + install-dist_docDATA + install-directories-hook + install-dist_bashcompletionDATA + install-dist_networkDATA + rootlibexec_PROGRAMS=systemd-udevd + rootbin_PROGRAMS=udevadm + rootlib_LTLIBRARIES="libudev.la" + pkgconfiglib_DATA="src/libudev/libudev.pc" + pkgconfigdata_DATA="src/udev/udev.pc" + INSTALL_DIRS='$(sysconfdir)/udev/rules.d $(sysconfdir)/udev/hwdb.d $(sysconfdir)/systemd/network' + dist_bashcompletion_DATA="shell-completion/bash/udevadm" + dist_network_DATA="network/99-default.link" + ) + emake -j1 DESTDIR="${D}" "${targets[@]}" + doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8} + + # Compatibility symlink for software that looks for libudev.so + # without using pkg-config + dosym ../../$(get_libdir)/libudev.so.1 \ + /usr/$(get_libdir)/libudev.so + else + local targets=( + install-libLTLIBRARIES + install-includeHEADERS + install-pkgconfiglibDATA + lib_LTLIBRARIES="libudev.la" + pkgconfiglib_DATA="src/libudev/libudev.pc" + include_HEADERS="src/libudev/libudev.h" + ) + + emake -j1 DESTDIR="${D}" "${targets[@]}" + fi +} + +multilib_src_install_all() { + dodoc TODO + + prune_libtool_files --all + rm -f "${D}"/lib/udev/rules.d/99-systemd.rules + rm -f "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h} + + # see src_prepare() for content of 40-gentoo.rules + insinto /lib/udev/rules.d + doins "${T}"/40-gentoo.rules + + # maintainer note: by not letting the upstream build-sys create the .so + # link, you also avoid a parallel make problem + mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8 +} + +pkg_postinst() { + mkdir -p "${ROOT%/}"/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 "${ROOT%/}"/dev/loop 2>/dev/null + if [[ -d ${ROOT%/}/dev/loop ]]; then + ewarn "Please make sure your remove /dev/loop," + ewarn "else losetup may be confused when looking for unused devices." + fi + + local fstab="${ROOT%/}"/etc/fstab dev path fstype rest + while read -r dev path fstype rest; do + if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then + ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs" + ewarn "filesystem. Otherwise udev won't be able to boot." + ewarn "See, https://bugs.gentoo.org/453186" + fi + done < "${fstab}" + + if [[ -d ${ROOT%/}/usr/lib/udev ]]; then + ewarn + ewarn "Please re-emerge all packages on your system which install" + ewarn "rules and helpers in /usr/lib/udev. They should now be in" + ewarn "/lib/udev." + ewarn + ewarn "One way to do this is to run the following command:" + ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)" + ewarn "Note that qfile can be found in app-portage/portage-utils" + fi + + local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules + local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules + for old_rules in "${old_cd_rules}" "${old_net_rules}"; do + if [[ -f ${old_rules} ]]; then + ewarn + ewarn "File ${old_rules} is from old udev installation but if you still use it," + ewarn "rename it to something else starting with 70- to silence this deprecation" + ewarn "warning." + fi + done + + elog + elog "Starting from version >= 197 the new predictable network interface names are" + elog "used by default, see:" + elog "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames" + elog "https://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c" + elog + elog "Example command to get the information for the new interface name before booting" + elog "(replace <ifname> with, for example, eth0):" + elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null" + elog + elog "You can use either kernel parameter \"net.ifnames=0\", create empty" + elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null" + elog "to disable the feature." + + if has_version 'sys-apps/biosdevname'; then + ewarn + ewarn "You can replace the functionality of sys-apps/biosdevname which has been" + ewarn "detected to be installed with the new predictable network interface names." + fi + + ewarn + ewarn "You need to restart udev as soon as possible to make the upgrade go" + ewarn "into effect." + ewarn "The method you use to do this depends on your init system." + if has_version 'sys-apps/openrc'; then + ewarn "For sys-apps/openrc users it is:" + ewarn "# /etc/init.d/udev --nodeps restart" + fi + + elog + elog "For more information on udev on Gentoo, upgrading, writing udev rules, and" + elog "fixing known issues visit:" + elog "https://wiki.gentoo.org/wiki/Udev" + elog "https://wiki.gentoo.org/wiki/Udev/upgrade" + + # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null, + # do the same for 80-net-setup-link.rules to keep the old behavior + local net_move=no + local net_name_slot_sym=no + local net_rules_path="${ROOT%/}"/etc/udev/rules.d + local net_name_slot="${net_rules_path}"/80-net-name-slot.rules + local net_setup_link="${net_rules_path}"/80-net-setup-link.rules + if [[ ! -e ${net_setup_link} ]]; then + [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes + if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then + net_move=yes + net_name_slot_sym=yes + fi + fi + if [[ ${net_move} == yes ]]; then + ebegin "Copying ${net_name_slot} to ${net_setup_link}" + + if [[ ${net_name_slot_sym} == yes ]]; then + ln -nfs /dev/null "${net_setup_link}" + else + cp "${net_name_slot}" "${net_setup_link}" + fi + eend $? + fi + + # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 + # https://bugs.gentoo.org/246847 + # https://bugs.gentoo.org/514174 + enewgroup input + + # Update hwdb database in case the format is changed by udev version. + if has_version 'sys-apps/hwids[udev]'; then + udevadm hwdb --update --root="${ROOT%/}" + # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd + # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda + [[ -z ${REPLACING_VERSIONS} ]] && udev_reload + fi +} diff --git a/sys-fs/udev/udev-234-r1.ebuild b/sys-fs/udev/udev-234-r1.ebuild new file mode 100644 index 000000000000..1d98a8ca3990 --- /dev/null +++ b/sys-fs/udev/udev-234-r1.ebuild @@ -0,0 +1,329 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit bash-completion-r1 linux-info meson ninja-utils multilib-minimal toolchain-funcs udev user versionator + +if [[ ${PV} = 9999* ]]; then + EGIT_REPO_URI="https://github.com/systemd/systemd.git" + inherit git-r3 +else + SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> systemd-${PV}.tar.gz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86" +fi + +DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" + +LICENSE="LGPL-2.1 MIT GPL-2" +SLOT="0" +IUSE="acl +kmod selinux" + +RESTRICT="test" + +COMMON_DEPEND=">=sys-apps/util-linux-2.27.1[${MULTILIB_USEDEP}] + sys-libs/libcap[${MULTILIB_USEDEP}] + acl? ( sys-apps/acl ) + kmod? ( >=sys-apps/kmod-16 ) + selinux? ( >=sys-libs/libselinux-2.1.9 ) + !<sys-libs/glibc-2.11 + !sys-apps/gentoo-systemd-integration + !sys-apps/systemd + abi_x86_32? ( + !<=app-emulation/emul-linux-x86-baselibs-20130224-r7 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] + )" +DEPEND="${COMMON_DEPEND} + dev-util/gperf + >=dev-util/intltool-0.50 + >=dev-util/meson-0.40.0 + dev-util/ninja + >=sys-apps/coreutils-8.16 + virtual/os-headers + virtual/pkgconfig + >=sys-kernel/linux-headers-3.9 + app-text/docbook-xml-dtd:4.2 + app-text/docbook-xml-dtd:4.5 + app-text/docbook-xsl-stylesheets + dev-libs/libxslt" +RDEPEND="${COMMON_DEPEND} + !<sys-fs/lvm2-2.02.103 + !<sec-policy/selinux-base-2.20120725-r10" +PDEPEND=">=sys-apps/hwids-20140304[udev] + >=sys-fs/udev-init-scripts-26" + +S=${WORKDIR}/systemd-${PV} +EGIT_CHECKOUT_DIR=${S} + +pkg_setup() { + if [[ ${MERGE_TYPE} != buildonly ]]; then + CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER ~UNIX" + linux-info_pkg_setup + + # CONFIG_FHANDLE was introduced by 2.6.39 + local MINKV=2.6.39 + + if kernel_is -lt ${MINKV//./ }; then + eerror "Your running kernel is too old to run this version of ${P}" + eerror "You need to upgrade kernel at least to ${MINKV}" + fi + + if kernel_is -lt 3 7; then + ewarn "Your running kernel is too old to have firmware loader and" + ewarn "this version of ${P} doesn't have userspace firmware loader" + ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7" + fi + fi +} + +src_prepare() { + if ! [[ ${PV} = 9999* ]]; then + # secure_getenv() disable for non-glibc systems wrt bug #443030 + if ! [[ $(grep -r secure_getenv * | wc -l) -eq 27 ]]; then + eerror "The line count for secure_getenv() failed, see bug #443030" + die + fi + fi + + cat <<-EOF > "${T}"/40-gentoo.rules + # Gentoo specific floppy and usb groups + ACTION=="add", SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy" + ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb" + EOF + + local PATCHES=( + "${FILESDIR}/234-uucp-group.patch" + ) + + default + + if ! use elibc_glibc; then #443030 + echo '#define secure_getenv(x) NULL' >> config.h.in + sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die + fi +} + +meson_multilib_native_use() { + if multilib_is_native_abi && use "$1"; then + echo true + else + echo false + fi +} + +multilib_src_configure() { + local emesonargs=( + -Dacl=$(meson_multilib_native_use acl) + -Defi=false + -Dkmod=$(meson_multilib_native_use kmod) + -Dselinux=$(meson_multilib_native_use selinux) + -Dlink-udev-shared=false + -Dsplit-usr=true + ) + meson_src_configure +} + +src_configure() { + # Prevent conflicts with i686 cross toolchain, bug 559726 + tc-export AR CC NM OBJCOPY RANLIB + multilib-minimal_src_configure +} + +multilib_src_compile() { + # meson creates this link + local libudev=$(readlink src/libudev/libudev.so.1) + + local targets=( + src/libudev/${libudev} + ) + if multilib_is_native_abi; then + targets+=( + systemd-udevd + udevadm + src/udev/ata_id + src/udev/cdrom_id + src/udev/collect + src/udev/mtd_probe + src/udev/scsi_id + src/udev/v4l_id + man/udev.conf.5 + man/systemd.link.5 + man/hwdb.7 + man/udev.7 + man/systemd-udevd.service.8 + man/udevadm.8 + ) + fi + eninja "${targets[@]}" +} + +multilib_src_install() { + local libudev=$(readlink src/libudev/libudev.so.1) + + into / + dolib.so src/libudev/{${libudev},libudev.so.1,libudev.so} + + insinto "/usr/$(get_libdir)/pkgconfig" + doins src/libudev/libudev.pc + + if multilib_is_native_abi; then + into / + dobin udevadm + + exeinto /lib/systemd + doexe systemd-udevd + + exeinto /lib/udev + doexe src/udev/{ata_id,cdrom_id,collect,mtd_probe,scsi_id,v4l_id} + + rm rules/99-systemd.rules || die + insinto /lib/udev/rules.d + doins rules/*.rules + + insinto /usr/share/pkgconfig + doins src/udev/udev.pc + + mv man/systemd-udevd.service.8 man/systemd-udevd.8 || die + rm man/systemd-udevd-{control,kernel}.socket.8 || die + doman man/*.[0-9] + fi +} + +multilib_src_install_all() { + doheader src/libudev/libudev.h + + insinto /etc/udev + doins src/udev/udev.conf + + insinto /lib/systemd/network + doins network/99-default.link + + # see src_prepare() for content of 40-gentoo.rules + insinto /lib/udev/rules.d + doins "${T}"/40-gentoo.rules + doins "${S}"/rules/*.rules + + dobashcomp shell-completion/bash/udevadm + + insinto /usr/share/zsh/site-functions + doins shell-completion/zsh/_udevadm + + einstalldocs +} + +pkg_postinst() { + mkdir -p "${ROOT%/}"/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 "${ROOT%/}"/dev/loop 2>/dev/null + if [[ -d ${ROOT%/}/dev/loop ]]; then + ewarn "Please make sure your remove /dev/loop," + ewarn "else losetup may be confused when looking for unused devices." + fi + + local fstab="${ROOT%/}"/etc/fstab dev path fstype rest + while read -r dev path fstype rest; do + if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then + ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs" + ewarn "filesystem. Otherwise udev won't be able to boot." + ewarn "See, https://bugs.gentoo.org/453186" + fi + done < "${fstab}" + + if [[ -d ${ROOT%/}/usr/lib/udev ]]; then + ewarn + ewarn "Please re-emerge all packages on your system which install" + ewarn "rules and helpers in /usr/lib/udev. They should now be in" + ewarn "/lib/udev." + ewarn + ewarn "One way to do this is to run the following command:" + ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)" + ewarn "Note that qfile can be found in app-portage/portage-utils" + fi + + local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules + local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules + for old_rules in "${old_cd_rules}" "${old_net_rules}"; do + if [[ -f ${old_rules} ]]; then + ewarn + ewarn "File ${old_rules} is from old udev installation but if you still use it," + ewarn "rename it to something else starting with 70- to silence this deprecation" + ewarn "warning." + fi + done + + elog + elog "Starting from version >= 197 the new predictable network interface names are" + elog "used by default, see:" + elog "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames" + elog "https://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c" + elog + elog "Example command to get the information for the new interface name before booting" + elog "(replace <ifname> with, for example, eth0):" + elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null" + elog + elog "You can use either kernel parameter \"net.ifnames=0\", create empty" + elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null" + elog "to disable the feature." + + if has_version 'sys-apps/biosdevname'; then + ewarn + ewarn "You can replace the functionality of sys-apps/biosdevname which has been" + ewarn "detected to be installed with the new predictable network interface names." + fi + + ewarn + ewarn "You need to restart udev as soon as possible to make the upgrade go" + ewarn "into effect." + ewarn "The method you use to do this depends on your init system." + if has_version 'sys-apps/openrc'; then + ewarn "For sys-apps/openrc users it is:" + ewarn "# /etc/init.d/udev --nodeps restart" + fi + + elog + elog "For more information on udev on Gentoo, upgrading, writing udev rules, and" + elog "fixing known issues visit:" + elog "https://wiki.gentoo.org/wiki/Udev" + elog "https://wiki.gentoo.org/wiki/Udev/upgrade" + + # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null, + # do the same for 80-net-setup-link.rules to keep the old behavior + local net_move=no + local net_name_slot_sym=no + local net_rules_path="${ROOT%/}"/etc/udev/rules.d + local net_name_slot="${net_rules_path}"/80-net-name-slot.rules + local net_setup_link="${net_rules_path}"/80-net-setup-link.rules + if [[ ! -e ${net_setup_link} ]]; then + [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes + if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then + net_move=yes + net_name_slot_sym=yes + fi + fi + if [[ ${net_move} == yes ]]; then + ebegin "Copying ${net_name_slot} to ${net_setup_link}" + + if [[ ${net_name_slot_sym} == yes ]]; then + ln -nfs /dev/null "${net_setup_link}" + else + cp "${net_name_slot}" "${net_setup_link}" + fi + eend $? + fi + + # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 + # https://bugs.gentoo.org/246847 + # https://bugs.gentoo.org/514174 + enewgroup input + + # Update hwdb database in case the format is changed by udev version. + if has_version 'sys-apps/hwids[udev]'; then + udevadm hwdb --update --root="${ROOT%/}" + # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd + # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda + [[ -z ${REPLACING_VERSIONS} ]] && udev_reload + fi +} diff --git a/sys-fs/udev/udev-235.ebuild b/sys-fs/udev/udev-235.ebuild new file mode 100644 index 000000000000..1853b357d182 --- /dev/null +++ b/sys-fs/udev/udev-235.ebuild @@ -0,0 +1,329 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit bash-completion-r1 linux-info meson ninja-utils multilib-minimal toolchain-funcs udev user versionator + +if [[ ${PV} = 9999* ]]; then + EGIT_REPO_URI="https://github.com/systemd/systemd.git" + inherit git-r3 +else + SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> systemd-${PV}.tar.gz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86" +fi + +DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" + +LICENSE="LGPL-2.1 MIT GPL-2" +SLOT="0" +IUSE="acl +kmod selinux" + +RESTRICT="test" + +COMMON_DEPEND=">=sys-apps/util-linux-2.30[${MULTILIB_USEDEP}] + sys-libs/libcap[${MULTILIB_USEDEP}] + acl? ( sys-apps/acl ) + kmod? ( >=sys-apps/kmod-16 ) + selinux? ( >=sys-libs/libselinux-2.1.9 ) + !<sys-libs/glibc-2.11 + !sys-apps/gentoo-systemd-integration + !sys-apps/systemd + abi_x86_32? ( + !<=app-emulation/emul-linux-x86-baselibs-20130224-r7 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] + )" +DEPEND="${COMMON_DEPEND} + dev-util/gperf + >=dev-util/intltool-0.50 + >=dev-util/meson-0.40.0 + dev-util/ninja + >=sys-apps/coreutils-8.16 + virtual/os-headers + virtual/pkgconfig + >=sys-kernel/linux-headers-3.9 + app-text/docbook-xml-dtd:4.2 + app-text/docbook-xml-dtd:4.5 + app-text/docbook-xsl-stylesheets + dev-libs/libxslt" +RDEPEND="${COMMON_DEPEND} + !<sys-fs/lvm2-2.02.103 + !<sec-policy/selinux-base-2.20120725-r10" +PDEPEND=">=sys-apps/hwids-20140304[udev] + >=sys-fs/udev-init-scripts-26" + +S=${WORKDIR}/systemd-${PV} +EGIT_CHECKOUT_DIR=${S} + +pkg_setup() { + if [[ ${MERGE_TYPE} != buildonly ]]; then + CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER ~UNIX" + linux-info_pkg_setup + + # CONFIG_FHANDLE was introduced by 2.6.39 + local MINKV=2.6.39 + + if kernel_is -lt ${MINKV//./ }; then + eerror "Your running kernel is too old to run this version of ${P}" + eerror "You need to upgrade kernel at least to ${MINKV}" + fi + + if kernel_is -lt 3 7; then + ewarn "Your running kernel is too old to have firmware loader and" + ewarn "this version of ${P} doesn't have userspace firmware loader" + ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7" + fi + fi +} + +src_prepare() { + if ! [[ ${PV} = 9999* ]]; then + # secure_getenv() disable for non-glibc systems wrt bug #443030 + if ! [[ $(grep -r secure_getenv * | wc -l) -eq 27 ]]; then + eerror "The line count for secure_getenv() failed, see bug #443030" + die + fi + fi + + cat <<-EOF > "${T}"/40-gentoo.rules + # Gentoo specific floppy and usb groups + ACTION=="add", SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy" + ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb" + EOF + + local PATCHES=( + "${FILESDIR}/234-uucp-group.patch" + ) + + default + + if ! use elibc_glibc; then #443030 + echo '#define secure_getenv(x) NULL' >> config.h.in + sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die + fi +} + +meson_multilib_native_use() { + if multilib_is_native_abi && use "$1"; then + echo true + else + echo false + fi +} + +multilib_src_configure() { + local emesonargs=( + -Dacl=$(meson_multilib_native_use acl) + -Defi=false + -Dkmod=$(meson_multilib_native_use kmod) + -Dselinux=$(meson_multilib_native_use selinux) + -Dlink-udev-shared=false + -Dsplit-usr=true + ) + meson_src_configure +} + +src_configure() { + # Prevent conflicts with i686 cross toolchain, bug 559726 + tc-export AR CC NM OBJCOPY RANLIB + multilib-minimal_src_configure +} + +multilib_src_compile() { + # meson creates this link + local libudev=$(readlink src/libudev/libudev.so.1) + + local targets=( + src/libudev/${libudev} + ) + if multilib_is_native_abi; then + targets+=( + systemd-udevd + udevadm + src/udev/ata_id + src/udev/cdrom_id + src/udev/collect + src/udev/mtd_probe + src/udev/scsi_id + src/udev/v4l_id + man/udev.conf.5 + man/systemd.link.5 + man/hwdb.7 + man/udev.7 + man/systemd-udevd.service.8 + man/udevadm.8 + ) + fi + eninja "${targets[@]}" +} + +multilib_src_install() { + local libudev=$(readlink src/libudev/libudev.so.1) + + into / + dolib.so src/libudev/{${libudev},libudev.so.1,libudev.so} + + insinto "/usr/$(get_libdir)/pkgconfig" + doins src/libudev/libudev.pc + + if multilib_is_native_abi; then + into / + dobin udevadm + + exeinto /lib/systemd + doexe systemd-udevd + + exeinto /lib/udev + doexe src/udev/{ata_id,cdrom_id,collect,mtd_probe,scsi_id,v4l_id} + + rm rules/99-systemd.rules || die + insinto /lib/udev/rules.d + doins rules/*.rules + + insinto /usr/share/pkgconfig + doins src/udev/udev.pc + + mv man/systemd-udevd.service.8 man/systemd-udevd.8 || die + rm man/systemd-udevd-{control,kernel}.socket.8 || die + doman man/*.[0-9] + fi +} + +multilib_src_install_all() { + doheader src/libudev/libudev.h + + insinto /etc/udev + doins src/udev/udev.conf + + insinto /lib/systemd/network + doins network/99-default.link + + # see src_prepare() for content of 40-gentoo.rules + insinto /lib/udev/rules.d + doins "${T}"/40-gentoo.rules + doins "${S}"/rules/*.rules + + dobashcomp shell-completion/bash/udevadm + + insinto /usr/share/zsh/site-functions + doins shell-completion/zsh/_udevadm + + einstalldocs +} + +pkg_postinst() { + mkdir -p "${ROOT%/}"/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 "${ROOT%/}"/dev/loop 2>/dev/null + if [[ -d ${ROOT%/}/dev/loop ]]; then + ewarn "Please make sure your remove /dev/loop," + ewarn "else losetup may be confused when looking for unused devices." + fi + + local fstab="${ROOT%/}"/etc/fstab dev path fstype rest + while read -r dev path fstype rest; do + if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then + ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs" + ewarn "filesystem. Otherwise udev won't be able to boot." + ewarn "See, https://bugs.gentoo.org/453186" + fi + done < "${fstab}" + + if [[ -d ${ROOT%/}/usr/lib/udev ]]; then + ewarn + ewarn "Please re-emerge all packages on your system which install" + ewarn "rules and helpers in /usr/lib/udev. They should now be in" + ewarn "/lib/udev." + ewarn + ewarn "One way to do this is to run the following command:" + ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)" + ewarn "Note that qfile can be found in app-portage/portage-utils" + fi + + local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules + local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules + for old_rules in "${old_cd_rules}" "${old_net_rules}"; do + if [[ -f ${old_rules} ]]; then + ewarn + ewarn "File ${old_rules} is from old udev installation but if you still use it," + ewarn "rename it to something else starting with 70- to silence this deprecation" + ewarn "warning." + fi + done + + elog + elog "Starting from version >= 197 the new predictable network interface names are" + elog "used by default, see:" + elog "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames" + elog "https://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c" + elog + elog "Example command to get the information for the new interface name before booting" + elog "(replace <ifname> with, for example, eth0):" + elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null" + elog + elog "You can use either kernel parameter \"net.ifnames=0\", create empty" + elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null" + elog "to disable the feature." + + if has_version 'sys-apps/biosdevname'; then + ewarn + ewarn "You can replace the functionality of sys-apps/biosdevname which has been" + ewarn "detected to be installed with the new predictable network interface names." + fi + + ewarn + ewarn "You need to restart udev as soon as possible to make the upgrade go" + ewarn "into effect." + ewarn "The method you use to do this depends on your init system." + if has_version 'sys-apps/openrc'; then + ewarn "For sys-apps/openrc users it is:" + ewarn "# /etc/init.d/udev --nodeps restart" + fi + + elog + elog "For more information on udev on Gentoo, upgrading, writing udev rules, and" + elog "fixing known issues visit:" + elog "https://wiki.gentoo.org/wiki/Udev" + elog "https://wiki.gentoo.org/wiki/Udev/upgrade" + + # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null, + # do the same for 80-net-setup-link.rules to keep the old behavior + local net_move=no + local net_name_slot_sym=no + local net_rules_path="${ROOT%/}"/etc/udev/rules.d + local net_name_slot="${net_rules_path}"/80-net-name-slot.rules + local net_setup_link="${net_rules_path}"/80-net-setup-link.rules + if [[ ! -e ${net_setup_link} ]]; then + [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes + if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then + net_move=yes + net_name_slot_sym=yes + fi + fi + if [[ ${net_move} == yes ]]; then + ebegin "Copying ${net_name_slot} to ${net_setup_link}" + + if [[ ${net_name_slot_sym} == yes ]]; then + ln -nfs /dev/null "${net_setup_link}" + else + cp "${net_name_slot}" "${net_setup_link}" + fi + eend $? + fi + + # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 + # https://bugs.gentoo.org/246847 + # https://bugs.gentoo.org/514174 + enewgroup input + + # Update hwdb database in case the format is changed by udev version. + if has_version 'sys-apps/hwids[udev]'; then + udevadm hwdb --update --root="${ROOT%/}" + # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd + # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda + [[ -z ${REPLACING_VERSIONS} ]] && udev_reload + fi +} diff --git a/sys-fs/udev/udev-9999.ebuild b/sys-fs/udev/udev-9999.ebuild new file mode 100644 index 000000000000..1853b357d182 --- /dev/null +++ b/sys-fs/udev/udev-9999.ebuild @@ -0,0 +1,329 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit bash-completion-r1 linux-info meson ninja-utils multilib-minimal toolchain-funcs udev user versionator + +if [[ ${PV} = 9999* ]]; then + EGIT_REPO_URI="https://github.com/systemd/systemd.git" + inherit git-r3 +else + SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> systemd-${PV}.tar.gz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86" +fi + +DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" + +LICENSE="LGPL-2.1 MIT GPL-2" +SLOT="0" +IUSE="acl +kmod selinux" + +RESTRICT="test" + +COMMON_DEPEND=">=sys-apps/util-linux-2.30[${MULTILIB_USEDEP}] + sys-libs/libcap[${MULTILIB_USEDEP}] + acl? ( sys-apps/acl ) + kmod? ( >=sys-apps/kmod-16 ) + selinux? ( >=sys-libs/libselinux-2.1.9 ) + !<sys-libs/glibc-2.11 + !sys-apps/gentoo-systemd-integration + !sys-apps/systemd + abi_x86_32? ( + !<=app-emulation/emul-linux-x86-baselibs-20130224-r7 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] + )" +DEPEND="${COMMON_DEPEND} + dev-util/gperf + >=dev-util/intltool-0.50 + >=dev-util/meson-0.40.0 + dev-util/ninja + >=sys-apps/coreutils-8.16 + virtual/os-headers + virtual/pkgconfig + >=sys-kernel/linux-headers-3.9 + app-text/docbook-xml-dtd:4.2 + app-text/docbook-xml-dtd:4.5 + app-text/docbook-xsl-stylesheets + dev-libs/libxslt" +RDEPEND="${COMMON_DEPEND} + !<sys-fs/lvm2-2.02.103 + !<sec-policy/selinux-base-2.20120725-r10" +PDEPEND=">=sys-apps/hwids-20140304[udev] + >=sys-fs/udev-init-scripts-26" + +S=${WORKDIR}/systemd-${PV} +EGIT_CHECKOUT_DIR=${S} + +pkg_setup() { + if [[ ${MERGE_TYPE} != buildonly ]]; then + CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER ~UNIX" + linux-info_pkg_setup + + # CONFIG_FHANDLE was introduced by 2.6.39 + local MINKV=2.6.39 + + if kernel_is -lt ${MINKV//./ }; then + eerror "Your running kernel is too old to run this version of ${P}" + eerror "You need to upgrade kernel at least to ${MINKV}" + fi + + if kernel_is -lt 3 7; then + ewarn "Your running kernel is too old to have firmware loader and" + ewarn "this version of ${P} doesn't have userspace firmware loader" + ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7" + fi + fi +} + +src_prepare() { + if ! [[ ${PV} = 9999* ]]; then + # secure_getenv() disable for non-glibc systems wrt bug #443030 + if ! [[ $(grep -r secure_getenv * | wc -l) -eq 27 ]]; then + eerror "The line count for secure_getenv() failed, see bug #443030" + die + fi + fi + + cat <<-EOF > "${T}"/40-gentoo.rules + # Gentoo specific floppy and usb groups + ACTION=="add", SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy" + ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb" + EOF + + local PATCHES=( + "${FILESDIR}/234-uucp-group.patch" + ) + + default + + if ! use elibc_glibc; then #443030 + echo '#define secure_getenv(x) NULL' >> config.h.in + sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die + fi +} + +meson_multilib_native_use() { + if multilib_is_native_abi && use "$1"; then + echo true + else + echo false + fi +} + +multilib_src_configure() { + local emesonargs=( + -Dacl=$(meson_multilib_native_use acl) + -Defi=false + -Dkmod=$(meson_multilib_native_use kmod) + -Dselinux=$(meson_multilib_native_use selinux) + -Dlink-udev-shared=false + -Dsplit-usr=true + ) + meson_src_configure +} + +src_configure() { + # Prevent conflicts with i686 cross toolchain, bug 559726 + tc-export AR CC NM OBJCOPY RANLIB + multilib-minimal_src_configure +} + +multilib_src_compile() { + # meson creates this link + local libudev=$(readlink src/libudev/libudev.so.1) + + local targets=( + src/libudev/${libudev} + ) + if multilib_is_native_abi; then + targets+=( + systemd-udevd + udevadm + src/udev/ata_id + src/udev/cdrom_id + src/udev/collect + src/udev/mtd_probe + src/udev/scsi_id + src/udev/v4l_id + man/udev.conf.5 + man/systemd.link.5 + man/hwdb.7 + man/udev.7 + man/systemd-udevd.service.8 + man/udevadm.8 + ) + fi + eninja "${targets[@]}" +} + +multilib_src_install() { + local libudev=$(readlink src/libudev/libudev.so.1) + + into / + dolib.so src/libudev/{${libudev},libudev.so.1,libudev.so} + + insinto "/usr/$(get_libdir)/pkgconfig" + doins src/libudev/libudev.pc + + if multilib_is_native_abi; then + into / + dobin udevadm + + exeinto /lib/systemd + doexe systemd-udevd + + exeinto /lib/udev + doexe src/udev/{ata_id,cdrom_id,collect,mtd_probe,scsi_id,v4l_id} + + rm rules/99-systemd.rules || die + insinto /lib/udev/rules.d + doins rules/*.rules + + insinto /usr/share/pkgconfig + doins src/udev/udev.pc + + mv man/systemd-udevd.service.8 man/systemd-udevd.8 || die + rm man/systemd-udevd-{control,kernel}.socket.8 || die + doman man/*.[0-9] + fi +} + +multilib_src_install_all() { + doheader src/libudev/libudev.h + + insinto /etc/udev + doins src/udev/udev.conf + + insinto /lib/systemd/network + doins network/99-default.link + + # see src_prepare() for content of 40-gentoo.rules + insinto /lib/udev/rules.d + doins "${T}"/40-gentoo.rules + doins "${S}"/rules/*.rules + + dobashcomp shell-completion/bash/udevadm + + insinto /usr/share/zsh/site-functions + doins shell-completion/zsh/_udevadm + + einstalldocs +} + +pkg_postinst() { + mkdir -p "${ROOT%/}"/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 "${ROOT%/}"/dev/loop 2>/dev/null + if [[ -d ${ROOT%/}/dev/loop ]]; then + ewarn "Please make sure your remove /dev/loop," + ewarn "else losetup may be confused when looking for unused devices." + fi + + local fstab="${ROOT%/}"/etc/fstab dev path fstype rest + while read -r dev path fstype rest; do + if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then + ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs" + ewarn "filesystem. Otherwise udev won't be able to boot." + ewarn "See, https://bugs.gentoo.org/453186" + fi + done < "${fstab}" + + if [[ -d ${ROOT%/}/usr/lib/udev ]]; then + ewarn + ewarn "Please re-emerge all packages on your system which install" + ewarn "rules and helpers in /usr/lib/udev. They should now be in" + ewarn "/lib/udev." + ewarn + ewarn "One way to do this is to run the following command:" + ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)" + ewarn "Note that qfile can be found in app-portage/portage-utils" + fi + + local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules + local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules + for old_rules in "${old_cd_rules}" "${old_net_rules}"; do + if [[ -f ${old_rules} ]]; then + ewarn + ewarn "File ${old_rules} is from old udev installation but if you still use it," + ewarn "rename it to something else starting with 70- to silence this deprecation" + ewarn "warning." + fi + done + + elog + elog "Starting from version >= 197 the new predictable network interface names are" + elog "used by default, see:" + elog "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames" + elog "https://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c" + elog + elog "Example command to get the information for the new interface name before booting" + elog "(replace <ifname> with, for example, eth0):" + elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null" + elog + elog "You can use either kernel parameter \"net.ifnames=0\", create empty" + elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null" + elog "to disable the feature." + + if has_version 'sys-apps/biosdevname'; then + ewarn + ewarn "You can replace the functionality of sys-apps/biosdevname which has been" + ewarn "detected to be installed with the new predictable network interface names." + fi + + ewarn + ewarn "You need to restart udev as soon as possible to make the upgrade go" + ewarn "into effect." + ewarn "The method you use to do this depends on your init system." + if has_version 'sys-apps/openrc'; then + ewarn "For sys-apps/openrc users it is:" + ewarn "# /etc/init.d/udev --nodeps restart" + fi + + elog + elog "For more information on udev on Gentoo, upgrading, writing udev rules, and" + elog "fixing known issues visit:" + elog "https://wiki.gentoo.org/wiki/Udev" + elog "https://wiki.gentoo.org/wiki/Udev/upgrade" + + # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null, + # do the same for 80-net-setup-link.rules to keep the old behavior + local net_move=no + local net_name_slot_sym=no + local net_rules_path="${ROOT%/}"/etc/udev/rules.d + local net_name_slot="${net_rules_path}"/80-net-name-slot.rules + local net_setup_link="${net_rules_path}"/80-net-setup-link.rules + if [[ ! -e ${net_setup_link} ]]; then + [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes + if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then + net_move=yes + net_name_slot_sym=yes + fi + fi + if [[ ${net_move} == yes ]]; then + ebegin "Copying ${net_name_slot} to ${net_setup_link}" + + if [[ ${net_name_slot_sym} == yes ]]; then + ln -nfs /dev/null "${net_setup_link}" + else + cp "${net_name_slot}" "${net_setup_link}" + fi + eend $? + fi + + # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 + # https://bugs.gentoo.org/246847 + # https://bugs.gentoo.org/514174 + enewgroup input + + # Update hwdb database in case the format is changed by udev version. + if has_version 'sys-apps/hwids[udev]'; then + udevadm hwdb --update --root="${ROOT%/}" + # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd + # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda + [[ -z ${REPLACING_VERSIONS} ]] && udev_reload + fi +} |