summaryrefslogtreecommitdiff
path: root/sys-fs/aufs3
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/aufs3
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-fs/aufs3')
-rw-r--r--sys-fs/aufs3/Manifest15
-rw-r--r--sys-fs/aufs3/aufs3-3_p20160219.ebuild184
-rw-r--r--sys-fs/aufs3/aufs3-3_p20160223.ebuild184
-rw-r--r--sys-fs/aufs3/aufs3-3_p20160627.ebuild184
-rw-r--r--sys-fs/aufs3/aufs3-3_p20160815.ebuild184
-rw-r--r--sys-fs/aufs3/aufs3-3_p20160822.ebuild184
-rw-r--r--sys-fs/aufs3/files/README.gentoo20
-rw-r--r--sys-fs/aufs3/files/pax-3.11.patch89
-rw-r--r--sys-fs/aufs3/metadata.xml20
9 files changed, 1064 insertions, 0 deletions
diff --git a/sys-fs/aufs3/Manifest b/sys-fs/aufs3/Manifest
new file mode 100644
index 000000000000..61c23190848c
--- /dev/null
+++ b/sys-fs/aufs3/Manifest
@@ -0,0 +1,15 @@
+AUX README.gentoo 911 SHA256 9b9eb681f692f052105bf3d3d15e689685a5fcfba1d90a88b3351158d4cebd97 SHA512 f22f1e1fae62c7a03230194c05701dc03502b84a52cfc8aacb5fbfab2c1f8bed9d4f3f97d0095578d497b09f818a3a45a04ef8527983e0cbfa9db10baeb1b691 WHIRLPOOL 73c88b3df5e691659e2e2044bda00119e742178868fa74ca7990c3d0204eaca495bc625353c22804c7420db807774941cdddd2e901c2cbceb36aa220ee3d4d95
+AUX pax-3.11.patch 2722 SHA256 133d80384de031c73d989a36b4e88571a5b1084c51366cfec3f5234e7e1ef446 SHA512 dc7e8eba4aa01552ec0d44636db99aa7c3d9af11f1182165ad7da383f9ed4cd92e4b9aef779b3d2bcb62797fd7d673ae35294ee1b9b768320be5bb5a03893de8 WHIRLPOOL e329ea70448d30510b5dc64ba9eca54c969c6781dc75ed326714ad0de90d10f43844e62e840cf1bfaed0ebb166b9f8a3cdef295ff06f5b38b4e5d75857e3fb46
+DIST aufs3-standalone-3_p20160219.tar.xz 3256736 SHA256 23652c6d8fd12a9a29454293f13add7e0f97f2ec542b69e5dfecbc99064c4247 SHA512 af65cb3d9890c05ec24d64d27759d8c0fa98f35887d62a7ec77ebc496ec9de02563bc5a3e05b67c342926b062fe077c7a8de543291177a4e0210b2159027e1af WHIRLPOOL 1ed7042c9e1e8efc29fa36fcbd2f09a10ffa51cc9d6b349869f6f6947ed27399deb2fa1035df7dbaf69dcbfa7eddb6f240b934a343732ace26f77bcf2e72167a
+DIST aufs3-standalone-3_p20160223.tar.xz 3270932 SHA256 4e213e678991a028595893a2c3425894bef021cd374a6798f80ad8863bf7f593 SHA512 37805b54a2471def5948d3484349de7bfc4fee09788b36b9589aba2006484cf330bb642f27862d74a528999cf2e7fa4888b5d46b54bb3e7f8468c6857f34730f WHIRLPOOL 1e42d1a32a62b25923041b8f71b00f8ae1a8b8524752b1d796ae2fd2ada79792cbe2a35ad380e24ecad8374bbd432674763d69ffa9144dfc3074742b33d4d138
+DIST aufs3-standalone-3_p20160627.tar.xz 3443904 SHA256 1802aa5232780f2840efc8cdd85b74081632b2f9e83e97de0a89a607887710ee SHA512 6c6256d5f042dbcde26abfb665fdfd8eee4193104fc3270371fdf503a560dd888b5306e3cfe4c6a1f95cd669b41279573dfc54aec8b5b5327220fa055bbbdb3d WHIRLPOOL 88b5768910562c0c9eb28796d1031d85a68123f0ab43427355f2bb8b64a1a409aacc89be9ca77aeffd92b18524827c40826c02ef545c24cffcfe03d94eb913a8
+DIST aufs3-standalone-3_p20160815.tar.xz 3501932 SHA256 83982c675faf4fa0bcd64b1f95de9cbba09e4b90da3294af1e8218214d384df7 SHA512 502a1516e0e9f307a9e29669799f9572b225b38ed7c790130bd9d9c01fcb83d2bf81ca5d27136827b595838e9ee42544d9be130bf632be6a61cdf7e07d0f9676 WHIRLPOOL 6d7df7051f287dc6cc847ef817e28f9401f22b874fcbfa7f4fccaf0e8d9dfe8bc7ac3834c1494ffe3da473e6bf36abee8cfd1eeeaed4d13c03fe18318470586a
+DIST aufs3-standalone-3_p20160822.tar.xz 3515768 SHA256 77d79912c66913e584a746b1f1aea8708eb8190522d2473e13582251a6e33a69 SHA512 b3f6dc4883f565f73a81ff3aaf90bdca41419fe506c16b027e471e9901dce83a1e4d7a217574b686389433e2d7b280a53c0dbe805fad709f83cd5a689a53cc13 WHIRLPOOL 92a39bdf00ef7cc6f854e0823f784b0577709d84b07f8db1457be5f75bf0c102626ff62d38f57658253bf619b71f45070904275b1987ed9dd53c17ff25d3439c
+EBUILD aufs3-3_p20160219.ebuild 5163 SHA256 f872ca4e5571507d9bb8ce200a4d36acd11f108a309cbd1d582c5d286199c95a SHA512 67991d3aa05dfc4589d86022c9f088f05d8ce9b802e9eba9bf7433e98462a6ca5f2811080e28341383f2fddc3f35fdcef64c8899060d42b5e1c215afa4ba3151 WHIRLPOOL a1cda0eded9f8ca19dce1a13260c8df5d6bb891e7e1a517837920d4c6d2d957f739ac0305d7436c517b0d11a3a4b3a0e7b11f87575ab4bfb72a86916ab20d3f5
+EBUILD aufs3-3_p20160223.ebuild 5165 SHA256 ece18267c5a3d9d434f6c55aaebb46ab1bb96e28ec7bb4843e6fbdc2a89235a9 SHA512 fa351d2b7b80bc8ea214e709fabaff8c04afca77133207cf0f991268c5f23482d622d5d61a6246486bece5deec5d70656d4db330736fab7dceb35c7af391e216 WHIRLPOOL 6ab88608982d2af766e9ae6df383a819ff489dd1738c5b54c670b9533464d6e41e455ac7be4b5d9ca9d04ffae37c9847d3d0371ca5f076a5a8200305a73209cd
+EBUILD aufs3-3_p20160627.ebuild 5165 SHA256 ece18267c5a3d9d434f6c55aaebb46ab1bb96e28ec7bb4843e6fbdc2a89235a9 SHA512 fa351d2b7b80bc8ea214e709fabaff8c04afca77133207cf0f991268c5f23482d622d5d61a6246486bece5deec5d70656d4db330736fab7dceb35c7af391e216 WHIRLPOOL 6ab88608982d2af766e9ae6df383a819ff489dd1738c5b54c670b9533464d6e41e455ac7be4b5d9ca9d04ffae37c9847d3d0371ca5f076a5a8200305a73209cd
+EBUILD aufs3-3_p20160815.ebuild 5165 SHA256 ece18267c5a3d9d434f6c55aaebb46ab1bb96e28ec7bb4843e6fbdc2a89235a9 SHA512 fa351d2b7b80bc8ea214e709fabaff8c04afca77133207cf0f991268c5f23482d622d5d61a6246486bece5deec5d70656d4db330736fab7dceb35c7af391e216 WHIRLPOOL 6ab88608982d2af766e9ae6df383a819ff489dd1738c5b54c670b9533464d6e41e455ac7be4b5d9ca9d04ffae37c9847d3d0371ca5f076a5a8200305a73209cd
+EBUILD aufs3-3_p20160822.ebuild 5165 SHA256 ece18267c5a3d9d434f6c55aaebb46ab1bb96e28ec7bb4843e6fbdc2a89235a9 SHA512 fa351d2b7b80bc8ea214e709fabaff8c04afca77133207cf0f991268c5f23482d622d5d61a6246486bece5deec5d70656d4db330736fab7dceb35c7af391e216 WHIRLPOOL 6ab88608982d2af766e9ae6df383a819ff489dd1738c5b54c670b9533464d6e41e455ac7be4b5d9ca9d04ffae37c9847d3d0371ca5f076a5a8200305a73209cd
+MISC ChangeLog 7593 SHA256 adf826b51edf593c4877059a5bc244368a16a5941787ea2e6b73d20d33784a0e SHA512 f4846c27c31518bf75929ef75d54104282b386788c57c1cb46fc5313cc73bc9ae0e5d7b7914e573bbe2f1e4d91a28fc82b47434a229ad914add894ec68497572 WHIRLPOOL 38cefa160333b6b99f219ae1df920a7bf8bf6f95c2ef763c071b23e8678a8a5d3e3d46c8348a5db53916f9f261dda42a41d64410703106d2ae7297183329b23f
+MISC ChangeLog-2015 30608 SHA256 082107edc4a662f0042556d0d2d5f49021deef459c860a38803deab9a3813bf1 SHA512 6d04021cb63434fb76b0bae294eb36c842f0a8d2685369623d798aec8c6a47238a1f6651979d6dbcc88b7496dfc86c35fe8a0a707ea6a0491654d1331819a393 WHIRLPOOL d4e004f260989f034f04aa6a12911e599b1a745d545b40a94064e4929d86e1bbd6b6fc99800707d32b929ba744ba77b375395abda3dbc1581750586e864216b5
+MISC metadata.xml 809 SHA256 36364d972f838e36cbf1cb5b5857077cac43ba9a05ae57be7aa9050af93b1e25 SHA512 043c012f55866721363c82fd80007c4ed8420fd8eec95459aac9fb913d855a0be5f135035ba5e3fcab668641ca61897d71ea8e48c1d45f171d418c812620d576 WHIRLPOOL 4ce31dd2931da5af1ae06aa0cce080196e9500ee7cf1760c93e0fa8445a84a6ea10a76b40ac0027b75e73f9507f5a7966636f1bf619e04d04fd31956bdd484ee
diff --git a/sys-fs/aufs3/aufs3-3_p20160219.ebuild b/sys-fs/aufs3/aufs3-3_p20160219.ebuild
new file mode 100644
index 000000000000..8c40ec61abbe
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20160219.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=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=18
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs3-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/aufs4"
+
+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 3 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${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}" == "18" ]] && [[ "${KV_PATCH}" -ge "25" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".25+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 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-3.11.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+}
+
+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/{aufs3-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/aufs3/aufs3-3_p20160223.ebuild b/sys-fs/aufs3/aufs3-3_p20160223.ebuild
new file mode 100644
index 000000000000..2a786f02ab2c
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20160223.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=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=18
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs3-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/aufs4"
+
+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 3 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${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}" == "18" ]] && [[ "${KV_PATCH}" -ge "25" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".25+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 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-3.11.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+}
+
+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/{aufs3-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/aufs3/aufs3-3_p20160627.ebuild b/sys-fs/aufs3/aufs3-3_p20160627.ebuild
new file mode 100644
index 000000000000..2a786f02ab2c
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20160627.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=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=18
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs3-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/aufs4"
+
+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 3 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${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}" == "18" ]] && [[ "${KV_PATCH}" -ge "25" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".25+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 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-3.11.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+}
+
+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/{aufs3-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/aufs3/aufs3-3_p20160815.ebuild b/sys-fs/aufs3/aufs3-3_p20160815.ebuild
new file mode 100644
index 000000000000..2a786f02ab2c
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20160815.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=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=18
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs3-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/aufs4"
+
+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 3 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${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}" == "18" ]] && [[ "${KV_PATCH}" -ge "25" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".25+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 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-3.11.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+}
+
+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/{aufs3-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/aufs3/aufs3-3_p20160822.ebuild b/sys-fs/aufs3/aufs3-3_p20160822.ebuild
new file mode 100644
index 000000000000..2a786f02ab2c
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20160822.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=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=18
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs3-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/aufs4"
+
+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 3 ${KERN_MIN_VER} 0 && \
+ die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${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}" == "18" ]] && [[ "${KV_PATCH}" -ge "25" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".25+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 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-3.11.patch
+
+ sed \
+ -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
+ -i Makefile || die
+}
+
+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/{aufs3-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/aufs3/files/README.gentoo b/sys-fs/aufs3/files/README.gentoo
new file mode 100644
index 000000000000..64dfe94b4bda
--- /dev/null
+++ b/sys-fs/aufs3/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/aufs3/files/pax-3.11.patch b/sys-fs/aufs3/files/pax-3.11.patch
new file mode 100644
index 000000000000..cf216a5708ca
--- /dev/null
+++ b/sys-fs/aufs3/files/pax-3.11.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/aufs3/metadata.xml b/sys-fs/aufs3/metadata.xml
new file mode 100644
index 000000000000..f0e5c642768d
--- /dev/null
+++ b/sys-fs/aufs3/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>