summaryrefslogtreecommitdiffstats
path: root/remote/modules/kernel/kernel.build
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules/kernel/kernel.build')
-rw-r--r--remote/modules/kernel/kernel.build34
1 files changed, 25 insertions, 9 deletions
diff --git a/remote/modules/kernel/kernel.build b/remote/modules/kernel/kernel.build
index 63b0a336..27e00ac1 100644
--- a/remote/modules/kernel/kernel.build
+++ b/remote/modules/kernel/kernel.build
@@ -107,19 +107,35 @@ update_config() {
# 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."
+ cd "$MODULE_DIR"
+ if [ ! -d "aufs3-standalone/.git" ]; then
+ rm -rf "aufs3-standalone"
+ git clone "git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git" || perror "Cloning aufs3 failed."
+ fi
# 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
+ cd "$MODULE_DIR/aufs3-standalone" || perror "Could not CD to 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 || perror "cd nicht geklappt: ../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/
+ tarcopy "Documentation fs" "$MODULE_DIR/ksrc"
+ local AUFSH
+ if [ ! -e "include/linux/aufs_type.h" ]; then
+ [ ! -e "include/uapi/linux/aufs_type.h" ] && perror "No aufs_type.h in aufs3-git"
+ AUFSH="include/uapi/linux/aufs_type.h"
+ elif [ -e "include/uapi/linux/aufs_type.h" -a "$(stat -c %s "include/uapi/linux/aufs_type.h")" -gt "$(stat -c %s "include/linux/aufs_type.h")" ]; then
+ AUFSH="include/uapi/linux/aufs_type.h"
+ else
+ AUFSH="include/linux/aufs_type.h"
+ fi
+ pinfo "Using $AUFSH"
+ cp "$AUFSH" "$MODULE_DIR/ksrc/include/linux/" || perror "could not copy $AUFSH"
+ cd "$MODULE_DIR/ksrc" || perror "Could not CD to kernel-source dir ksrc"
+ patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-kbuild.patch" || perror "aufs3-standalone/aufs3-kbuild.patch failed"
+ patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-base.patch" || perror "aufs3-standalone/aufs3-base.patch failed"
+ #patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-proc_map.patch" || perror "aufs3-standalone/aufs3-proc_map.patch failed"
pinfo "Patched kernel source with aufs-${NEEDED_BRANCH}"
+ cd "$MODULE_DIR"
}
+