diff options
author | Justin Lecher <jlec@gentoo.org> | 2013-05-01 11:30:27 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2013-05-01 11:30:27 +0000 |
commit | 1e7bea43ce0ef61701a6ff4f89105d0d3e99b416 (patch) | |
tree | cc1c6645479bf020303dae6ecfd157da53dd8751 /sys-fs/aufs3 | |
parent | Stable for sh, wrt bug #443518 (diff) | |
download | gentoo-2-1e7bea43ce0ef61701a6ff4f89105d0d3e99b416.tar.gz gentoo-2-1e7bea43ce0ef61701a6ff4f89105d0d3e99b416.tar.bz2 gentoo-2-1e7bea43ce0ef61701a6ff4f89105d0d3e99b416.zip |
sys-fs/aufs3: Version Bump, take latest pax patch from pentoo, thanks Zero_Chaos for it
(Portage version: 2.2.0_alpha173/cvs/Linux x86_64, signed Manifest commit with key 8009D6F070EB7916)
Diffstat (limited to 'sys-fs/aufs3')
-rw-r--r-- | sys-fs/aufs3/ChangeLog | 8 | ||||
-rw-r--r-- | sys-fs/aufs3/aufs3-3_p20130429.ebuild | 137 | ||||
-rw-r--r-- | sys-fs/aufs3/files/pax-3.patch | 90 |
3 files changed, 234 insertions, 1 deletions
diff --git a/sys-fs/aufs3/ChangeLog b/sys-fs/aufs3/ChangeLog index ec58e30cea9e..2244c370018c 100644 --- a/sys-fs/aufs3/ChangeLog +++ b/sys-fs/aufs3/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-fs/aufs3 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/aufs3/ChangeLog,v 1.56 2013/04/27 10:03:28 jlec Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/aufs3/ChangeLog,v 1.57 2013/05/01 11:30:27 jlec Exp $ + +*aufs3-3_p20130429 (01 May 2013) + + 01 May 2013; Justin Lecher <jlec@gentoo.org> +aufs3-3_p20130429.ebuild, + +files/pax-3.patch: + Version Bump, take latest pax patch from pentoo, thanks Zero_Chaos for it *aufs3-3_p20130422 (27 Apr 2013) diff --git a/sys-fs/aufs3/aufs3-3_p20130429.ebuild b/sys-fs/aufs3/aufs3-3_p20130429.ebuild new file mode 100644 index 000000000000..fdb38b58c7fc --- /dev/null +++ b/sys-fs/aufs3/aufs3-3_p20130429.ebuild @@ -0,0 +1,137 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/aufs3/aufs3-3_p20130429.ebuild,v 1.1 2013/05/01 11:30:27 jlec Exp $ + +EAPI=5 + +inherit eutils flag-o-matic linux-info linux-mod multilib toolchain-funcs + +AUFS_VERSION="${PV%%_p*}" +# highest branch version +PATCH_MAX_VER=8 +# highest supported version +KERN_MAX_VER=9 + +DESCRIPTION="An entirely re-designed and re-implemented Unionfs" +HOMEPAGE="http://aufs.sourceforge.net/" +SRC_URI="http://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" + +S="${WORKDIR}"/${PN}-standalone + +MODULE_NAMES="aufs(misc:${S})" + +pkg_setup() { + CONFIG_CHECK+=" ~EXPERIMENTAL !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 0 0 && die "kernel too old, Please use sys-fs/aufs2" + 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" + else + PATCH_BRANCH="${KV_MINOR}" + fi + + pushd "${T}" &> /dev/null + unpack ${A} + cd ${PN}-standalone || die + local module_branch=origin/${PN}.${PATCH_BRANCH} + git checkout -q -b local-gentoo ${module_branch} || die + combinediff ${PN}-base.patch ${PN}-standalone.patch > ${PN}-standalone-base-combined.patch + if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-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-combined.patch >/dev/null + epatch "${T}"/${PN}-standalone/${PN}-standalone-base-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 ${EPRFIX}/usr/share/doc/${PF}/${PN}-standalone-base-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.patch + + sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" 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 + + insinto /usr/share/doc/${PF} + + use doc && doins -r Documentation + + use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-combined.patch + + dodoc Documentation/filesystems/aufs/README +} diff --git a/sys-fs/aufs3/files/pax-3.patch b/sys-fs/aufs3/files/pax-3.patch new file mode 100644 index 000000000000..584fa6ace5b5 --- /dev/null +++ b/sys-fs/aufs3/files/pax-3.patch @@ -0,0 +1,90 @@ +--- 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) +diff -Naur linux-3.8.3-pentoo/fs/aufs/sysfs.c linux-3.8.3-pentoo-aufsfix/fs/aufs/sysfs.c +--- linux-3.8.3-pentoo/fs/aufs/sysfs.c 2013-04-29 00:07:50.478827567 -0400 ++++ linux-3.8.3-pentoo-aufsfix/fs/aufs/sysfs.c 2013-04-28 23:46:23.724793109 -0400 +@@ -208,8 +208,10 @@ + struct attribute *attr = &br->br_attr; + + sysfs_attr_init(attr); +- attr->name = br->br_name; +- attr->mode = S_IRUGO; ++ pax_open_kernel(); ++ *(void **)&attr->name = br->br_name; ++ *(void **)&attr->mode = S_IRUGO; ++ pax_close_kernel(); + } + + void sysaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex) |