From f8728dae20b9b923c8f0dff726b5b94806b91c65 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 3 Jun 2013 17:33:54 +0200 Subject: [kernel] Fix aufs3 patching --- remote/modules/kernel/kernel.build | 34 +++++++++++++++++++++++++--------- remote/modules/kernel/kernel.conf | 1 + 2 files changed, 26 insertions(+), 9 deletions(-) (limited to 'remote') 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" } + diff --git a/remote/modules/kernel/kernel.conf b/remote/modules/kernel/kernel.conf index 0cd03752..cb7ce13a 100644 --- a/remote/modules/kernel/kernel.conf +++ b/remote/modules/kernel/kernel.conf @@ -1,3 +1,4 @@ REQUIRED_BINARIES="" REQUIRED_LIBRARIES="" REQUIRED_DIRECTORIES="" +REQUIRED_INSTALLED_PACKAGES="patch" -- cgit v1.2.3-55-g7522