Merge branch 'opendreambox-1.6' into vuplus-1.6
[vuplus_openembedded] / recipes / aufs / aufs_cvs.bb
1 DESCRIPTION = "Aufs is a stackable unification filesystem such as Unionfs, which unifies several directories and provides a merged single directory."
2 HOMEPAGE = "http://aufs.sourceforge.net/"
3 LICENSE = "GPL"
4 PV = "cvs${SRCDATE}"
5
6 RSUGGESTS_${PN} = "${PN}-tools"
7
8 inherit module
9
10 S = "${WORKDIR}/aufs"
11
12 SRC_URI = "cvs://anonymous@aufs.cvs.sourceforge.net/cvsroot/aufs;module=aufs;date=${SRCDATE}"
13
14 TARGET_CC_ARCH += "${LDFLAGS}"
15
16 EXTRA_OEMAKE = "KDIR=${STAGING_KERNEL_DIR} -f local.mk"
17
18 # We need to check the architecture and the kernel version to
19 # configure properly lokal.mk. We ignore the export CONFIG_AUFS_STAT option.
20 # If you want to have CONFIG_AUFS_STAT enabled you have to add some other ARCH checks.
21 # Debian does not enable CONFIG_AUFS_STAT for arm.
22 # We disable CONFIG_AUFS_SYSAUFS for arm because arm does not know about cmpxchg.
23 # If you want this feature enabled you have to define it.
24 # I suggest you to read http://osdir.com/ml/linux.kernel.tracing/2006-12/msg00020.html
25
26 do_configure() {
27         K_VERSION=$(echo ${KERNEL_VERSION} | awk 'BEGIN{FS="."}{print $3}')
28         cd ${S}
29         if [ $K_VERSION -ge 24 ] ; then 
30                 sed -i 's/CONFIG_AUFS_FAKE_DM\ =\ y/CONFIG_AUFS_FAKE_DM\ =/g'  local.mk
31         fi
32         if [ $K_VERSION -eq 25 ] || [ $ARCH = "arm" ] ; then
33                 sed -i 's/CONFIG_AUFS_SYSAUFS\ =\ y/CONFIG_AUFS_SYSAUFS\ =/g'  local.mk 
34         fi
35 }
36
37 do_compile_prepend() {
38 #compile binaries for host      
39         cd ${S}/util
40         BRANCH_MAX=$(fgrep CONFIG_AUFS_BRANCH_MAX ../local.mk | grep y | cut -d " " -f 2)
41         ${BUILD_CC} -D ${BRANCH_MAX} c2tmac.c ../include/linux/aufs_type.h -o c2tmac
42         ${BUILD_CC} -D ${BRANCH_MAX} c2sh.c ../include/linux/aufs_type.h -o c2sh
43         cd ${S}
44 }
45
46 do_compile(){
47         LDFLAGS=""
48         oe_runmake 
49 }
50
51 do_install() {
52         install -d ${D}/${sbindir}
53         install -m 0500 mount.aufs umount.aufs auplink aulchown ${D}/${sbindir}
54         install -d ${D}/etc/default     
55         echo FLUSH=ALL > ${D}/etc/default/auplink
56         install -d ${D}/${base_libdir}/modules/${KERNEL_VERSION}/drivers/extra/ 
57         install -m 0644 aufs.ko ${D}/${base_libdir}/modules/${KERNEL_VERSION}/drivers/extra/
58 }
59
60 FILES_${PN} = "/lib/modules"
61 PACKAGES += "${PN}-tools"
62 PACKAGE_ARCH = "${MACHINE_ARCH}"
63 FILES_${PN}-tools = "${sbindir} /etc/default/auplink"