@@ -4,7 +4,7 @@ set -eu -o pipefail
44
55# # Update docker image tag, because kernel build is using `uname -r` when defining package version variable
66# KERNEL_VERSION=$(curl -s https://www.kernel.org | grep '<strong>' | head -3 | tail -1 | cut -d'>' -f3 | cut -d'<' -f1)
7- KERNEL_VERSION=5.9.7
7+ KERNEL_VERSION=5.10.47
88# KERNEL_REPOSITORY=git://kernel.ubuntu.com/virgin/linux-stable.git
99KERNEL_REPOSITORY=https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
1010REPO_PATH=$( pwd)
@@ -19,17 +19,7 @@ echo "CPU threads: $(nproc --all)"
1919grep ' model name' /proc/cpuinfo | uniq
2020
2121get_next_version () {
22- curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep " linux-image-${KERNEL_VERSION} -${1} " > /dev/null
23- OLD_BUILD_EXIST=$?
24- if test $OLD_BUILD_EXIST -eq 0
25- then
26- LATEST_BUILD=$( curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep " linux-image-${KERNEL_VERSION} -${1} " |
27- grep a | cut -d' >' -f2 | cut -d' <' -f1 |
28- sort -r | head -n 1 | cut -d' -' -f6 | cut -d' _' -f1)
29- else
30- LATEST_BUILD=0
31- fi
32- echo " $(( LATEST_BUILD+ 1 )) "
22+ " ${REPO_PATH} " /next_version.sh " ${1} "
3323}
3424
3525# ## Clean up
@@ -68,7 +58,7 @@ echo >&2 "===]> Info: Applying patches... "
6858while IFS= read -r file; do
6959 echo " ==> Adding $file "
7060 patch -p1 < " $file "
71- done < <( find " ${WORKING_PATH} /patches" -type f -name " *.patch" | grep -vE ' [2]00[0-9] ' | sort)
61+ done < <( find " ${WORKING_PATH} /patches" -type f -name " *.patch" | sort)
7262
7363chmod a+x " ${KERNEL_PATH} " /debian/rules
7464chmod a+x " ${KERNEL_PATH} " /debian/scripts/*
@@ -85,27 +75,10 @@ make olddefconfig
8575echo " " > " ${KERNEL_PATH} " /.scmversion
8676
8777# Build Deb packages
88- make -j " $( getconf _NPROCESSORS_ONLN) " deb-pkg LOCALVERSION=-mbp KDEB_PKGVERSION=" $( make kernelversion) -$( get_next_version mbp-alt) "
89-
90- # Create alternative Kernel
91- echo >&2 " ===]> Info: Create alternative kernel ... "
92- make distclean
93- make clean
94- while IFS= read -r file; do
95- echo " ==> Adding $file "
96- patch -p1 < " $file "
97- done < <( find " ${WORKING_PATH} /patches" -type f -name " *.patch" | grep -E ' [2]00[0-9]' | sort)
98- cp " ${WORKING_PATH} /templates/default-config" " ${KERNEL_PATH} /.config"
99- make olddefconfig
100- echo " " > " ${KERNEL_PATH} " /.scmversion
101-
102- # Build Deb packages
103- make -j " $( getconf _NPROCESSORS_ONLN) " deb-pkg LOCALVERSION=-mbp-alt KDEB_PKGVERSION=" $( make kernelversion) -$( get_next_version mbp) "
78+ make -j " $( getconf _NPROCESSORS_ONLN) " deb-pkg LOCALVERSION=-mbp KDEB_PKGVERSION=" ${KERNEL_VERSION} -$( get_next_version mbp) "
10479
10580# ### Copy artifacts to shared volume
10681echo >&2 " ===]> Info: Copying debs and calculating SHA256 ... "
107- # cp -rfv ../*.deb "${REPO_PATH}/"
108- # cp -rfv "${KERNEL_PATH}/.config" "${REPO_PATH}/kernel_config_${KERNEL_VERSION}"
10982cp -rfv " ${KERNEL_PATH} /.config" " /tmp/artifacts/kernel_config_${KERNEL_VERSION} "
11083cp -rfv ../* .deb /tmp/artifacts/
11184sha256sum ../* .deb > /tmp/artifacts/sha256
0 commit comments