aufs2: Add recipe (to be cleaned up) to build AUFS2 as modules on a 2.6.27 kernel.
authorDavid-John Willis <John.Willis@Distant-earth.com>
Thu, 12 Nov 2009 09:50:31 +0000 (09:50 +0000)
committerDavid-John Willis <John.Willis@Distant-earth.com>
Mon, 4 Apr 2011 19:15:28 +0000 (20:15 +0100)
* This REALLY needs to be tweaked to pull out the kernel version used and build a suitable package for that kernel version with a generic 'meta' package that will pull in the right one. Not sure how that will work best.

recipes/aufs/aufs2-27_git.bb [new file with mode: 0644]
recipes/aufs/files/rc.aufs2 [new file with mode: 0644]

diff --git a/recipes/aufs/aufs2-27_git.bb b/recipes/aufs/aufs2-27_git.bb
new file mode 100644 (file)
index 0000000..ca858ed
--- /dev/null
@@ -0,0 +1,50 @@
+# Note: This recipe is a bit of a hack (READ: Massive hack) for now as it needs kernel 
+# patches in the source tree in order to build. Without those patches it will fail.
+
+DESCRIPTION = "Aufs2 is a stackable unification filesystem."
+LICENSE = "GPL"
+DEPENDS = "virtual/kernel"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+RSUGGESTS_${PN} = "aufs2-util"
+
+inherit module
+
+SRCREV = "3dee4b597c9c8d02157603f9018e22a5fa898621"
+
+SRC_URI = " \
+           git://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git;protocol=http;branch=aufs2-27 \
+          file://rc.aufs2 \
+"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "aufs2-init"
+INITSCRIPT_PARAMS = "start 30 5 2 . stop 40 0 1 6 ."
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "CONFIG_AUFS_FS=m  KDIR=${STAGING_KERNEL_DIR} DESTDIR=${D}"
+
+# Enable inotify support.
+do_compile_prepend() {
+          sed -i  "s:HINOTIFY =:HINOTIFY = y:g" ${S}/config.mk
+}
+
+do_install() {
+          mkdir -p ${D}/lib/modules/${KERNEL_VERSION}/misc
+          cp ${S}/*.ko ${D}/lib/modules/${KERNEL_VERSION}/misc
+          install -d ${D}${sysconfdir}/init.d/
+          cp -pP ${WORKDIR}/rc.aufs2 ${D}${sysconfdir}/init.d/aufs2-init
+}
+
+# This is really crufty but I don't want to change the aufs2-utils recipe as I know it's used by the Touchbook. - DJWillis
+# The reason for this is so the userspace ABI is there when the utils are built later 
+#   (if you build 'in tree' you will have this but this recipe builds as a module)
+
+do_stage() {
+          install -d ${STAGING_KERNEL_DIR}/include/linux/
+          install -m 0644 ${S}/include/linux/aufs_type.h ${STAGING_KERNEL_DIR}/include/linux/
+}
+
+FILES_${PN} += "/lib/modules/${KERNEL_VERSION}/misc/*.ko.*"
diff --git a/recipes/aufs/files/rc.aufs2 b/recipes/aufs/files/rc.aufs2
new file mode 100644 (file)
index 0000000..79bfa91
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+DESC="AUFS2 union file system module."
+NAME="aufs2"
+
+d_stop() {
+       if `grep -q aufs /proc/modules` ; then
+               rmmod aufs
+       fi
+}
+
+d_start() {
+       insmod $(busybox find /lib/modules/$(uname -r) -name "aufs.ko")
+}
+
+case "$1" in
+  start)
+       echo -n "Starting $DESC: $NAME"
+       d_start
+       echo "."
+       ;;
+  stop)
+       echo -n "Stopping $DESC: $NAME"
+       d_stop
+       echo "."
+       ;;
+  restart|force-reload)
+       echo -n "Restarting $DESC: $NAME"
+       d_stop
+       sleep 1
+       d_start
+       echo "."
+       ;;
+  *)
+       echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+       exit 1
+       ;;
+esac
+
+exit 0