From 3df876cfeb86df659de2326d900accf0d689861e Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Thu, 12 Nov 2009 09:50:31 +0000 Subject: [PATCH] aufs2: Add recipe (to be cleaned up) to build AUFS2 as modules on a 2.6.27 kernel. * 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 | 50 ++++++++++++++++++++++++++++++++++++ recipes/aufs/files/rc.aufs2 | 40 +++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 recipes/aufs/aufs2-27_git.bb create mode 100644 recipes/aufs/files/rc.aufs2 diff --git a/recipes/aufs/aufs2-27_git.bb b/recipes/aufs/aufs2-27_git.bb new file mode 100644 index 0000000000..ca858edc6e --- /dev/null +++ b/recipes/aufs/aufs2-27_git.bb @@ -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 index 0000000000..79bfa917bd --- /dev/null +++ b/recipes/aufs/files/rc.aufs2 @@ -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 -- 2.39.5