Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Commit c52f5da

Browse files
committed
Merge branch 'feature/githubActions' of github.com-turkosdata:marcosfad/mbp-ubuntu-kernel into feature/githubActions
2 parents 1835a5a + cdbc144 commit c52f5da

3 files changed

Lines changed: 76 additions & 32 deletions

File tree

.github/workflows/build.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Build Kernel Package
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches: [ master ]
10+
pull_request:
11+
branches: [ master ]
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
# This workflow contains a single job called "build"
16+
build:
17+
# The type of runner that the job will run on
18+
runs-on: ubuntu-latest
19+
20+
# Steps represent a sequence of tasks that will be executed as part of the job
21+
steps:
22+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23+
- uses: actions/checkout@v2
24+
25+
- name: Build script
26+
id: build
27+
run: |
28+
mkdir /tmp/artifacts
29+
VERSION=$(grep ^KERNEL_VERSION build.sh | head -n1| cut -d = -f2)
30+
REL=$(grep "PKGREL=\d*" build.sh | cut -d = -f2)
31+
#REL=$( git tag |grep -F $VERSION|sort -r|head -n1|tr -d v)
32+
echo Building $VERSION-$REL
33+
echo "::set-output name=tag::${VERSION}-${REL}"
34+
sudo ./build.sh
35+
cd /tmp/artifacts
36+
ls -l
37+
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
38+
ls -l
39+
40+
- name: Upload package artifact
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: linux-mbp-16x-wifi-${{ steps.build.outputs.tag }}
44+
path: /tmp/artifacts/*
45+
46+
- name: Release
47+
uses: softprops/action-gh-release@v1
48+
with:
49+
files: |
50+
/tmp/artifacts/Packages.gz
51+
/tmp/artifacts/sha256
52+
/tmp/artifacts/*.deb
53+
tag_name: v${{ steps.build.outputs.tag }}
54+
draft: true
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+

build.sh

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ 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.13
8+
PKGREL=1
89
#KERNEL_REPOSITORY=git://kernel.ubuntu.com/virgin/linux-stable.git
910
KERNEL_REPOSITORY=https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
1011
REPO_PATH=$(pwd)
@@ -19,17 +20,18 @@ echo "CPU threads: $(nproc --all)"
1920
grep 'model name' /proc/cpuinfo | uniq
2021

2122
get_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))"
23+
echo $PKGREL
24+
#curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep "linux-image-${KERNEL_VERSION}-${1}" > /dev/null
25+
#OLD_BUILD_EXIST=$?
26+
#if test $OLD_BUILD_EXIST -eq 0
27+
#then
28+
# LATEST_BUILD=$(curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep "linux-image-${KERNEL_VERSION}-${1}" |
29+
# grep a | cut -d'>' -f2 | cut -d'<' -f1 |
30+
# sort -r | head -n 1 | cut -d'-' -f6 | cut -d'_' -f1)
31+
#else
32+
# LATEST_BUILD=0
33+
#fi
34+
#echo "$((LATEST_BUILD+1))"
3335
}
3436

3537
### Clean up
@@ -68,7 +70,7 @@ echo >&2 "===]> Info: Applying patches... "
6870
while IFS= read -r file; do
6971
echo "==> Adding $file"
7072
patch -p1 <"$file"
71-
done < <(find "${WORKING_PATH}/patches" -type f -name "*.patch" | grep -vE '[2]00[0-9]' | sort)
73+
done < <(find "${WORKING_PATH}/patches" -type f -name "*.patch" | sort)
7274

7375
chmod a+x "${KERNEL_PATH}"/debian/rules
7476
chmod a+x "${KERNEL_PATH}"/debian/scripts/*
@@ -85,22 +87,7 @@ make olddefconfig
8587
echo "" >"${KERNEL_PATH}"/.scmversion
8688

8789
# 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)"
90+
make -j "$(getconf _NPROCESSORS_ONLN)" deb-pkg LOCALVERSION=-mbp-16x-wifi KDEB_PKGVERSION="$(make kernelversion)-$(get_next_version)"
10491

10592
#### Copy artifacts to shared volume
10693
echo >&2 "===]> Info: Copying debs and calculating SHA256 ... "

patch_driver.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ BUILD_PATH=/tmp/build-kernel
66

77
### Apple T2 drivers commit hashes
88
# Patches
9-
APPLE_SMC_DRIVER_GIT_URL=https://github.com/marcosfad/linux-mbp-arch.git
10-
APPLE_SMC_DRIVER_BRANCH_NAME=release/5.9
11-
APPLE_SMC_DRIVER_COMMIT_HASH=01519664be9474c1cf5b92e37bd87a8d98283915
9+
APPLE_SMC_DRIVER_GIT_URL=https://github.com/jamlam/mbp-16.1-linux-wifi.git
10+
APPLE_SMC_DRIVER_BRANCH_NAME=main
11+
APPLE_SMC_DRIVER_COMMIT_HASH=4c8b393ed7a874e3d9e44a2a467c1b7c74af1260
1212
## BCE
1313
#APPLE_BCE_DRIVER_GIT_URL=https://github.com/aunali1/mbp2018-bridge-drv.git
1414
#APPLE_BCE_DRIVER_BRANCH_NAME=aur

0 commit comments

Comments
 (0)