summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2015-10-13 11:19:44 +0200
committerroot2015-10-13 11:19:44 +0200
commiteb82da3aa912ae66487ec4aa58e4c68dbf31215c (patch)
treee5bc818dac289b5d095d3876414b0127141be87c
parent[rfs-stage31] Include intel/i915 firmware (diff)
downloadtm-scripts-eb82da3aa912ae66487ec4aa58e4c68dbf31215c.tar.gz
tm-scripts-eb82da3aa912ae66487ec4aa58e4c68dbf31215c.tar.xz
tm-scripts-eb82da3aa912ae66487ec4aa58e4c68dbf31215c.zip
[kernel-vanilla] Support kernel 4.x, cleanup
-rw-r--r--remote/modules/kernel-vanilla/module.build44
-rw-r--r--remote/modules/kernel-vanilla/module.conf2
2 files changed, 32 insertions, 14 deletions
diff --git a/remote/modules/kernel-vanilla/module.build b/remote/modules/kernel-vanilla/module.build
index f1dc10bd..63b3c5a6 100644
--- a/remote/modules/kernel-vanilla/module.build
+++ b/remote/modules/kernel-vanilla/module.build
@@ -23,8 +23,15 @@ get_kernel_version() {
fetch_source() {
pdebug "getting kernel sources via git ...."
- [ -d ./ksrc ] && rm -rf ./ksrc
- git clone --depth 1 "${REQUIRED_GIT}" -b "v${REQUIRED_KERNEL}" ksrc || perror "Could not clone kernel git."
+ if grep -q -- "${REQUIRED_GIT}" "./ksrc/.git/config" && grep -q -- "v${REQUIRED_KERNEL}" "./ksrc/.git/config"; then
+ pinfo "Trying to update existing clone"
+ cd ksrc || perror "Could not cd to ksrc"
+ git pull || perror "Could not pull already checked out repo"
+ cd ..
+ else
+ rm -rf "./ksrc"
+ git clone --depth 1 "${REQUIRED_GIT}" -b "v${REQUIRED_KERNEL}" ksrc || perror "Could not clone kernel git."
+ fi
# check for aufs
local RSL=$(find ksrc/ -type d -name aufs)
if [ -z "$RSL" ]; then
@@ -113,16 +120,22 @@ update_config() {
# helper to patch aufs
patch_aufs() {
- pinfo "Cloning aufs3 standalone git"
+ local KERNEL_MAJOR=${REQUIRED_KERNEL%%.*}
+ local AUFS="aufs${KERNEL_MAJOR}"
+ pinfo "Cloning ${AUFS} standalone git"
cd "$MODULE_DIR"
- [ -d "aufs3-standalone/.git" ] && rm -rf "aufs3-standalone" # if already there, kill it.
+ [ -d "${AUFS}-standalone/.git" ] && rm -rf "${AUFS}-standalone" # if already there, kill it.
# git: --depth 1 won't work here due to later "checkout origin/branch"
- git clone "git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git" || perror "Cloning aufs3 failed."
+ if [ "$KERNEL_MAJOR" = "3" ]; then
+ git clone "git://aufs.git.sourceforge.net/gitroot/aufs/${AUFS}-standalone.git" || perror "Cloning ${AUFS} failed."
+ else
+ git clone "git://github.com/sfjro/${AUFS}-standalone.git" || perror "Cloning ${AUFS} failed."
+ fi
# get the needed version
[ -n "${SYSTEM_KERNEL_LONG}" ] && local NEEDED_BRANCH=$(echo $REQUIRED_KERNEL | awk -F "." '{print $1"."$2}') \
|| perror "REQUIRED_KERNEL not set, this should not happen!"
pinfo "Getting branch origin/$NEEDED_BRANCH"
- cd "$MODULE_DIR/aufs3-standalone" || perror "Could not CD to aufs3-standalone"
+ cd "$MODULE_DIR/${AUFS}-standalone" || perror "Could not CD to ${AUFS}-standalone"
git checkout "origin/aufs$NEEDED_BRANCH" || perror "Could not checkout needed branch."
pinfo "Starting to patch... $NEEDED_BRANCH"
tarcopy "Documentation fs" "$MODULE_DIR/ksrc"
@@ -133,13 +146,18 @@ patch_aufs() {
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!"
-
- # this following 'if' is a burning shame - caused as patching under eg. openSuse 13.1 is always unsuccessful due to hunk failing
- if [ -f "$MODULE_DIR/aufs3-standalone/aufs3-mmap.patch" ]; then
- patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-mmap.patch" || pwarning "Problem patching aufs3-mmap.patch: hunks failed?"
- fi
+ local PATCH
+ # Mandatory
+ for PATCH in "${AUFS}-kbuild" "${AUFS}-base" "${AUFS}-mmap"; do
+ patch -p1 < "$MODULE_DIR/${AUFS}-standalone/${PATCH}.patch" || perror "${PATCH}.patch failed!"
+ pinfo "Applied '$MODULE_DIR/${AUFS}-standalone/${PATCH}.patch'"
+ done
+ # Optional - should we error too?
+ for PATCH in "${AUFS}-loopback" "tmpfs-idr" "vfs-ino"; do
+ [ -e "$MODULE_DIR/${AUFS}-standalone/${PATCH}.patch" ] || continue
+ patch -p1 < "$MODULE_DIR/${AUFS}-standalone/${PATCH}.patch" || pwarning "${PATCH}.patch failed!"
+ pinfo "Applied '$MODULE_DIR/${AUFS}-standalone/${PATCH}.patch'"
+ done
pinfo "Patched kernel source with aufs-${NEEDED_BRANCH}"
cd "$MODULE_DIR"
}
diff --git a/remote/modules/kernel-vanilla/module.conf b/remote/modules/kernel-vanilla/module.conf
index 9eef1e85..68a0034b 100644
--- a/remote/modules/kernel-vanilla/module.conf
+++ b/remote/modules/kernel-vanilla/module.conf
@@ -1,5 +1,5 @@
REQUIRED_BINARIES=""
REQUIRED_LIBRARIES=""
REQUIRED_DIRECTORIES=""
-REQUIRED_KERNEL="3.14.3"
+REQUIRED_KERNEL="4.2.3"
REQUIRED_GIT="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git"