1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit eutils linux-mod
7 DESCRIPTION="An entirely re-designed and re-implemented Unionfs."
8 HOMEPAGE="http://aufs.sourceforge.net/"
9 SRC_URI="http://dev.gentooexperimental.org/~tommy/${P}.tar.bz2
10 http://dev.gentoo.org/~tommy/distfiles/${P}.tar.bz2"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="debug fuse hinotify nfsexport robr"
19 MODULE_NAMES="aufs(misc:${S})"
22 # kernel version check
23 if kernel_is lt 2 6 16 ; then
24 eerror "${PN} is being developed and tested on linux-2.6.16 and later."
25 eerror "Make sure you have a proper kernel version!"
26 die "Wrong kernel version"
29 if kernel_is ge 2 6 24 && linux_chkconfig_present "SECURITY" ; then
30 APPLY_SEC_PERM_PATCH="n"
31 if ! grep -qs "EXPORT_SYMBOL(security_inode_permission);" "${KV_DIR}/security/security.c" ; then
32 APPLY_SEC_PERM_PATCH="y"
35 # make sure the user is allowing this to happen
36 if [[ APPLY_SEC_PERM_PATCH = "y" ]] ; then
37 eerror "${PN} requires that all kernels with CONFIG_SECURITY enabled >= 2.6.24"
38 eerror "be patched. Please enable visit ${HOMEPAGE} and read"
39 eerror "about the sec_perm patch to enable ${PN} support."
40 die "Invalid kernel configuration, we won't compile if CONFIG_SECURITY is enabled"
51 # Enable hinotify in priv_def.mk
52 if use hinotify && kernel_is ge 2 6 18 ; then
53 echo "CONFIG_AUFS_HINOTIFY = y" >> priv_def.mk || die "setting hinotify in priv_def.mk failed!"
56 # Disable SYSAUFS for kernel less than 2.6.18
57 if kernel_is lt 2 6 18 ; then
58 echo "CONFIG_AUFS_SYSAUFS = " >> priv_def.mk || die "unsetting sysaufs in priv_def.mk failed!"
61 # Enable nfsexport in priv_def.mk
62 if use nfsexport && kernel_is ge 2 6 18 ; then
63 echo "CONFIG_AUFS_EXPORT = y" >> priv_def.mk || die "setting export in priv_def.mk failed!"
66 # Enable aufs readonly-branch in priv_def.mk
68 echo "CONFIG_AUFS_ROBR = y" >> priv_def.mk || die "setting robr in priv_def.mk failed!"
71 # Enable FUSE workaround for AUFS
73 echo "CONFIG_AUFS_WORKAROUND_FUSE = y" >> priv_def.mk || die "setting workaround_fuse in priv_def.mk failed!"
76 # Enable / Disable debugging
78 echo "CONFIG_AUFS_DEBUG = y" >> priv_def.mk || die "setting debug in priv_dev.mk failed!"
80 echo "CONFIG_AUFS_DEBUG = " >> priv_def.mk || die "setting debug in priv_dev.mk failed!"
83 # Check if a vserver-kernel is installed
84 if [[ -e ${KV_DIR}/include/linux/vserver ]] ; then
85 einfo "vserver kernel seems to be installed"
86 einfo "using vserver patch"
87 echo "AUFS_DEF_CONFIG = -DVSERVER" >> priv_def.mk || die "setting vserver in priv_def.mk failed!"
93 use amd64 && ARCH=x86_64
94 emake KDIR=${KV_DIR} SUBLEVEL=${KV_PATCH} -f local.mk || die "emake failed"
101 doexe mount.aufs umount.aufs auplink aulchown || die
103 linux-mod_src_install
107 elog "To be able to use aufs, you have to load the kernel module by typing:"
109 elog "For further information refer to the aufs man page"
111 linux-mod_pkg_postinst