summaryrefslogtreecommitdiffstats
path: root/core/modules/kernel-vanilla
diff options
context:
space:
mode:
authorSimon Rettberg2018-10-19 14:21:28 +0200
committerYour Name2018-10-19 14:21:28 +0200
commit3b99bc4d10c38ed47f82ed10f5e5ead58cc953a3 (patch)
treec6e90fd859eacf2aa7a7dea2b825b7de0de8ebfb /core/modules/kernel-vanilla
parent[kernel-vanilla] Always disable i915 iommu (diff)
downloadmltk-3b99bc4d10c38ed47f82ed10f5e5ead58cc953a3.tar.gz
mltk-3b99bc4d10c38ed47f82ed10f5e5ead58cc953a3.tar.xz
mltk-3b99bc4d10c38ed47f82ed10f5e5ead58cc953a3.zip
[kernel-vanilla] Refine determining required aufs branch
Diffstat (limited to 'core/modules/kernel-vanilla')
-rw-r--r--core/modules/kernel-vanilla/module.build25
1 files changed, 20 insertions, 5 deletions
diff --git a/core/modules/kernel-vanilla/module.build b/core/modules/kernel-vanilla/module.build
index cc533582..167de9cb 100644
--- a/core/modules/kernel-vanilla/module.build
+++ b/core/modules/kernel-vanilla/module.build
@@ -160,11 +160,26 @@ patch_aufs() {
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_WORK_DIR}/${AUFS}-standalone" || perror "Could not CD to ${AUFS}-standalone"
- git checkout "origin/aufs$NEEDED_BRANCH" || git checkout "origin/aufs4.x-rcN" || perror "Could not checkout needed branch."
+ local branches=( $( git branch -r | grep -oE 'aufs[0-9\.\+]+$' ) )
+ local major minor patch
+ IFS=. read major minor patch _ <<<"$REQUIRED_KERNEL"
+ if [ -z "$major" ] || [ -z "$minor" ]; then
+ perror "REQUIRED_KERNEL not in properly set, this should not happen!"
+ fi
+ local NEEDED_BRANCH="aufs${major}.${minor}"
+ local testvar
+ while [ "${patch}" -gt 0 ]; do
+ for testvar in "${branches[@]}"; do
+ if [ "$testvar" = "${NEEDED_BRANCH}.${patch}" ] || [ "$testvar" = "${NEEDED_BRANCH}.${patch}+" ]; then
+ NEEDED_BRANCH="$testvar"
+ break 2
+ fi
+ done
+ patch=$(( patch - 1 ))
+ done
+ pinfo "Getting branch origin/$NEEDED_BRANCH"
+ git checkout "origin/$NEEDED_BRANCH" || git checkout "origin/aufs4.x-rcN" || perror "Could not checkout needed branch."
pinfo "Starting to patch... $NEEDED_BRANCH"
tarcopy "Documentation fs" "$MODULE_WORK_DIR/ksrc"
@@ -186,7 +201,7 @@ patch_aufs() {
patch -p1 < "$MODULE_WORK_DIR/${AUFS}-standalone/${PATCH}.patch" || pwarning "${PATCH}.patch failed!"
pinfo "Applied '$MODULE_WORK_DIR/${AUFS}-standalone/${PATCH}.patch'"
done
- pinfo "Patched kernel source with aufs-${NEEDED_BRANCH}"
+ pinfo "Patched kernel source with ${NEEDED_BRANCH}"
cd "$MODULE_WORK_DIR" || perror "Where is WORK_DIR?"
}