summaryrefslogtreecommitdiffstats
path: root/remote/modules
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules')
-rw-r--r--remote/modules/kernel/kernel.build30
1 files changed, 29 insertions, 1 deletions
diff --git a/remote/modules/kernel/kernel.build b/remote/modules/kernel/kernel.build
index 0248a980..dc789b36 100644
--- a/remote/modules/kernel/kernel.build
+++ b/remote/modules/kernel/kernel.build
@@ -12,10 +12,18 @@ fetch_source() {
local SOURCE_DIR=$(rpm -ql kernel-source |grep -E -o '^/.*src/linux-[^/]+/' |head -1)
[ -z "${SOURCE_DIR}" ] && perror "Could not determine directory of kernel source..."
ln -sf "${SOURCE_DIR}" ksrc
-
else
pdebug "Packet manager not determined!"
fi
+
+ # check for aufs
+ local RSL=$(find ksrc/ -type d -name aufs)
+ if [ -z "$RSL" ]; then
+ pinfo "aufs not found in kernel sources, patching it..."
+ patch_aufs
+ else
+ pinfo "aufs detected in kernel source :)"
+ fi
}
build() {
@@ -79,3 +87,23 @@ update_config() {
fi
done
}
+
+# helper to patch aufs
+patch_aufs() {
+ pinfo "Cloning aufs3 standalone git"
+ git clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git || perror "Cloning aufs3 failed."
+ # get the needed version
+ [ ! -z ${KERNEL_VERSION} ] && local NEEDED_BRANCH=$(echo $KERNEL_VERSION | awk -F "." '{print $1"."$2}') \
+ || perror "KERNEL_VERSION not set, this should not happen!"
+ pinfo "Getting branch origin/$NEEDED_BRANCH"
+ cd aufs3-standalone/
+ git checkout origin/aufs$NEEDED_BRANCH
+ pinfo "Starting to patch..."
+ tar c include/linux/aufs_type.h Documentation fs | tar x -C ../ksrc
+ cd ../ksrc
+ patch -p1 < ../aufs3-standalone/aufs3-kbuild.patch || perror "aufs3-standalone/aufs3-kbuild.patch failed"
+ patch -p1 < ../aufs3-standalone/aufs3-base.patch || perror "aufs3-standalone/aufs3-base.patch failed"
+ patch -p1 < ../aufs3-standalone/aufs3-proc_map.patch || perror "aufs3-standalone/aufs3-proc_map.patch failed"
+ cp ../aufs3-standalone/include/linux/aufs_type.h include/linux/
+ pinfo "Patched kernel source with aufs-${NEEDED_BRANCH}"
+}