summaryrefslogtreecommitdiff
path: root/sys-fs/aufs4
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-fs/aufs4
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-fs/aufs4')
-rw-r--r--sys-fs/aufs4/Manifest25
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20160219.ebuild184
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20160223.ebuild184
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20160627.ebuild184
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20160815.ebuild184
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20161010.ebuild184
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20161219.ebuild184
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20170130.ebuild184
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20170220.ebuild184
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20170313.ebuild184
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20170612.ebuild184
-rw-r--r--sys-fs/aufs4/files/README.gentoo20
-rw-r--r--sys-fs/aufs4/files/pax-4.patch89
-rw-r--r--sys-fs/aufs4/metadata.xml20
14 files changed, 1994 insertions, 0 deletions
diff --git a/sys-fs/aufs4/Manifest b/sys-fs/aufs4/Manifest
new file mode 100644
index 000000000000..099bbae357a2
--- /dev/null
+++ b/sys-fs/aufs4/Manifest
@@ -0,0 +1,25 @@
+AUX README.gentoo 911 SHA256 9b9eb681f692f052105bf3d3d15e689685a5fcfba1d90a88b3351158d4cebd97 SHA512 f22f1e1fae62c7a03230194c05701dc03502b84a52cfc8aacb5fbfab2c1f8bed9d4f3f97d0095578d497b09f818a3a45a04ef8527983e0cbfa9db10baeb1b691 WHIRLPOOL 73c88b3df5e691659e2e2044bda00119e742178868fa74ca7990c3d0204eaca495bc625353c22804c7420db807774941cdddd2e901c2cbceb36aa220ee3d4d95
+AUX pax-4.patch 2722 SHA256 133d80384de031c73d989a36b4e88571a5b1084c51366cfec3f5234e7e1ef446 SHA512 dc7e8eba4aa01552ec0d44636db99aa7c3d9af11f1182165ad7da383f9ed4cd92e4b9aef779b3d2bcb62797fd7d673ae35294ee1b9b768320be5bb5a03893de8 WHIRLPOOL e329ea70448d30510b5dc64ba9eca54c969c6781dc75ed326714ad0de90d10f43844e62e840cf1bfaed0ebb166b9f8a3cdef295ff06f5b38b4e5d75857e3fb46
+DIST aufs4-standalone-0_pre20160219.tar.xz 1049884 SHA256 22d0f723ff52190670da0e3dc4a3f0b81ba0b3b6f287484cf81165c6cd4b2040 SHA512 95999199ac0d430a6ab2dbda75f34d9640179865d5be3b1db119c1e613f5bd167193dd7cf662ebcea9d81ad8008d9dbd8dd835d5a7a297456f8587364e7f16b1 WHIRLPOOL a8b7a9c80c7715d0f75c9ee15e78bfbef2db11d4d9fea6ac1e8163f86b735c57b7e6a5612ac269fbcc2c483537a06c1e7704b9c3db2c7dff09b08d228ba607a1
+DIST aufs4-standalone-0_pre20160223.tar.xz 1072092 SHA256 46c9e0bb68902fb92028a435fab9d31a6193407af8c29d8ce0cdefd2e841b723 SHA512 adafd18416a43af076292ea216db73f0569f25ce34d03ebde5aea049745c47979cc4778eef8f671d48a5f7d7ac5751f788d286f467a106c6660412e88442b18e WHIRLPOOL c41763b4abb78afb291a4fbe7e1010ffc6c82a62a9d8b8b0cd23ecff65ae8f6142265f7de9f4e5ee260e0f98ca04f08881778ad7035ecde6e0c910d8a38e3be7
+DIST aufs4-standalone-0_pre20160627.tar.xz 1427036 SHA256 47e8fbaef29d62b7d5856103966e254840771d329dc2a181014d43a19629063b SHA512 c2e3d92fc6ca8968071a40d2773b63ec21fdd2bb12e8375dced30279ffcafcd06cacb0c20a6bb5378704c5de670426d0d92149bb5737507e3515b5df648e1b81 WHIRLPOOL 813262655193abf9fc61b993f70c11e052f5803b66ac8fdfcbd4b476ef03e7ae7c7be13520e9c7c3349d1ab89628dabf6b01a81f98ed82082c15515922ab07c5
+DIST aufs4-standalone-0_pre20160815.tar.xz 1648360 SHA256 35b2b8c558a9927eb6079055fbe040bc790d31131193afde6270f5cc6dd19603 SHA512 a9a86ce4fce04100704cce1acf04b8eeff6a2b81cc591d3ceeafa736a3a8e8fed59538f9301af6cb3ec496dd914b81a3134669ba8871624b2266cc3f731b9fae WHIRLPOOL 68c6241c7680670e68d2b09fdc8008a90b666c9baf49960785c626637d412811ba12582b62830a49309cc8f2b36a1ff874973ad89eb61b80ed0cf02e58a86a53
+DIST aufs4-standalone-0_pre20161010.tar.xz 1635556 SHA256 86d9ba7c401640a990991ca7dbea587ac755253791e0d325ec77ca01730359e3 SHA512 520f47255ee33762f111f93ceeaaee9cf6136c13fb6968a7a7d49388c189e112875f076c5fecdad2123d137a2bc0b74e9c0e6e8913e75dfede30e7a65dd74616 WHIRLPOOL 6b8b1836093ba29bfbf24a6a02231c9514a406d99a5b78bd9db660d388efc9f6e09957b11bc5c3f1f4dc71188a37822e708d48bf5940627881373897b08f3c85
+DIST aufs4-standalone-0_pre20161219.tar.xz 1823772 SHA256 92554aa017279d31c3a3228f32dee70f7dee3cdd105b4f281f16e92900120d24 SHA512 59fc0df19716d8f03e2547d98d6f412e921576d60afd783e5691a07c09b298ee61f491501e07ec154665a56d11b1887f94813ef5972254e6391251a48ba156c9 WHIRLPOOL 8470f594e6ebb6d56da9b4c20d1b372a77aac2e0b7e009e15f76d082b8ad51b287ccc1da7f64cbcb4d513af4780795b811dea1b1f953e306bb23d56a72453a36
+DIST aufs4-standalone-0_pre20170130.tar.xz 1761280 SHA256 ea854a64dabfb6b2d6c6befd96f4cad75dc1c827399b8ad2f72c2ed495e9c18c SHA512 beb121b36bb6056e48d5402b10bdfb8b6cd20d61b7d74221e5abd10226f58f40be1a0853e06a09cc1f94d50543030a9fd0a1c117570b1ad7467bf4156a1492ea WHIRLPOOL 39e75962842e4de6c151c9fd3c414bd0e7ce268be6fad699f97ebff3480b1a5f6a9966445035967dd4ec96423847b797dd72c9ae8f1067c152c83cf0ca488a85
+DIST aufs4-standalone-0_pre20170220.tar.xz 2115232 SHA256 96dcb9d94d1d2358a61e9d5cdfb9c9e6e4886018f5d24a76ab8deb7e03b7f04f SHA512 c68cf12573a0f3d9ec9419c63759d2b6f120eaafbbc005553c31d9c07b77d61612b903dc7ebdb2a8de8a52ded62e20b08cd32206b3cd3df196f0c1da82d472f7 WHIRLPOOL a2a3f10d003999a9498978a7b0d013cf918070cad975bfe54429d158d980943864fd810178a0639925d54c33974d13fa782950c77756469c646ebc57ddd6f917
+DIST aufs4-standalone-0_pre20170313.tar.xz 1883012 SHA256 195b0a821fe9fe7f22416848699bb464434d6c7562d981a3fa64f8670234b516 SHA512 7d711e0ebdc38aa79d3b7cdb04c91f3029c233bacdadca87a8622d48826c261c678d6a2cda6b627a0db0f248b35448e0d9da30e2c8e2e42e3b1e3ae6327033ba WHIRLPOOL 41410d251ede7e85faee6aaac4139aa00862f7dfdf4eeef6baef72f0324d594cf48c416d3d3dc7ff98ad0563d3b7b0b3c20f75784947660947b20a74331d89c7
+DIST aufs4-standalone-0_pre20170612.tar.xz 2017248 SHA256 fe725b22ace944b26cc33a79fe8cb977824937473ee4b67b95d62854da1dd589 SHA512 2d0fd1dce7b1a421533e667420fc69a44c378753dccddc3768eebdb906a023e41378b38961004a58b1c4f2e3844c86f8cb4be238e634318a380881eab513acfa WHIRLPOOL c74bea33b077e3dda7abe165daf0e5c54e1949f6b3d3928b47e50d13e9dee1a9b2a49605b85d9afb52dd36c69a61c1f07969e4a05da0aa705051d719b8a86776
+EBUILD aufs4-0_pre20160219.ebuild 5069 SHA256 d8f28085ae0693564e62d1f8f790d72365800a0d520c9e36b60e85c5b37ba1b2 SHA512 5482bc519f49fe439f6cdc5e2a5c7041fe9359ca6804f9757f6d3b1a5ca9387e4e52735500a5c1038a6f21e22684039811fab51afb337d123980cf14132fa6f7 WHIRLPOOL 7bf3cd55469fd27b582ea57132a23bc67ca9b27070c1e52e223127817c5d5715d74e9913e8aa049bc0d3074cfed0c46a6fbdb25ac7e660be25913aacacdb9c3f
+EBUILD aufs4-0_pre20160223.ebuild 5069 SHA256 d8f28085ae0693564e62d1f8f790d72365800a0d520c9e36b60e85c5b37ba1b2 SHA512 5482bc519f49fe439f6cdc5e2a5c7041fe9359ca6804f9757f6d3b1a5ca9387e4e52735500a5c1038a6f21e22684039811fab51afb337d123980cf14132fa6f7 WHIRLPOOL 7bf3cd55469fd27b582ea57132a23bc67ca9b27070c1e52e223127817c5d5715d74e9913e8aa049bc0d3074cfed0c46a6fbdb25ac7e660be25913aacacdb9c3f
+EBUILD aufs4-0_pre20160627.ebuild 5069 SHA256 ae1674210d594091803cd98fcab4a5a451655b53ded37cc0cfc8f0824869726a SHA512 ee12cf58211697584c8314b46acc150c8e0e1ecf4a003883c0e9666df128d2298f46506e6248e1671e3a8ea677336331e4e98502a3d8636821023e29fe446ba4 WHIRLPOOL 23e413311af73f8e9eb9af5536910923a2e53bb164b2be67b4984e3a6fb836c0843a2535a3f5a7bb7770d1d33bc60737defed73b06a61d2de9a4e8c8aa9a15d4
+EBUILD aufs4-0_pre20160815.ebuild 5069 SHA256 ae1674210d594091803cd98fcab4a5a451655b53ded37cc0cfc8f0824869726a SHA512 ee12cf58211697584c8314b46acc150c8e0e1ecf4a003883c0e9666df128d2298f46506e6248e1671e3a8ea677336331e4e98502a3d8636821023e29fe446ba4 WHIRLPOOL 23e413311af73f8e9eb9af5536910923a2e53bb164b2be67b4984e3a6fb836c0843a2535a3f5a7bb7770d1d33bc60737defed73b06a61d2de9a4e8c8aa9a15d4
+EBUILD aufs4-0_pre20161010.ebuild 5069 SHA256 4b56b26647dda6aaf7a26ec603c95992155f0ef0223be74c604a0502faa9860d SHA512 fd486f8b5c4447479686aeb65d15f5992c20d72c31e6524cb4ced86a7ef4f96bd36d9f2a3252d87beda191f80bc7e042fe57ad7bf3335bf796813d59293a90a0 WHIRLPOOL b4d45760df994a78a73e5ab3079bf6152f99b418de6321cb8b1e8e4067bbf8f4c427f729527dc9055825d87a3a7a98dddbd52f59619da24e1749cb025fc2b744
+EBUILD aufs4-0_pre20161219.ebuild 5069 SHA256 4b56b26647dda6aaf7a26ec603c95992155f0ef0223be74c604a0502faa9860d SHA512 fd486f8b5c4447479686aeb65d15f5992c20d72c31e6524cb4ced86a7ef4f96bd36d9f2a3252d87beda191f80bc7e042fe57ad7bf3335bf796813d59293a90a0 WHIRLPOOL b4d45760df994a78a73e5ab3079bf6152f99b418de6321cb8b1e8e4067bbf8f4c427f729527dc9055825d87a3a7a98dddbd52f59619da24e1749cb025fc2b744
+EBUILD aufs4-0_pre20170130.ebuild 5070 SHA256 b215cd1740df75261ba15d56d297005f7c6f83e480c8389359e518cea9dd291c SHA512 756b514a6d2d86692e872a2e513f95ae9b0387b44d1ffdd506eb9c698eef74b601de45d24dd02e75610aa8e6fbef91bd44c10b34c006a3cdad17b74b8d17a5b5 WHIRLPOOL b775cef39ec8119bbb5b82f77227b8f35d91c9b29743f8e41ed66d3a1277027362dd6ba289ed3b863609ac49965e2b12e1a9bae12643c1dc7daa4c473fa8cfe9
+EBUILD aufs4-0_pre20170220.ebuild 5070 SHA256 b215cd1740df75261ba15d56d297005f7c6f83e480c8389359e518cea9dd291c SHA512 756b514a6d2d86692e872a2e513f95ae9b0387b44d1ffdd506eb9c698eef74b601de45d24dd02e75610aa8e6fbef91bd44c10b34c006a3cdad17b74b8d17a5b5 WHIRLPOOL b775cef39ec8119bbb5b82f77227b8f35d91c9b29743f8e41ed66d3a1277027362dd6ba289ed3b863609ac49965e2b12e1a9bae12643c1dc7daa4c473fa8cfe9
+EBUILD aufs4-0_pre20170313.ebuild 5070 SHA256 5a8e50bcc13bbd19ff8e2f28b71c1b1bb985aa0b6affe5488ee595c9ea9a0609 SHA512 7af320fd64d5da1edfd1a5c2eb4b433a2b03c9ee85cc6d40e71af086856589cc66d92336223a4d36c2ec08cabf1bf5c8f225b9935f3da86429718752efaca939 WHIRLPOOL aef3c0c428a5f4215ae33991209fa5dd357c77f0bc7b820348bf5da06a6471f7f6edd26070f61963e7be1e829b12b80950c5b97711d7b5a19bed950ced7c5216
+EBUILD aufs4-0_pre20170612.ebuild 5071 SHA256 07f102c3aaabaae0e07d372072f98d0b9b16789aaa8b3b3d5f3b5812116de0a2 SHA512 967961b3757a59705eddb781d470893deb54080fa70f52609d0228830fafb94737dd40b5e3269601b92f50e65795738809c1bde433949f9f504a575639e0d3b3 WHIRLPOOL 934add0c44f2993f2dec324b12edfbef25a62ce2df18c590478df684e2bfbb219e9e956eeab8b9c49519f7a7ec28a1365d3c43b457cc5dfc4afb4a48078df766
+MISC ChangeLog 7679 SHA256 a26f1f94bebd38395c6162e8e45f03aa9e41dfe9147ff1ea8c5c00161f90401a SHA512 06a64b896f1ae97b05a96f29f05e82887b2968e646561a09291fbd1e83dce2bceca3b0ff9caddf1ae109d356d518dfd1ebdf7cf6cbb054a9722492f819066ce9 WHIRLPOOL 07dd85072931199d69207bb2b2fcfc6bb06f3d00511f7090bcdeb95ec5ca78406c81e0b1ea4c7f159ad505dde8149199c260bce3eab2e3ea65e3c209f6e46e96
+MISC ChangeLog-2015 1365 SHA256 e771df45ce7333a94ae23d05016f2644530233f1385683dd1cc1905cf67ec602 SHA512 84886306c5ffa5fac414d73e19ef31fa68e393e4fd449be0cca9b13af2fed37d3517b3ce486ea2b7b95d9de91ead61f66309d380b4626d552178520f8df7a0de WHIRLPOOL ec795a56aa3551a77c2c0ebc8ea526ed6c5ad1556a8246d38de993a806cae4a5c9512170992a500372474ea66bee7c92921c28808e1264d4aa8ab09145cbbbf5
+MISC metadata.xml 809 SHA256 36364d972f838e36cbf1cb5b5857077cac43ba9a05ae57be7aa9050af93b1e25 SHA512 043c012f55866721363c82fd80007c4ed8420fd8eec95459aac9fb913d855a0be5f135035ba5e3fcab668641ca61897d71ea8e48c1d45f171d418c812620d576 WHIRLPOOL 4ce31dd2931da5af1ae06aa0cce080196e9500ee7cf1760c93e0fa8445a84a6ea10a76b40ac0027b75e73f9507f5a7966636f1bf619e04d04fd31956bdd484ee
diff --git a/sys-fs/aufs4/aufs4-0_pre20160219.ebuild b/sys-fs/aufs4/aufs4-0_pre20160219.ebuild
new file mode 100644
index 000000000000..cb3b25bc99ab
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20160219.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo-r1 toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=4
+# highest supported version
+KERN_MAX_VER=5
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" \
+ && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is
+ # possible w/out a kernel unpacked on the system
+ [[ -n "$PKG_SETUP_HAS_BEEN_RAN" ]] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "1" ]] && [[ "${KV_PATCH}" -ge "13" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".13+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null || die
+ unpack ${A}
+
+ cd ${PN}-standalone || die
+
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+
+ combinediff \
+ ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff \
+ "${T}"/combined-1.patch ${PN}-mmap.patch \
+ > ${PN}-standalone-base-mmap-combined.patch
+
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch \
+ --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} \
+ < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch \
+ > /dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || \
+ die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ use pax_kernel && epatch "${FILESDIR}"/pax-4.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+
+ eapply_user
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ use doc && dodoc -r Documentation
+
+ use kernel-patch || \
+ doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc \
+ Documentation/filesystems/aufs/README \
+ "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20160223.ebuild b/sys-fs/aufs4/aufs4-0_pre20160223.ebuild
new file mode 100644
index 000000000000..cb3b25bc99ab
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20160223.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo-r1 toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=4
+# highest supported version
+KERN_MAX_VER=5
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" \
+ && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is
+ # possible w/out a kernel unpacked on the system
+ [[ -n "$PKG_SETUP_HAS_BEEN_RAN" ]] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "1" ]] && [[ "${KV_PATCH}" -ge "13" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".13+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null || die
+ unpack ${A}
+
+ cd ${PN}-standalone || die
+
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+
+ combinediff \
+ ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff \
+ "${T}"/combined-1.patch ${PN}-mmap.patch \
+ > ${PN}-standalone-base-mmap-combined.patch
+
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch \
+ --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} \
+ < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch \
+ > /dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || \
+ die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ use pax_kernel && epatch "${FILESDIR}"/pax-4.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+
+ eapply_user
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ use doc && dodoc -r Documentation
+
+ use kernel-patch || \
+ doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc \
+ Documentation/filesystems/aufs/README \
+ "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20160627.ebuild b/sys-fs/aufs4/aufs4-0_pre20160627.ebuild
new file mode 100644
index 000000000000..2ce209aa7456
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20160627.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo-r1 toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=5
+# highest supported version
+KERN_MAX_VER=6
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" \
+ && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is
+ # possible w/out a kernel unpacked on the system
+ [[ -n "$PKG_SETUP_HAS_BEEN_RAN" ]] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "1" ]] && [[ "${KV_PATCH}" -ge "13" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".13+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null || die
+ unpack ${A}
+
+ cd ${PN}-standalone || die
+
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+
+ combinediff \
+ ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff \
+ "${T}"/combined-1.patch ${PN}-mmap.patch \
+ > ${PN}-standalone-base-mmap-combined.patch
+
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch \
+ --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} \
+ < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch \
+ > /dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || \
+ die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ use pax_kernel && epatch "${FILESDIR}"/pax-4.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+
+ eapply_user
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ use doc && dodoc -r Documentation
+
+ use kernel-patch || \
+ doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc \
+ Documentation/filesystems/aufs/README \
+ "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20160815.ebuild b/sys-fs/aufs4/aufs4-0_pre20160815.ebuild
new file mode 100644
index 000000000000..2ce209aa7456
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20160815.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo-r1 toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=5
+# highest supported version
+KERN_MAX_VER=6
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" \
+ && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is
+ # possible w/out a kernel unpacked on the system
+ [[ -n "$PKG_SETUP_HAS_BEEN_RAN" ]] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "1" ]] && [[ "${KV_PATCH}" -ge "13" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".13+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null || die
+ unpack ${A}
+
+ cd ${PN}-standalone || die
+
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+
+ combinediff \
+ ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff \
+ "${T}"/combined-1.patch ${PN}-mmap.patch \
+ > ${PN}-standalone-base-mmap-combined.patch
+
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch \
+ --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} \
+ < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch \
+ > /dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || \
+ die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ use pax_kernel && epatch "${FILESDIR}"/pax-4.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+
+ eapply_user
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ use doc && dodoc -r Documentation
+
+ use kernel-patch || \
+ doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc \
+ Documentation/filesystems/aufs/README \
+ "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20161010.ebuild b/sys-fs/aufs4/aufs4-0_pre20161010.ebuild
new file mode 100644
index 000000000000..74da974872fd
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20161010.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo-r1 toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=8
+# highest supported version
+KERN_MAX_VER=9
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" \
+ && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is
+ # possible w/out a kernel unpacked on the system
+ [[ -n "$PKG_SETUP_HAS_BEEN_RAN" ]] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "1" ]] && [[ "${KV_PATCH}" -ge "13" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".13+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null || die
+ unpack ${A}
+
+ cd ${PN}-standalone || die
+
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+
+ combinediff \
+ ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff \
+ "${T}"/combined-1.patch ${PN}-mmap.patch \
+ > ${PN}-standalone-base-mmap-combined.patch
+
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch \
+ --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} \
+ < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch \
+ > /dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || \
+ die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ use pax_kernel && epatch "${FILESDIR}"/pax-4.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+
+ eapply_user
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ use doc && dodoc -r Documentation
+
+ use kernel-patch || \
+ doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc \
+ Documentation/filesystems/aufs/README \
+ "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20161219.ebuild b/sys-fs/aufs4/aufs4-0_pre20161219.ebuild
new file mode 100644
index 000000000000..74da974872fd
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20161219.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo-r1 toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=8
+# highest supported version
+KERN_MAX_VER=9
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" \
+ && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is
+ # possible w/out a kernel unpacked on the system
+ [[ -n "$PKG_SETUP_HAS_BEEN_RAN" ]] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "1" ]] && [[ "${KV_PATCH}" -ge "13" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".13+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null || die
+ unpack ${A}
+
+ cd ${PN}-standalone || die
+
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+
+ combinediff \
+ ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff \
+ "${T}"/combined-1.patch ${PN}-mmap.patch \
+ > ${PN}-standalone-base-mmap-combined.patch
+
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch \
+ --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} \
+ < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch \
+ > /dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || \
+ die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ use pax_kernel && epatch "${FILESDIR}"/pax-4.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+
+ eapply_user
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ use doc && dodoc -r Documentation
+
+ use kernel-patch || \
+ doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc \
+ Documentation/filesystems/aufs/README \
+ "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20170130.ebuild b/sys-fs/aufs4/aufs4-0_pre20170130.ebuild
new file mode 100644
index 000000000000..ff94ecb3cd1c
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20170130.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo-r1 toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=9
+# highest supported version
+KERN_MAX_VER=10
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" \
+ && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is
+ # possible w/out a kernel unpacked on the system
+ [[ -n "$PKG_SETUP_HAS_BEEN_RAN" ]] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "1" ]] && [[ "${KV_PATCH}" -ge "13" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".13+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null || die
+ unpack ${A}
+
+ cd ${PN}-standalone || die
+
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+
+ combinediff \
+ ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff \
+ "${T}"/combined-1.patch ${PN}-mmap.patch \
+ > ${PN}-standalone-base-mmap-combined.patch
+
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch \
+ --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} \
+ < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch \
+ > /dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || \
+ die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ use pax_kernel && epatch "${FILESDIR}"/pax-4.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+
+ eapply_user
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ use doc && dodoc -r Documentation
+
+ use kernel-patch || \
+ doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc \
+ Documentation/filesystems/aufs/README \
+ "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20170220.ebuild b/sys-fs/aufs4/aufs4-0_pre20170220.ebuild
new file mode 100644
index 000000000000..ff94ecb3cd1c
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20170220.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo-r1 toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=9
+# highest supported version
+KERN_MAX_VER=10
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" \
+ && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is
+ # possible w/out a kernel unpacked on the system
+ [[ -n "$PKG_SETUP_HAS_BEEN_RAN" ]] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "1" ]] && [[ "${KV_PATCH}" -ge "13" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".13+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null || die
+ unpack ${A}
+
+ cd ${PN}-standalone || die
+
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+
+ combinediff \
+ ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff \
+ "${T}"/combined-1.patch ${PN}-mmap.patch \
+ > ${PN}-standalone-base-mmap-combined.patch
+
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch \
+ --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} \
+ < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch \
+ > /dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || \
+ die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ use pax_kernel && epatch "${FILESDIR}"/pax-4.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+
+ eapply_user
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ use doc && dodoc -r Documentation
+
+ use kernel-patch || \
+ doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc \
+ Documentation/filesystems/aufs/README \
+ "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20170313.ebuild b/sys-fs/aufs4/aufs4-0_pre20170313.ebuild
new file mode 100644
index 000000000000..0be383f2e126
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20170313.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo-r1 toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=9
+# highest supported version
+KERN_MAX_VER=11
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" \
+ && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is
+ # possible w/out a kernel unpacked on the system
+ [[ -n "$PKG_SETUP_HAS_BEEN_RAN" ]] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "1" ]] && [[ "${KV_PATCH}" -ge "13" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".13+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null || die
+ unpack ${A}
+
+ cd ${PN}-standalone || die
+
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+
+ combinediff \
+ ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff \
+ "${T}"/combined-1.patch ${PN}-mmap.patch \
+ > ${PN}-standalone-base-mmap-combined.patch
+
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch \
+ --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} \
+ < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch \
+ > /dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || \
+ die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ use pax_kernel && epatch "${FILESDIR}"/pax-4.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+
+ eapply_user
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ use doc && dodoc -r Documentation
+
+ use kernel-patch || \
+ doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc \
+ Documentation/filesystems/aufs/README \
+ "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20170612.ebuild b/sys-fs/aufs4/aufs4-0_pre20170612.ebuild
new file mode 100644
index 000000000000..551496bccb00
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20170612.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo-r1 toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=10
+# highest supported version
+KERN_MAX_VER=11
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" \
+ && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is
+ # possible w/out a kernel unpacked on the system
+ [[ -n "$PKG_SETUP_HAS_BEEN_RAN" ]] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "1" ]] && [[ "${KV_PATCH}" -ge "13" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".13+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null || die
+ unpack ${A}
+
+ cd ${PN}-standalone || die
+
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+
+ combinediff \
+ ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff \
+ "${T}"/combined-1.patch ${PN}-mmap.patch \
+ > ${PN}-standalone-base-mmap-combined.patch
+
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch \
+ --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} \
+ < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch \
+ > /dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || \
+ die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ use pax_kernel && epatch "${FILESDIR}"/pax-4.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+
+ eapply_user
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ use doc && dodoc -r Documentation
+
+ use kernel-patch || \
+ doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc \
+ Documentation/filesystems/aufs/README \
+ "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/files/README.gentoo b/sys-fs/aufs4/files/README.gentoo
new file mode 100644
index 000000000000..64dfe94b4bda
--- /dev/null
+++ b/sys-fs/aufs4/files/README.gentoo
@@ -0,0 +1,20 @@
+There several other patches in aufs3. They are all
+optional. When you meet some problems, they will help you. You can find them
+in the documentation directory.
+
+ - aufs3-loopback.patch
+ Supports a nested loopback mount in a branch-fs. This patch is
+ unnecessary until aufs produces a message such like "you may want to try
+ another patch for loopback file".
+
+ - vfs-ino.patch
+ Modifies a system global kernel internal function get_next_ino() in
+ order to stop assigning 0 for an inode-number. Not directly related to
+ aufs, but recommended generally.
+
+ - tmpfs-idr.patch
+ Keeps the tmpfs inode number as the lowest value. Effective to reduce
+ the size of aufs XINO files for tmpfs branch. Also it prevents the
+ duplication of inode number, which is important for backup
+ tools, aubrsync or other utilities. When you find aufs XINO files for
+ tmpfs branch growing too much, try this patch.
diff --git a/sys-fs/aufs4/files/pax-4.patch b/sys-fs/aufs4/files/pax-4.patch
new file mode 100644
index 000000000000..cf216a5708ca
--- /dev/null
+++ b/sys-fs/aufs4/files/pax-4.patch
@@ -0,0 +1,89 @@
+--- a/fs/aufs/dynop.c 2012-10-09 15:41:32.652989534 -0400
++++ b/fs/aufs/dynop.c 2012-10-09 15:41:58.562989820 -0400
+@@ -149,9 +149,11 @@
+ #define DySet(func, dst, src, h_op, h_sb) do { \
+ DyDbgInc(cnt); \
+ if (h_op->func) { \
+- if (src.func) \
+- dst.func = src.func; \
+- else \
++ if (src.func) { \
++ pax_open_kernel(); \
++ *(void **)&dst.func = src.func; \
++ pax_close_kernel(); \
++ } else \
+ AuDbg("%s %s\n", au_sbtype(h_sb), #func); \
+ } \
+ } while (0)
+@@ -159,7 +161,9 @@
+ #define DySetForce(func, dst, src) do { \
+ AuDebugOn(!src.func); \
+ DyDbgInc(cnt); \
+- dst.func = src.func; \
++ pax_open_kernel(); \
++ *(void **)&dst.func = src.func; \
++ pax_close_kernel(); \
+ } while (0)
+
+ #define DySetAop(func) \
+@@ -266,15 +270,17 @@
+ */
+ static void dy_adx(struct au_dyaop *dyaop, int do_dx)
+ {
++ pax_open_kernel();
+ if (!do_dx) {
+- dyaop->da_op.direct_IO = NULL;
+- dyaop->da_op.get_xip_mem = NULL;
++ *(void **)&dyaop->da_op.direct_IO = NULL;
++ *(void **)&dyaop->da_op.get_xip_mem = NULL;
+ } else {
+- dyaop->da_op.direct_IO = aufs_aop.direct_IO;
+- dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem;
++ *(void **)&dyaop->da_op.direct_IO = aufs_aop.direct_IO;
++ *(void **)&dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem;
+ if (!dyaop->da_get_xip_mem)
+- dyaop->da_op.get_xip_mem = NULL;
++ *(void **)&dyaop->da_op.get_xip_mem = NULL;
+ }
++ pax_close_kernel();
+ }
+
+ static struct au_dyaop *dy_aget(struct au_branch *br,
+--- a/fs/aufs/f_op_sp.c 2012-10-09 15:41:32.652989534 -0400
++++ b/fs/aufs/f_op_sp.c 2012-10-09 15:41:58.562989820 -0400
+@@ -104,7 +104,7 @@
+ static int aufs_open_sp(struct inode *inode, struct file *file);
+ static struct au_sp_fop {
+ int done;
+- struct file_operations fop; /* not 'const' */
++ file_operations_no_const fop; /* not 'const' */
+ spinlock_t spin;
+ } au_sp_fop[AuSp_Last] = {
+ [AuSp_FIFO] = {
+@@ -157,8 +157,10 @@
+ h_file = au_hf_top(file);
+ spin_lock(&p->spin);
+ if (!p->done) {
+- p->fop = *h_file->f_op;
++ pax_open_kernel();
++ memcpy((void *)&p->fop, h_file->f_op, sizeof(p->fop));
+ p->fop.owner = THIS_MODULE;
++ pax_close_kernel();
+ if (p->fop.aio_read)
+ p->fop.aio_read = aufs_aio_read_sp;
+ if (p->fop.aio_write)
+--- a/fs/aufs/sysfs.c 2013-10-20 17:08:37.000000000 -0400
++++ b/fs/aufs/sysfs.c 2013-10-19 17:08:29.000000000 -0400
+@@ -233,8 +233,10 @@
+ for (i = 0; i < ARRAY_SIZE(br->br_sysfs); i++) {
+ attr = &br_sysfs->attr;
+ sysfs_attr_init(attr);
+- attr->name = br_sysfs->name;
+- attr->mode = S_IRUGO;
++ pax_open_kernel();
++ *(void **)&attr->name = br_sysfs->name;
++ *(void **)&attr->mode = S_IRUGO;
++ pax_close_kernel();
+ br_sysfs++;
+ }
+ }
diff --git a/sys-fs/aufs4/metadata.xml b/sys-fs/aufs4/metadata.xml
new file mode 100644
index 000000000000..f0e5c642768d
--- /dev/null
+++ b/sys-fs/aufs4/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="debug">Enable additional debugging support</flag>
+ <flag name="hfs">Enable hfs support</flag>
+ <flag name="fuse">Enable fuse support</flag>
+ <flag name="inotify">Enable inotify support</flag>
+ <flag name="kernel-patch">Patch the current kernel for aufs3 support</flag>
+ <flag name="nfs">Enable support for nfs export</flag>
+ <flag name="pax_kernel">Apply patch needed for pax enabled kernels</flag>
+ <flag name="ramfs">Enable initramfs/rootfs support</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">aufs</remote-id>
+ </upstream>
+</pkgmetadata>