diff options
| author | Simon Rettberg | 2013-04-30 18:56:47 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2013-04-30 18:56:47 +0200 |
| commit | 5ac25b4480d48ab1d6026b232feb6942b378e9b1 (patch) | |
| tree | 36fe46e7ab12b3879210944d26c7a90ff454b720 /remote/modules/kernel | |
| parent | suse wants Xreset from kdm (diff) | |
| parent | Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff) | |
| download | tm-scripts-5ac25b4480d48ab1d6026b232feb6942b378e9b1.tar.gz tm-scripts-5ac25b4480d48ab1d6026b232feb6942b378e9b1.tar.xz tm-scripts-5ac25b4480d48ab1d6026b232feb6942b378e9b1.zip | |
Merge branch 'master' of openslx:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/kernel')
| -rw-r--r-- | remote/modules/kernel/kernel.build | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/remote/modules/kernel/kernel.build b/remote/modules/kernel/kernel.build index d950a0fc..e755023e 100644 --- a/remote/modules/kernel/kernel.build +++ b/remote/modules/kernel/kernel.build @@ -14,10 +14,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() { @@ -82,3 +90,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}" +} |
