From 5126fef0a03563e72d4b5c386d052038939b0914 Mon Sep 17 00:00:00 2001 From: marcosfad Date: Sat, 28 Aug 2021 16:04:51 +0200 Subject: [PATCH 01/18] Add params to control build --- .github/FUNDING.yml | 11 ++ .github/workflows/build.yml | 66 ------------ .github/workflows/build1.yml | 193 ++++++++++++++++++++++++++++++++++ .github/workflows/build2.yml | 194 +++++++++++++++++++++++++++++++++++ .github/workflows/build3.yml | 104 +++++++++++++++++++ .travis.yml | 4 - .yamllint.yaml | 8 ++ build.sh | 163 +++++++++++++++++++++-------- build_in_docker.sh | 109 +++++++++++++++++++- next_version.sh | 4 +- patch_driver.sh | 27 ----- 11 files changed, 742 insertions(+), 141 deletions(-) create mode 100644 .github/FUNDING.yml delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/build1.yml create mode 100644 .github/workflows/build2.yml create mode 100644 .github/workflows/build3.yml create mode 100644 .yamllint.yaml delete mode 100755 patch_driver.sh diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..f6ea77d3 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,11 @@ +--- +github: ['marcosfad'] +patreon: +open_collective: +ko_fi: +tidelift: +community_bridge: +liberapay: +issuehunt: +otechie: +custom: ['https://www.paypal.com/paypalme/marcosfad'] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 7299dfd8..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -name: Build Kernel Package - -# yamllint disable-line rule:truthy -on: - [push, pull_request] - -jobs: - lint: - runs-on: ubuntu-20.04 - steps: - - name: 'Checkout repo' - uses: actions/checkout@v2 - - name: 'Set up Python 3.9' - uses: actions/setup-python@v2 - - name: 'Install dependencies' - run: | - python -m pip install --upgrade pip - pip install yamllint - sudo apt-get install shellcheck bash - - name: 'Analysing the code' - run: | - yamllint . - shellcheck ./*.sh - - build: - needs: [lint] - runs-on: ubuntu-20.04 - steps: - - name: 'Checkout Repo' - uses: actions/checkout@v2 - - - name: Build script - id: build - run: | - mkdir /tmp/artifacts - VERSION=$(grep ^KERNEL_VERSION build.sh | head -n1| cut -d = -f2) - REL=$(./next_version.sh mbp) - echo Building $VERSION-$REL - echo "::set-output name=tag::${VERSION}-${REL}" - sudo ./build.sh - cd /tmp/artifacts - ls -l - dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz - ls -l - - - name: Upload package artifact - uses: actions/upload-artifact@v2 - with: - name: linux-mbp-${{ steps.build.outputs.tag }} - path: /tmp/artifacts/* - - - name: Release - if: | - github.ref == 'refs/heads/master' || - github.ref == 'release/*' - uses: softprops/action-gh-release@v1 - with: - data: | - /tmp/artifacts/Packages.gz - /tmp/artifacts/sha256 - /tmp/artifacts/*.deb - tag_name: v${{ steps.build.outputs.tag }} - draft: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build1.yml b/.github/workflows/build1.yml new file mode 100644 index 00000000..95117d80 --- /dev/null +++ b/.github/workflows/build1.yml @@ -0,0 +1,193 @@ +--- +name: Build Aunali1s Kernel Package + +# yamllint disable-line rule:truthy +on: + [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-20.04 + steps: + - name: 'Checkout repo' + uses: actions/checkout@v2 + - name: 'Set up Python 3.9' + uses: actions/setup-python@v2 + - name: 'Install dependencies' + run: | + python -m pip install --upgrade pip + pip install yamllint + sudo apt-get install shellcheck bash + - name: 'Analysing the code' + run: | + yamllint . + shellcheck ./*.sh + + build-latest-aunali1: + needs: [lint] + runs-on: ubuntu-20.04 + steps: + - name: 'Checkout Repo' + uses: actions/checkout@v2 + + - name: find latest release + id: variables + run: | + sudo apt install wget + wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh + chmod +x ubuntu-mainline-kernel.sh + VERSION=$(./ubuntu-mainline-kernel.sh -r v5.12 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) + RELEASE_SUFFIX=t2-aunali1 + REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) + echo "::set-output name=version::${VERSION}" + echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" + echo "::set-output name=tag::${VERSION}-${RELEASE_SUFFIX}-${REL}" + + - name: Build script + id: build + run: | + rm -rf /tmp/artifacts + mkdir /tmp/artifacts + echo Building ${{ steps.variables.outputs.tag }} + sudo ./build.sh \ + --kernel=${{ steps.variables.outputs.version }} \ + --kernelBranch="v${{ steps.variables.outputs.version }}" \ + --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ + --patchset1Repo="git://github.com/aunali1/linux-mbp-arch.git" \ + --patchset1Branch=master \ + --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ + --patchset1Filter="grep -vE '000[0-9]'" \ + --releaseSuffix=${{ steps.variables.outputs.version }} \ + --releasePath=/tmp/artifacts + cd /tmp/artifacts + ls -l + dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz + ls -l + + - name: Upload package artifact + uses: actions/upload-artifact@v2 + with: + name: linux-${{ steps.variables.outputs.tag }} + path: /tmp/artifacts/* + + - name: Release + if: | + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/heads/release/') + uses: softprops/action-gh-release@v1 + with: + body: | + Linux official kernel. + Patchsets: + https://github.com/aunali1/linux-mbp-arch excluding 0001 to 0009 + files: | + /tmp/artifacts/Packages.gz + /tmp/artifacts/sha256 + /tmp/artifacts/*.deb + tag_name: v${{ steps.variables.outputs.tag }} + draft: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish Kernel + if: | + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/heads/release/') + run: | + PAYLOAD='{"request": {"branch":"master","sha":"9c060e2ebc7564921e28632232131e1dd80ce679"}}' + curl -sSf -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Travis-API-Version: 3" \ + -H "Authorization: token ${TRAVIS_TOKEN}" \ + -d "{\"request\": {${PAYLOAD}}}" \ + https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests + env: + TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} + + build-latest-aunali1-jamlam: + needs: [lint] + runs-on: ubuntu-20.04 + steps: + - name: 'Checkout Repo' + uses: actions/checkout@v2 + + - name: find latest release + id: variables + run: | + sudo apt install wget + wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh + chmod +x ubuntu-mainline-kernel.sh + VERSION=$(./ubuntu-mainline-kernel.sh -r v5.12 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) + RELEASE_SUFFIX=t2-aunali1-patched + REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) + echo "::set-output name=version::${VERSION}" + echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" + echo "::set-output name=tag::${VERSION}-${RELEASE_SUFFIX}-${REL}" + + - name: Build script + id: build + run: | + rm -rf /tmp/artifacts + mkdir /tmp/artifacts + echo Building ${{ steps.variables.outputs.tag }} + sudo ./build.sh \ + --kernel=${{ steps.variables.outputs.version }} \ + --kernelBranch="v${{ steps.variables.outputs.version }}" \ + --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ + --patchset1Repo="git://github.com/aunali1/linux-mbp-arch.git" \ + --patchset1Branch=master \ + --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ + --patchset1Filter="grep -vE '000[0-9]'" \ + --patchset2Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ + --patchset2Branch=main \ + --patchset2Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ + --patchset2Filter="grep -E '8001'" \ + --releaseSuffix=${{ steps.variables.outputs.version }} \ + --releasePath=/tmp/artifacts + cd /tmp/artifacts + ls -l + dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz + ls -l + + - name: Upload package artifact + uses: actions/upload-artifact@v2 + with: + name: linux-${{ steps.variables.outputs.tag }} + path: /tmp/artifacts/* + + - name: Release + if: | + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/heads/release/') + uses: softprops/action-gh-release@v1 + with: + body: | + Linux official kernel. + Patchsets: + https://github.com/aunali1/linux-mbp-arch excluding 0001 to 0009 + https://github.com/jamlam/mbp-16.1-linux-wifi only 8001 + files: | + /tmp/artifacts/Packages.gz + /tmp/artifacts/sha256 + /tmp/artifacts/*.deb + tag_name: v${{ steps.variables.outputs.tag }} + draft: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish Kernel + if: | + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/heads/release/') + run: | + PAYLOAD='{"request": {"branch":"master","sha":"9c060e2ebc7564921e28632232131e1dd80ce679"}}' + curl -sSf -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Travis-API-Version: 3" \ + -H "Authorization: token ${TRAVIS_TOKEN}" \ + -d "{\"request\": {${PAYLOAD}}}" \ + https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests + env: + TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} diff --git a/.github/workflows/build2.yml b/.github/workflows/build2.yml new file mode 100644 index 00000000..6f5ca4f1 --- /dev/null +++ b/.github/workflows/build2.yml @@ -0,0 +1,194 @@ +--- +name: Build Jamlam Kernel Package + +# yamllint disable-line rule:truthy +on: + [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-20.04 + steps: + - name: 'Checkout repo' + uses: actions/checkout@v2 + - name: 'Set up Python 3.9' + uses: actions/setup-python@v2 + - name: 'Install dependencies' + run: | + python -m pip install --upgrade pip + pip install yamllint + sudo apt-get install shellcheck bash + - name: 'Analysing the code' + run: | + yamllint . + shellcheck ./*.sh + + + build-latest-jamlam: + needs: [lint] + runs-on: ubuntu-20.04 + steps: + - name: 'Checkout Repo' + uses: actions/checkout@v2 + + - name: find latest release + id: variables + run: | + sudo apt install wget + wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh + chmod +x ubuntu-mainline-kernel.sh + VERSION=$(./ubuntu-mainline-kernel.sh -r v5.13 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) + RELEASE_SUFFIX=t2-jamlam + REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) + echo "::set-output name=version::${VERSION}" + echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" + echo "::set-output name=tag::${VERSION}-${RELEASE_SUFFIX}-${REL}" + + - name: Build script + id: build + run: | + rm -rf /tmp/artifacts + mkdir /tmp/artifacts + echo Building ${{ steps.variables.outputs.tag }} + sudo ./build.sh \ + --kernel=${{ steps.variables.outputs.version }} \ + --kernelBranch="v${{ steps.variables.outputs.version }}" \ + --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ + --patchset1Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ + --patchset1Branch=main \ + --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ + --patchset1Filter="grep -vE '0001|800[0-9]'" \ + --releaseSuffix=${{ steps.variables.outputs.version }} \ + --releasePath=/tmp/artifacts + cd /tmp/artifacts + ls -l + dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz + ls -l + + - name: Upload package artifact + uses: actions/upload-artifact@v2 + with: + name: linux-${{ steps.variables.outputs.tag }} + path: /tmp/artifacts/* + + - name: Release + if: | + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/heads/release/') + uses: softprops/action-gh-release@v1 + with: + body: | + Linux official kernel. + Patchsets: + https://github.com/jamlam/mbp-16.1-linux-wifi excluding 0001 + files: | + /tmp/artifacts/Packages.gz + /tmp/artifacts/sha256 + /tmp/artifacts/*.deb + tag_name: v${{ steps.variables.outputs.tag }} + draft: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish Kernel + if: | + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/heads/release/') + run: | + PAYLOAD='{"request": {"branch":"master","sha":"9c060e2ebc7564921e28632232131e1dd80ce679"}}' + curl -sSf -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Travis-API-Version: 3" \ + -H "Authorization: token ${TRAVIS_TOKEN}" \ + -d "{\"request\": {${PAYLOAD}}}" \ + https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests + env: + TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} + + build-latest-jamlam-aunali1: + needs: [lint] + runs-on: ubuntu-20.04 + steps: + - name: 'Checkout Repo' + uses: actions/checkout@v2 + + - name: find latest release + id: variables + run: | + sudo apt install wget + wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh + chmod +x ubuntu-mainline-kernel.sh + VERSION=$(./ubuntu-mainline-kernel.sh -r v5.13 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) + RELEASE_SUFFIX=t2-jamlam-patched + REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) + echo "::set-output name=version::${VERSION}" + echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" + echo "::set-output name=tag::${VERSION}-${RELEASE_SUFFIX}-${REL}" + + - name: Build script + id: build + run: | + rm -rf /tmp/artifacts + mkdir /tmp/artifacts + echo Building ${{ steps.variables.outputs.tag }} + sudo ./build.sh \ + --kernel=${{ steps.variables.outputs.version }} \ + --kernelBranch="v${{ steps.variables.outputs.version }}" \ + --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ + --patchset1Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ + --patchset1Branch=main \ + --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ + --patchset1Filter="grep -vE '0001|800[0-9]'" \ + --patchset2Repo="git://github.com/aunali1/linux-mbp-arch.git" \ + --patchset2Branch=master \ + --patchset2Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ + --patchset2Filter="grep -E 'brcmfmac'" \ + --releaseSuffix=${{ steps.variables.outputs.version }} \ + --releasePath=/tmp/artifacts + cd /tmp/artifacts + ls -l + dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz + ls -l + + - name: Upload package artifact + uses: actions/upload-artifact@v2 + with: + name: linux-${{ steps.variables.outputs.tag }} + path: /tmp/artifacts/* + + - name: Release + if: | + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/heads/release/') + uses: softprops/action-gh-release@v1 + with: + body: | + Linux official kernel. + Patchsets: + https://github.com/jamlam/mbp-16.1-linux-wifi excluding 0001 and 8001 to 8009 + https://github.com/aunali1/linux-mbp-arch only including *brcmfmac* + files: | + /tmp/artifacts/Packages.gz + /tmp/artifacts/sha256 + /tmp/artifacts/*.deb + tag_name: v${{ steps.variables.outputs.tag }} + draft: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish Kernel + if: | + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/heads/release/') + run: | + PAYLOAD='{"request": {"branch":"master","sha":"9c060e2ebc7564921e28632232131e1dd80ce679"}}' + curl -sSf -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Travis-API-Version: 3" \ + -H "Authorization: token ${TRAVIS_TOKEN}" \ + -d "{\"request\": {${PAYLOAD}}}" \ + https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests + env: + TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} diff --git a/.github/workflows/build3.yml b/.github/workflows/build3.yml new file mode 100644 index 00000000..1af34400 --- /dev/null +++ b/.github/workflows/build3.yml @@ -0,0 +1,104 @@ +--- +name: Build HWE Kernel Package + +# yamllint disable-line rule:truthy +on: + [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-20.04 + steps: + - name: 'Checkout repo' + uses: actions/checkout@v2 + - name: 'Set up Python 3.9' + uses: actions/setup-python@v2 + - name: 'Install dependencies' + run: | + python -m pip install --upgrade pip + pip install yamllint + sudo apt-get install shellcheck bash + - name: 'Analysing the code' + run: | + yamllint . + shellcheck ./*.sh + + build-hwe-jamalam: + needs: [lint] + runs-on: ubuntu-20.04 + steps: + - name: 'Checkout Repo' + uses: actions/checkout@v2 + + - name: find latest release + id: variables + run: | + VERSION=5.11.0 + RELEASE_SUFFIX=t2 + REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) + echo "::set-output name=version::${VERSION}" + echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" + echo "::set-output name=tag::${VERSION}-${RELEASE_SUFFIX}-${REL}" + + - name: Build script + id: build + run: | + rm -rf /tmp/artifacts + mkdir /tmp/artifacts + echo Building ${{ steps.variables.outputs.tag }} + sudo ./build.sh \ + --kernel=${{ steps.variables.outputs.version }} \ + --kernelBranch="hwe-5.11" \ + --kernelRepository="git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal" \ + --debianSaucePatches=no \ + --patchset1Repo="git://github.com/AdityaGarg8/5.10-patches.git" \ + --patchset1Branch=main \ + --patchset1Commit=1544718ff8282e75bbade89faebcb3ac45e5434a \ + --patchset1Filter="grep -vE '0001'" \ + --releaseSuffix=t2-hwe \ + --releasePath=/tmp/artifacts + cd /tmp/artifacts + ls -l + dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz + ls -l + + - name: Upload package artifact + uses: actions/upload-artifact@v2 + with: + name: linux-mbp-${{ steps.variables.outputs.tag }} + path: /tmp/artifacts/* + + - name: Release + if: | + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/heads/release/') + uses: softprops/action-gh-release@v1 + with: + body: | + Ubuntu HWE + Patchsets: + https://github.com/AdityaGarg8/5.10-patches + files: | + /tmp/artifacts/Packages.gz + /tmp/artifacts/sha256 + /tmp/artifacts/*.deb + tag_name: v${{ steps.variables.outputs.tag }} + draft: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish Kernel + if: | + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/heads/release/') + run: | + PAYLOAD='{"request": {"branch":"master","sha":"9c060e2ebc7564921e28632232131e1dd80ce679"}}' + curl -sSf -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Travis-API-Version: 3" \ + -H "Authorization: token ${TRAVIS_TOKEN}" \ + -d "{\"request\": {${PAYLOAD}}}" \ + https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests + env: + TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} diff --git a/.travis.yml b/.travis.yml index c7dc7143..84273280 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,5 @@ os: services: - docker -branches: - only: - - master - script: - ./publish.sh diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 00000000..53a7ad39 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,8 @@ +--- +extends: default + +rules: + line-length: + level: warning + allow-non-breakable-inline-mappings: true + max: 120 diff --git a/build.sh b/build.sh index a5312956..af4b4d0a 100755 --- a/build.sh +++ b/build.sh @@ -2,60 +2,157 @@ set -eu -o pipefail -KERNEL_VERSION=5.13.12 -KERNEL_REPOSITORY=https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git +export LANG=C + +START_TIME=$(date +%s) + +kernel=5.13.13 +kernelRepository=git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git +kernelBranch=v5.13.13 +debianSaucePatches=yes +patchset1Repo=git://github.com/aunali1/linux-mbp-arch.git +patchset1Branch=master +patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 +patchset1Filter='cat' +patchset2Repo='' +patchset2Branch='' +patchset2Commit='' +patchset2Filter='cat' +path=/root/work +releaseSuffix=t2 +releasePath=/tmp/artifacts + +__die() { + local rc=$1; shift + printf 1>&2 '%s\n' "ERROR: $*"; exit "${rc}" +} + +args=( "$@" ); +for (( i=0; i < $# ; i++ )) +do + arg=${args[$i]} + if [[ $arg = --*=* ]] + then + key=${arg#--} + val=${key#*=}; key=${key%%=*} + case "$key" in + kernel|kernelRepository|kernelBranch|debianSaucePatches|patchset1Repo|patchset1Branch|patchset1Commit|patchset1Filter|patchset2Repo|patchset2Branch|patchset2Commit|patchset2Filter|path|releaseSuffix|releasePath) + printf -v "$key" '%s' "$val" ;; + *) __die 1 "Unknown flag $arg" + esac + else __die 1 "Bad arg $arg" + fi +done + +# Kernel +KERNEL_VERSION="${kernel}" +KERNEL_REPOSITORY="${kernelRepository}" +KERNEL_BRANCH="${kernelBranch}" +# Patches +PATCHSET_1_URL="${patchset1Repo}" +PATCHSET_1_BRANCH="${patchset1Branch}" +PATCHSET_1_HASH="${patchset1Commit}" +PATCHSET_1_FILTER=${patchset1Filter} +PATCHSET_2_URL="${patchset2Repo}" +PATCHSET_2_BRANCH="${patchset2Branch}" +PATCHSET_2_HASH="${patchset2Commit}" +PATCHSET_2_FILTER=${patchset2Filter} +# Release +RELEASE_SUFFIX="${releaseSuffix}" +# Environment +WORKING_PATH="${path}" REPO_PATH=$(pwd) -WORKING_PATH=/root/work KERNEL_PATH="${WORKING_PATH}/linux-kernel" +PATCHES_PATH="${WORKING_PATH}/patches" +PATCHSET_1_GIT_PATH="${WORKING_PATH}/patchset1" +PATCHSET_2_GIT_PATH="${WORKING_PATH}/patchset2" +RELEASE_PATH="${releasePath}" ### Debug commands -echo "KERNEL_VERSION=$KERNEL_VERSION" -echo "${WORKING_PATH}" +echo "Building kernel ${KERNEL_VERSION}-${RELEASE_SUFFIX} from ${KERNEL_REPOSITORY}" +echo "Current working path: ${WORKING_PATH}" echo "Current path: ${REPO_PATH}" echo "CPU threads: $(nproc --all)" +echo "Patchset: + ${PATCHSET_1_URL}#${PATCHSET_1_BRANCH}#${PATCHSET_1_HASH} with ${PATCHSET_1_FILTER}" +if [ "$PATCHSET_2_BRANCH" != "" ]; then + echo " + ${PATCHSET_2_URL}#${PATCHSET_2_BRANCH}#${PATCHSET_2_HASH} with ${PATCHSET_2_FILTER} +" +fi grep 'model name' /proc/cpuinfo | uniq -get_next_version () { +get_next_version() { "${REPO_PATH}"/next_version.sh "${1}" } ### Clean up rm -rfv ./*.deb - -mkdir "${WORKING_PATH}" && cd "${WORKING_PATH}" -cp -rf "${REPO_PATH}"/{patches,templates} "${WORKING_PATH}" rm -rf "${KERNEL_PATH}" - -### Dependencies +rm -rf "${PATCHES_PATH}" +rm -rf "${RELEASE_PATH}" + +mkdir -p "${WORKING_PATH}" && cd "${WORKING_PATH}" +mkdir -p "${PATCHES_PATH}" +mkdir -p "${RELEASE_PATH}" +cp -rf "${REPO_PATH}/templates" "${WORKING_PATH}" +if [ "$debianSaucePatches" != "no" ]; then + cp -rf "${REPO_PATH}/patches" "${PATCHES_PATH}" +fi + +#### Dependencies export DEBIAN_FRONTEND=noninteractive apt-get update apt-get install -y build-essential fakeroot libncurses-dev bison flex libssl-dev libelf-dev \ openssl dkms libudev-dev libpci-dev libiberty-dev autoconf wget xz-utils git \ bc rsync cpio dh-modaliases debhelper kernel-wedge curl -### get Kernel -git clone --depth 1 --single-branch --branch "v${KERNEL_VERSION}" \ +#### get Kernel +echo "git clone --depth 1 --single-branch --branch ${KERNEL_BRANCH} ${KERNEL_REPOSITORY} ${KERNEL_PATH}" +git clone --depth 1 --single-branch --branch "${KERNEL_BRANCH}" \ "${KERNEL_REPOSITORY}" "${KERNEL_PATH}" cd "${KERNEL_PATH}" || exit #### Create patch file with custom drivers echo >&2 "===]> Info: Creating patch file... " -KERNEL_VERSION="${KERNEL_VERSION}" WORKING_PATH="${WORKING_PATH}" "${REPO_PATH}/patch_driver.sh" +cd "${PATCHES_PATH}" || exit + +### Patchset 1 +git clone --single-branch --branch ${PATCHSET_1_BRANCH} ${PATCHSET_1_URL} \ + "${PATCHSET_1_GIT_PATH}" +cd "${PATCHSET_1_GIT_PATH}" || exit +git checkout ${PATCHSET_1_HASH} +while IFS= read -r file; do + echo "==> Adding ${file}" + cp -rfv "${file}" "${PATCHES_PATH}/${file##*/}" +done < <(find "${PATCHSET_1_GIT_PATH}" -type f -name "*.patch" | ${PATCHSET_1_FILTER} | sort) + +### Patchset 2 +if [ "$PATCHSET_2_BRANCH" != "" ]; then + git clone --single-branch --branch ${PATCHSET_2_BRANCH} ${PATCHSET_2_URL} \ + "${PATCHSET_2_GIT_PATH}" + cd "${PATCHSET_2_GIT_PATH}" || exit + git checkout ${PATCHSET_2_HASH} + + while IFS= read -r file; do + echo "==> Adding ${file}" + cp -rfv "${file}" "${PATCHES_PATH}/${file##*/}" + done < <(find "${PATCHSET_2_GIT_PATH}" -type f -name "*.patch" | ${PATCHSET_2_FILTER} | sort) +fi #### Apply patches cd "${KERNEL_PATH}" || exit echo >&2 "===]> Info: Applying patches... " -[ ! -d "${WORKING_PATH}/patches" ] && { +[ ! -d "${PATCHES_PATH}" ] && { echo 'Patches directory not found!' exit 1 } - - +echo "find ${PATCHES_PATH} -type f -name *.patch | sort" while IFS= read -r file; do echo "==> Adding $file" patch -p1 <"$file" -done < <(find "${WORKING_PATH}/patches" -type f -name "*.patch" | sort) +done < <(find "${PATCHES_PATH}" -type f -name "*.patch" | sort) chmod a+x "${KERNEL_PATH}"/debian/rules chmod a+x "${KERNEL_PATH}"/debian/scripts/* @@ -72,29 +169,13 @@ make olddefconfig echo "" >"${KERNEL_PATH}"/.scmversion # Build Deb packages -#make -j "$(getconf _NPROCESSORS_ONLN)" deb-pkg LOCALVERSION=-mbp KDEB_PKGVERSION="$(make kernelversion)-$(get_next_version mbp)" - -# build alternate kernel with corellium's wifi patches, for MBP16,1/2/4 and MBA9,1 -echo >&2 "===]> Info: Create alternative kernel with corellium wifi patch... " -#make distclean -#make clean -# reverse other wifi patches -#while IFS= read -r file; do -# echo "==> Reverting $file" -# patch -R -p1 <"$file" -#done < <(find "${WORKING_PATH}/patches" -type f -name "*.patch" | grep "brcmfmac" | sort -r) - -#echo "==> Adding wifi-bigsur.patch" -#curl https://raw.githubusercontent.com/jamlam/mbp-16.1-linux-wifi/4c8b393ed7a874e3d9e44a2a467c1b7c74af1260/wifi-bigsur.patch \ -#| patch -p1 -#cp "${WORKING_PATH}/templates/default-config" "${KERNEL_PATH}/.config" -#make olddefconfig -#echo "" >"${KERNEL_PATH}"/.scmversion - -make -j "$(getconf _NPROCESSORS_ONLN)" deb-pkg LOCALVERSION=-mbp-16x-wifi KDEB_PKGVERSION="${KERNEL_VERSION}-$(get_next_version mbp)" +make -j "$(getconf _NPROCESSORS_ONLN)" deb-pkg LOCALVERSION=-${RELEASE_SUFFIX} KDEB_PKGVERSION="${KERNEL_VERSION}-$(get_next_version ${RELEASE_SUFFIX})" #### Copy artifacts to shared volume echo >&2 "===]> Info: Copying debs and calculating SHA256 ... " -cp -rfv "${KERNEL_PATH}/.config" "/tmp/artifacts/kernel_config_${KERNEL_VERSION}" -cp -rfv ../*.deb /tmp/artifacts/ -sha256sum ../*.deb >/tmp/artifacts/sha256 +cp -rfv "${KERNEL_PATH}/.config" "${RELEASE_PATH}/kernel_config_${KERNEL_VERSION}" +cp -rfv ../*.deb "${RELEASE_PATH}"/ +sha256sum ../*.deb > "${RELEASE_PATH}"/sha256 + +END_TIME=$(date +%s) +echo "Total execution took $((END_TIME-START_TIME)) seconds" diff --git a/build_in_docker.sh b/build_in_docker.sh index 40d2ef71..0ba3c7ee 100755 --- a/build_in_docker.sh +++ b/build_in_docker.sh @@ -4,10 +4,117 @@ set -eu -o pipefail DOCKER_IMAGE=ubuntu:20.04 +# https://kernel.ubuntu.com/~kernel-ppa/mainline/ +# https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal docker pull ${DOCKER_IMAGE} + +# Aunali1 +VERSION=$(ubuntu-mainline-kernel.sh -r v5.12 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) +docker run \ + -t \ + --rm \ + -v "$(pwd)":/repo \ + ${DOCKER_IMAGE} \ + /bin/bash -c "\ + cd /repo \ + && \ + ./build.sh \ + --kernel=${VERSION} \ + --kernelBranch=v${VERSION} \ + --kernelRepository='git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git' \ + --patchset1Repo='git://github.com/aunali1/linux-mbp-arch.git' \ + --patchset1Branch=master \ + --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ + --patchset1Filter=\"grep -vE '000[0-9]'\" \ + --releaseSuffix=t2-aunali1 \ + --releasePath=/repo/.build/t2-aunali1 \ +" +docker run \ + -t \ + --rm \ + -v "$(pwd)":/repo \ + ${DOCKER_IMAGE} \ + /bin/bash -c "\ + cd /repo \ + && \ + ./build.sh \ + --kernel=${VERSION} \ + --kernelBranch=v${VERSION} \ + --kernelRepository='git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git' \ + --patchset1Repo='git://github.com/aunali1/linux-mbp-arch.git' \ + --patchset1Branch=master \ + --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ + --patchset1Filter=\"grep -vE '000[0-9]'\" \ + --patchset2Repo='git://github.com/jamlam/mbp-16.1-linux-wifi.git' \ + --patchset2Branch=main \ + --patchset2Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ + --patchset2Filter=grep -E '8001' \ + --releaseSuffix=t2-aunali1-patched \ + --releasePath=/repo/.build/t2-aunali1-patched \ +" +# jamlam +VERSION=$(ubuntu-mainline-kernel.sh -r v5.12 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) +docker run \ + -t \ + --rm \ + -v "$(pwd)":/repo \ + ${DOCKER_IMAGE} \ + /bin/bash -c "\ + cd /repo \ + && \ + ./build.sh \ + --kernel=${VERSION} \ + --kernelBranch=v${VERSION} \ + --kernelRepository='git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git' \ + --patchset1Repo='git://github.com/jamlam/mbp-16.1-linux-wifi.git' \ + --patchset1Branch=main \ + --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ + --patchset1Filter=\"grep -vE '0001|800[0-9]'\" \ + --releaseSuffix=t2-jamlam \ + --releasePath=/repo/.build/t2-jamlam \ +" + +docker run \ + -t \ + --rm \ + -v "$(pwd)":/repo \ + ${DOCKER_IMAGE} \ + /bin/bash -c "\ + cd /repo \ + && \ + ./build.sh \ + --kernel=${VERSION} \ + --kernelBranch=v${VERSION} \ + --kernelRepository='git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git' \ + --patchset1Repo='git://github.com/jamlam/mbp-16.1-linux-wifi.git' \ + --patchset1Branch=main \ + --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ + --patchset1Filter=\"grep -vE '0001|800[0-9]'\" \ + --patchset2Repo='git://github.com/aunali1/linux-mbp-arch.git' \ + --patchset2Branch=master \ + --patchset2Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ + --patchset2Filter=\"grep -E 'brcmfmac'\" \ + --releasePath=/repo/.build/t2-jamlam-patched \ +" + +# HWE docker run \ -t \ --rm \ -v "$(pwd)":/repo \ ${DOCKER_IMAGE} \ - /bin/bash -c 'cd /repo && ./build.sh' + /bin/bash -c "\ + cd /repo \ + && \ + ./build.sh \ + --kernel=${{ steps.variables.outputs.version }} \ + --kernelBranch=hwe-5.11 \ + --kernelRepository='git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal' \ + --debianSaucePatches=no \ + --patchset1Repo='git://github.com/AdityaGarg8/5.10-patches.git' \ + --patchset1Branch=main \ + --patchset1Commit=1544718ff8282e75bbade89faebcb3ac45e5434a \ + --patchset1Filter=\"grep -vE '0001'\" \ + --releaseSuffix=t2-hwe \ + --releasePath=/repo/.build/t2-hwe \ +" diff --git a/next_version.sh b/next_version.sh index d4fd1106..e4641b84 100755 --- a/next_version.sh +++ b/next_version.sh @@ -1,9 +1,9 @@ #!/bin/bash -curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep "linux-image-${KERNEL_VERSION}-ยง" > /dev/null +curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep "linux-image-${1}" > /dev/null OLD_BUILD_EXIST=$? if test $OLD_BUILD_EXIST -eq 0 then - LATEST_BUILD=$(curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep "linux-image-${KERNEL_VERSION}-${1}" | + LATEST_BUILD=$(curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep "linux-image-${1}" | grep a | cut -d'>' -f2 | cut -d'<' -f1 | sort -r | head -n 1 | cut -d'-' -f6 | cut -d'_' -f1) else diff --git a/patch_driver.sh b/patch_driver.sh deleted file mode 100755 index fc07d2dd..00000000 --- a/patch_driver.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -eu -o pipefail - -BUILD_PATH=/tmp/build-kernel - -### Apple T2 drivers commit hashes -# Patches -APPLE_SMC_DRIVER_GIT_URL=https://github.com/jamlam/mbp-16.1-linux-wifi.git -APPLE_SMC_DRIVER_BRANCH_NAME=main -APPLE_SMC_DRIVER_COMMIT_HASH=c20aa04314fe0a9c5ad0d2f9ac54a2edbe5d7e32 - - -rm -rf "${BUILD_PATH}" -mkdir -p "${BUILD_PATH}" -cd "${BUILD_PATH}" || exit - -### AppleSMC and BT aunali fixes -git clone --single-branch --branch ${APPLE_SMC_DRIVER_BRANCH_NAME} ${APPLE_SMC_DRIVER_GIT_URL} \ - "${BUILD_PATH}/linux-mbp-arch" -cd "${BUILD_PATH}/linux-mbp-arch" || exit -git checkout ${APPLE_SMC_DRIVER_COMMIT_HASH} - -while IFS= read -r file; do - echo "==> Adding ${file}" - cp -rfv "${file}" "${WORKING_PATH}"/patches/"${file##*/}" -done < <(find "${BUILD_PATH}/linux-mbp-arch" -type f -name "*.patch" | sort) From 634c4d24c2069ee3b53ac243f02487d8afd1be74 Mon Sep 17 00:00:00 2001 From: marcosfad Date: Sun, 29 Aug 2021 12:09:20 +0200 Subject: [PATCH 02/18] Fix files rights --- .github/workflows/build1.yml | 2 ++ .github/workflows/build2.yml | 2 ++ .github/workflows/build3.yml | 1 + build_in_docker.sh | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build1.yml b/.github/workflows/build1.yml index 95117d80..fa0061cf 100644 --- a/.github/workflows/build1.yml +++ b/.github/workflows/build1.yml @@ -59,6 +59,7 @@ jobs: --patchset1Filter="grep -vE '000[0-9]'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts + sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz @@ -145,6 +146,7 @@ jobs: --patchset2Filter="grep -E '8001'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts + sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz diff --git a/.github/workflows/build2.yml b/.github/workflows/build2.yml index 6f5ca4f1..30cbd28c 100644 --- a/.github/workflows/build2.yml +++ b/.github/workflows/build2.yml @@ -60,6 +60,7 @@ jobs: --patchset1Filter="grep -vE '0001|800[0-9]'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts + sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz @@ -146,6 +147,7 @@ jobs: --patchset2Filter="grep -E 'brcmfmac'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts + sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz diff --git a/.github/workflows/build3.yml b/.github/workflows/build3.yml index 1af34400..d8e23d78 100644 --- a/.github/workflows/build3.yml +++ b/.github/workflows/build3.yml @@ -57,6 +57,7 @@ jobs: --patchset1Filter="grep -vE '0001'" \ --releaseSuffix=t2-hwe \ --releasePath=/tmp/artifacts + sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz diff --git a/build_in_docker.sh b/build_in_docker.sh index 0ba3c7ee..408e5e35 100755 --- a/build_in_docker.sh +++ b/build_in_docker.sh @@ -48,7 +48,7 @@ docker run \ --patchset2Repo='git://github.com/jamlam/mbp-16.1-linux-wifi.git' \ --patchset2Branch=main \ --patchset2Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset2Filter=grep -E '8001' \ + --patchset2Filter=\"grep -E '8001'\" \ --releaseSuffix=t2-aunali1-patched \ --releasePath=/repo/.build/t2-aunali1-patched \ " From 54220494e959eb53bd89fd88e5edac48c3466f43 Mon Sep 17 00:00:00 2001 From: marcosfad Date: Sun, 29 Aug 2021 12:24:12 +0200 Subject: [PATCH 03/18] Remove unnecessary sudo calls --- .github/workflows/build1.yml | 6 ++---- .github/workflows/build2.yml | 6 ++---- .github/workflows/build3.yml | 3 +-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build1.yml b/.github/workflows/build1.yml index fa0061cf..9da6ebd3 100644 --- a/.github/workflows/build1.yml +++ b/.github/workflows/build1.yml @@ -49,7 +49,7 @@ jobs: rm -rf /tmp/artifacts mkdir /tmp/artifacts echo Building ${{ steps.variables.outputs.tag }} - sudo ./build.sh \ + ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ --kernelBranch="v${{ steps.variables.outputs.version }}" \ --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ @@ -59,7 +59,6 @@ jobs: --patchset1Filter="grep -vE '000[0-9]'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts - sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz @@ -132,7 +131,7 @@ jobs: rm -rf /tmp/artifacts mkdir /tmp/artifacts echo Building ${{ steps.variables.outputs.tag }} - sudo ./build.sh \ + ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ --kernelBranch="v${{ steps.variables.outputs.version }}" \ --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ @@ -146,7 +145,6 @@ jobs: --patchset2Filter="grep -E '8001'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts - sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz diff --git a/.github/workflows/build2.yml b/.github/workflows/build2.yml index 30cbd28c..2c473b25 100644 --- a/.github/workflows/build2.yml +++ b/.github/workflows/build2.yml @@ -50,7 +50,7 @@ jobs: rm -rf /tmp/artifacts mkdir /tmp/artifacts echo Building ${{ steps.variables.outputs.tag }} - sudo ./build.sh \ + ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ --kernelBranch="v${{ steps.variables.outputs.version }}" \ --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ @@ -60,7 +60,6 @@ jobs: --patchset1Filter="grep -vE '0001|800[0-9]'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts - sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz @@ -133,7 +132,7 @@ jobs: rm -rf /tmp/artifacts mkdir /tmp/artifacts echo Building ${{ steps.variables.outputs.tag }} - sudo ./build.sh \ + ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ --kernelBranch="v${{ steps.variables.outputs.version }}" \ --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ @@ -147,7 +146,6 @@ jobs: --patchset2Filter="grep -E 'brcmfmac'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts - sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz diff --git a/.github/workflows/build3.yml b/.github/workflows/build3.yml index d8e23d78..29523e27 100644 --- a/.github/workflows/build3.yml +++ b/.github/workflows/build3.yml @@ -46,7 +46,7 @@ jobs: rm -rf /tmp/artifacts mkdir /tmp/artifacts echo Building ${{ steps.variables.outputs.tag }} - sudo ./build.sh \ + ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ --kernelBranch="hwe-5.11" \ --kernelRepository="git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal" \ @@ -57,7 +57,6 @@ jobs: --patchset1Filter="grep -vE '0001'" \ --releaseSuffix=t2-hwe \ --releasePath=/tmp/artifacts - sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz From c796d4716f0489b1fb4ff648fb4d38c25dce3b30 Mon Sep 17 00:00:00 2001 From: marcosfad Date: Sun, 29 Aug 2021 12:29:15 +0200 Subject: [PATCH 04/18] Revert: Remove unnecessary sudo calls --- .github/workflows/build1.yml | 6 ++++-- .github/workflows/build2.yml | 6 ++++-- .github/workflows/build3.yml | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build1.yml b/.github/workflows/build1.yml index 9da6ebd3..fa0061cf 100644 --- a/.github/workflows/build1.yml +++ b/.github/workflows/build1.yml @@ -49,7 +49,7 @@ jobs: rm -rf /tmp/artifacts mkdir /tmp/artifacts echo Building ${{ steps.variables.outputs.tag }} - ./build.sh \ + sudo ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ --kernelBranch="v${{ steps.variables.outputs.version }}" \ --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ @@ -59,6 +59,7 @@ jobs: --patchset1Filter="grep -vE '000[0-9]'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts + sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz @@ -131,7 +132,7 @@ jobs: rm -rf /tmp/artifacts mkdir /tmp/artifacts echo Building ${{ steps.variables.outputs.tag }} - ./build.sh \ + sudo ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ --kernelBranch="v${{ steps.variables.outputs.version }}" \ --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ @@ -145,6 +146,7 @@ jobs: --patchset2Filter="grep -E '8001'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts + sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz diff --git a/.github/workflows/build2.yml b/.github/workflows/build2.yml index 2c473b25..30cbd28c 100644 --- a/.github/workflows/build2.yml +++ b/.github/workflows/build2.yml @@ -50,7 +50,7 @@ jobs: rm -rf /tmp/artifacts mkdir /tmp/artifacts echo Building ${{ steps.variables.outputs.tag }} - ./build.sh \ + sudo ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ --kernelBranch="v${{ steps.variables.outputs.version }}" \ --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ @@ -60,6 +60,7 @@ jobs: --patchset1Filter="grep -vE '0001|800[0-9]'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts + sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz @@ -132,7 +133,7 @@ jobs: rm -rf /tmp/artifacts mkdir /tmp/artifacts echo Building ${{ steps.variables.outputs.tag }} - ./build.sh \ + sudo ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ --kernelBranch="v${{ steps.variables.outputs.version }}" \ --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ @@ -146,6 +147,7 @@ jobs: --patchset2Filter="grep -E 'brcmfmac'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts + sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz diff --git a/.github/workflows/build3.yml b/.github/workflows/build3.yml index 29523e27..d8e23d78 100644 --- a/.github/workflows/build3.yml +++ b/.github/workflows/build3.yml @@ -46,7 +46,7 @@ jobs: rm -rf /tmp/artifacts mkdir /tmp/artifacts echo Building ${{ steps.variables.outputs.tag }} - ./build.sh \ + sudo ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ --kernelBranch="hwe-5.11" \ --kernelRepository="git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal" \ @@ -57,6 +57,7 @@ jobs: --patchset1Filter="grep -vE '0001'" \ --releaseSuffix=t2-hwe \ --releasePath=/tmp/artifacts + sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts ls -l dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz From 99bd827067f33e317e26b2f494d46f8c6d2b1100 Mon Sep 17 00:00:00 2001 From: marcosfad Date: Sun, 29 Aug 2021 12:53:01 +0200 Subject: [PATCH 05/18] Fix patches in HWE --- .github/workflows/build3.yml | 2 +- build_in_docker.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build3.yml b/.github/workflows/build3.yml index d8e23d78..78aba10d 100644 --- a/.github/workflows/build3.yml +++ b/.github/workflows/build3.yml @@ -54,7 +54,7 @@ jobs: --patchset1Repo="git://github.com/AdityaGarg8/5.10-patches.git" \ --patchset1Branch=main \ --patchset1Commit=1544718ff8282e75bbade89faebcb3ac45e5434a \ - --patchset1Filter="grep -vE '0001'" \ + --patchset1Filter="grep -vE '000[0-9]'" \ --releaseSuffix=t2-hwe \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts diff --git a/build_in_docker.sh b/build_in_docker.sh index 408e5e35..b1fc5e6c 100755 --- a/build_in_docker.sh +++ b/build_in_docker.sh @@ -53,7 +53,7 @@ docker run \ --releasePath=/repo/.build/t2-aunali1-patched \ " # jamlam -VERSION=$(ubuntu-mainline-kernel.sh -r v5.12 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) +VERSION=$(ubuntu-mainline-kernel.sh -r v5.13 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) docker run \ -t \ --rm \ @@ -114,7 +114,7 @@ docker run \ --patchset1Repo='git://github.com/AdityaGarg8/5.10-patches.git' \ --patchset1Branch=main \ --patchset1Commit=1544718ff8282e75bbade89faebcb3ac45e5434a \ - --patchset1Filter=\"grep -vE '0001'\" \ + --patchset1Filter=\"grep -vE '000[0-9]'\" \ --releaseSuffix=t2-hwe \ --releasePath=/repo/.build/t2-hwe \ " From 11fe26b0b6a1a49ef8da88d76f8e09a4b3e2473d Mon Sep 17 00:00:00 2001 From: marcosfad Date: Sun, 29 Aug 2021 19:40:13 +0200 Subject: [PATCH 06/18] Fix patches in HWE --- .github/workflows/build1.yml | 2 - .github/workflows/build2.yml | 4 +- .github/workflows/build3.yml | 90 ++++++++++++++++++++++++++++++++++-- .gitignore | 2 +- build_in_docker.sh | 39 ++++++++++++---- 5 files changed, 117 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build1.yml b/.github/workflows/build1.yml index fa0061cf..79c6ddc9 100644 --- a/.github/workflows/build1.yml +++ b/.github/workflows/build1.yml @@ -68,7 +68,6 @@ jobs: - name: Upload package artifact uses: actions/upload-artifact@v2 with: - name: linux-${{ steps.variables.outputs.tag }} path: /tmp/artifacts/* - name: Release @@ -155,7 +154,6 @@ jobs: - name: Upload package artifact uses: actions/upload-artifact@v2 with: - name: linux-${{ steps.variables.outputs.tag }} path: /tmp/artifacts/* - name: Release diff --git a/.github/workflows/build2.yml b/.github/workflows/build2.yml index 30cbd28c..b8ebd648 100644 --- a/.github/workflows/build2.yml +++ b/.github/workflows/build2.yml @@ -57,7 +57,7 @@ jobs: --patchset1Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ --patchset1Branch=main \ --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset1Filter="grep -vE '0001|800[0-9]'" \ + --patchset1Filter="grep -vE '0001'" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts @@ -69,7 +69,6 @@ jobs: - name: Upload package artifact uses: actions/upload-artifact@v2 with: - name: linux-${{ steps.variables.outputs.tag }} path: /tmp/artifacts/* - name: Release @@ -156,7 +155,6 @@ jobs: - name: Upload package artifact uses: actions/upload-artifact@v2 with: - name: linux-${{ steps.variables.outputs.tag }} path: /tmp/artifacts/* - name: Release diff --git a/.github/workflows/build3.yml b/.github/workflows/build3.yml index 78aba10d..0daa38e4 100644 --- a/.github/workflows/build3.yml +++ b/.github/workflows/build3.yml @@ -34,7 +34,7 @@ jobs: id: variables run: | VERSION=5.11.0 - RELEASE_SUFFIX=t2 + RELEASE_SUFFIX=t2-hwe REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) echo "::set-output name=version::${VERSION}" echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" @@ -48,13 +48,13 @@ jobs: echo Building ${{ steps.variables.outputs.tag }} sudo ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ - --kernelBranch="hwe-5.11" \ + --kernelBranch="Ubuntu-hwe-5.11-5.11.0-34.36_20.04.1" \ --kernelRepository="git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal" \ --debianSaucePatches=no \ --patchset1Repo="git://github.com/AdityaGarg8/5.10-patches.git" \ --patchset1Branch=main \ - --patchset1Commit=1544718ff8282e75bbade89faebcb3ac45e5434a \ - --patchset1Filter="grep -vE '000[0-9]'" \ + --patchset1Commit=c7507079923dbae525af591d0a680e6960ce769c \ + --patchset1Filter="grep -vE '0001'" \ --releaseSuffix=t2-hwe \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts @@ -66,7 +66,6 @@ jobs: - name: Upload package artifact uses: actions/upload-artifact@v2 with: - name: linux-mbp-${{ steps.variables.outputs.tag }} path: /tmp/artifacts/* - name: Release @@ -103,3 +102,84 @@ jobs: https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests env: TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} + + build-hwe-next: + needs: [lint] + runs-on: ubuntu-20.04 + steps: + - name: 'Checkout Repo' + uses: actions/checkout@v2 + + - name: find latest release + id: variables + run: | + VERSION=5.13.0 + RELEASE_SUFFIX=t2-hwe-next + REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) + echo "::set-output name=version::${VERSION}" + echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" + echo "::set-output name=tag::${VERSION}-${RELEASE_SUFFIX}-${REL}" + + - name: Build script + id: build + run: | + rm -rf /tmp/artifacts + mkdir /tmp/artifacts + echo Building ${{ steps.variables.outputs.tag }} + sudo ./build.sh \ + --kernel=${{ steps.variables.outputs.version }} \ + --kernelBranch="Ubuntu-hwe-5.13-5.13.0-14.14_20.04.2" \ + --kernelRepository="git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal" \ + --debianSaucePatches=no \ + --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ + --patchset1Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ + --patchset1Branch=main \ + --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ + --patchset1Filter="grep -vE '0001'" \ + --releaseSuffix=t2-hwe-next \ + --releasePath=/tmp/artifacts + sudo chmod 777 -R /tmp/artifacts + cd /tmp/artifacts + ls -l + dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz + ls -l + + - name: Upload package artifact + uses: actions/upload-artifact@v2 + with: + path: /tmp/artifacts/* + + - name: Release + if: | + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/heads/release/') + uses: softprops/action-gh-release@v1 + with: + body: | + Ubuntu HWE Next + Patchsets: + https://github.com/jamlam/mbp-16.1-linux-wifi + files: | + /tmp/artifacts/Packages.gz + /tmp/artifacts/sha256 + /tmp/artifacts/*.deb + tag_name: v${{ steps.variables.outputs.tag }} + draft: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish Kernel + if: | + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/heads/release/') + run: | + PAYLOAD='{"request": {"branch":"master","sha":"9c060e2ebc7564921e28632232131e1dd80ce679"}}' + curl -sSf -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Travis-API-Version: 3" \ + -H "Authorization: token ${TRAVIS_TOKEN}" \ + -d "{\"request\": {${PAYLOAD}}}" \ + https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests + env: + TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} diff --git a/.gitignore b/.gitignore index e28dea1e..a0cbf3c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /patches/custom-drivers.patch /releases /linux-* -/.idea \ No newline at end of file +/.ideabuild diff --git a/build_in_docker.sh b/build_in_docker.sh index b1fc5e6c..03739952 100755 --- a/build_in_docker.sh +++ b/build_in_docker.sh @@ -27,7 +27,7 @@ docker run \ --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ --patchset1Filter=\"grep -vE '000[0-9]'\" \ --releaseSuffix=t2-aunali1 \ - --releasePath=/repo/.build/t2-aunali1 \ + --releasePath=/repo/build/t2-aunali1 \ " docker run \ -t \ @@ -50,7 +50,7 @@ docker run \ --patchset2Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ --patchset2Filter=\"grep -E '8001'\" \ --releaseSuffix=t2-aunali1-patched \ - --releasePath=/repo/.build/t2-aunali1-patched \ + --releasePath=/repo/build/t2-aunali1-patched \ " # jamlam VERSION=$(ubuntu-mainline-kernel.sh -r v5.13 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) @@ -71,7 +71,7 @@ docker run \ --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ --patchset1Filter=\"grep -vE '0001|800[0-9]'\" \ --releaseSuffix=t2-jamlam \ - --releasePath=/repo/.build/t2-jamlam \ + --releasePath=/repo/build/t2-jamlam \ " docker run \ @@ -94,7 +94,8 @@ docker run \ --patchset2Branch=master \ --patchset2Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ --patchset2Filter=\"grep -E 'brcmfmac'\" \ - --releasePath=/repo/.build/t2-jamlam-patched \ + --releaseSuffix=t2-jamlam-patched + --releasePath=/repo/build/t2-jamlam-patched \ " # HWE @@ -107,14 +108,34 @@ docker run \ cd /repo \ && \ ./build.sh \ - --kernel=${{ steps.variables.outputs.version }} \ - --kernelBranch=hwe-5.11 \ + --kernel=5.11.0 \ + --kernelBranch=Ubuntu-hwe-5.11-5.11.0-34.36_20.04.1 \ --kernelRepository='git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal' \ --debianSaucePatches=no \ --patchset1Repo='git://github.com/AdityaGarg8/5.10-patches.git' \ --patchset1Branch=main \ - --patchset1Commit=1544718ff8282e75bbade89faebcb3ac45e5434a \ - --patchset1Filter=\"grep -vE '000[0-9]'\" \ + --patchset1Commit=e509d58d4127ecd9c17292560f10fc089f1ad030 \ + --patchset1Filter=\"grep -vE '0001'\" \ --releaseSuffix=t2-hwe \ - --releasePath=/repo/.build/t2-hwe \ + --releasePath=/repo/build/t2-hwe \ +" +docker run \ + -t \ + --rm \ + -v "$(pwd)":/repo \ + ${DOCKER_IMAGE} \ + /bin/bash -c "\ + cd /repo \ + && \ + ./build.sh \ + --kernel=5.13.0 \ + --kernelBranch=Ubuntu-hwe-5.13-5.13.0-14.14_20.04.2 \ + --kernelRepository='git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal' \ + --debianSaucePatches=no \ + --patchset1Repo=git://github.com/jamlam/mbp-16.1-linux-wifi.git \ + --patchset1Branch=main \ + --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ + --patchset1Filter=\"grep -vE '0001'\" \ + --releaseSuffix=t2-hwe-next \ + --releasePath=/repo/build/t2-hwe-next \ " From 273aa607db25efb64c29d0c37b757ee42516dd9b Mon Sep 17 00:00:00 2001 From: marcosfad Date: Sun, 29 Aug 2021 21:41:13 +0200 Subject: [PATCH 07/18] Fix error in dynamic grep command --- .github/workflows/build1.yml | 6 +++--- .github/workflows/build2.yml | 6 +++--- .github/workflows/build3.yml | 4 ++-- build.sh | 2 +- build_in_docker.sh | 20 ++++++++++---------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build1.yml b/.github/workflows/build1.yml index 79c6ddc9..90fd0005 100644 --- a/.github/workflows/build1.yml +++ b/.github/workflows/build1.yml @@ -56,7 +56,7 @@ jobs: --patchset1Repo="git://github.com/aunali1/linux-mbp-arch.git" \ --patchset1Branch=master \ --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ - --patchset1Filter="grep -vE '000[0-9]'" \ + --patchset1Filter="grep -vE 000[0-9]" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts @@ -138,11 +138,11 @@ jobs: --patchset1Repo="git://github.com/aunali1/linux-mbp-arch.git" \ --patchset1Branch=master \ --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ - --patchset1Filter="grep -vE '000[0-9]'" \ + --patchset1Filter="grep -vE 000[0-9]" \ --patchset2Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ --patchset2Branch=main \ --patchset2Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset2Filter="grep -E '8001'" \ + --patchset2Filter="grep -E 8001" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts diff --git a/.github/workflows/build2.yml b/.github/workflows/build2.yml index b8ebd648..42326b93 100644 --- a/.github/workflows/build2.yml +++ b/.github/workflows/build2.yml @@ -57,7 +57,7 @@ jobs: --patchset1Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ --patchset1Branch=main \ --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset1Filter="grep -vE '0001'" \ + --patchset1Filter="grep -vE 0001" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts @@ -139,11 +139,11 @@ jobs: --patchset1Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ --patchset1Branch=main \ --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset1Filter="grep -vE '0001|800[0-9]'" \ + --patchset1Filter="grep -vE 0001|800[0-9]" \ --patchset2Repo="git://github.com/aunali1/linux-mbp-arch.git" \ --patchset2Branch=master \ --patchset2Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ - --patchset2Filter="grep -E 'brcmfmac'" \ + --patchset2Filter="grep -E brcmfmac" \ --releaseSuffix=${{ steps.variables.outputs.version }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts diff --git a/.github/workflows/build3.yml b/.github/workflows/build3.yml index 0daa38e4..97f62f74 100644 --- a/.github/workflows/build3.yml +++ b/.github/workflows/build3.yml @@ -54,7 +54,7 @@ jobs: --patchset1Repo="git://github.com/AdityaGarg8/5.10-patches.git" \ --patchset1Branch=main \ --patchset1Commit=c7507079923dbae525af591d0a680e6960ce769c \ - --patchset1Filter="grep -vE '0001'" \ + --patchset1Filter="grep -vE 0001" \ --releaseSuffix=t2-hwe \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts @@ -135,7 +135,7 @@ jobs: --patchset1Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ --patchset1Branch=main \ --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset1Filter="grep -vE '0001'" \ + --patchset1Filter="grep -vE 0001" \ --releaseSuffix=t2-hwe-next \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts diff --git a/build.sh b/build.sh index af4b4d0a..bf246b96 100755 --- a/build.sh +++ b/build.sh @@ -89,7 +89,7 @@ get_next_version() { ### Clean up rm -rfv ./*.deb rm -rf "${KERNEL_PATH}" -rm -rf "${PATCHES_PATH}" +rm -rf "${PATCHES_PATH}" "${PATCHSET_1_GIT_PATH}" "${PATCHSET_2_GIT_PATH}" rm -rf "${RELEASE_PATH}" mkdir -p "${WORKING_PATH}" && cd "${WORKING_PATH}" diff --git a/build_in_docker.sh b/build_in_docker.sh index 03739952..74c6c382 100755 --- a/build_in_docker.sh +++ b/build_in_docker.sh @@ -25,7 +25,7 @@ docker run \ --patchset1Repo='git://github.com/aunali1/linux-mbp-arch.git' \ --patchset1Branch=master \ --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ - --patchset1Filter=\"grep -vE '000[0-9]'\" \ + --patchset1Filter=\"grep -vE 000[0-9]\" \ --releaseSuffix=t2-aunali1 \ --releasePath=/repo/build/t2-aunali1 \ " @@ -44,15 +44,15 @@ docker run \ --patchset1Repo='git://github.com/aunali1/linux-mbp-arch.git' \ --patchset1Branch=master \ --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ - --patchset1Filter=\"grep -vE '000[0-9]'\" \ + --patchset1Filter=\"grep -vE 000[0-9]\" \ --patchset2Repo='git://github.com/jamlam/mbp-16.1-linux-wifi.git' \ --patchset2Branch=main \ --patchset2Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset2Filter=\"grep -E '8001'\" \ + --patchset2Filter=\"grep -E 8001\" \ --releaseSuffix=t2-aunali1-patched \ --releasePath=/repo/build/t2-aunali1-patched \ " -# jamlam +## jamlam VERSION=$(ubuntu-mainline-kernel.sh -r v5.13 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) docker run \ -t \ @@ -69,7 +69,7 @@ docker run \ --patchset1Repo='git://github.com/jamlam/mbp-16.1-linux-wifi.git' \ --patchset1Branch=main \ --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset1Filter=\"grep -vE '0001|800[0-9]'\" \ + --patchset1Filter=\"grep -vE 0001|800[0-9]\" \ --releaseSuffix=t2-jamlam \ --releasePath=/repo/build/t2-jamlam \ " @@ -89,11 +89,11 @@ docker run \ --patchset1Repo='git://github.com/jamlam/mbp-16.1-linux-wifi.git' \ --patchset1Branch=main \ --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset1Filter=\"grep -vE '0001|800[0-9]'\" \ + --patchset1Filter=\"grep -vE 0001|800[0-9]\" \ --patchset2Repo='git://github.com/aunali1/linux-mbp-arch.git' \ --patchset2Branch=master \ --patchset2Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ - --patchset2Filter=\"grep -E 'brcmfmac'\" \ + --patchset2Filter=\"grep -E brcmfmac\" \ --releaseSuffix=t2-jamlam-patched --releasePath=/repo/build/t2-jamlam-patched \ " @@ -115,7 +115,7 @@ docker run \ --patchset1Repo='git://github.com/AdityaGarg8/5.10-patches.git' \ --patchset1Branch=main \ --patchset1Commit=e509d58d4127ecd9c17292560f10fc089f1ad030 \ - --patchset1Filter=\"grep -vE '0001'\" \ + --patchset1Filter=\"grep -vE 0001\" \ --releaseSuffix=t2-hwe \ --releasePath=/repo/build/t2-hwe \ " @@ -132,10 +132,10 @@ docker run \ --kernelBranch=Ubuntu-hwe-5.13-5.13.0-14.14_20.04.2 \ --kernelRepository='git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal' \ --debianSaucePatches=no \ - --patchset1Repo=git://github.com/jamlam/mbp-16.1-linux-wifi.git \ + --patchset1Repo='git://github.com/jamlam/mbp-16.1-linux-wifi.git' \ --patchset1Branch=main \ --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset1Filter=\"grep -vE '0001'\" \ + --patchset1Filter=\"grep -vE 0001\" \ --releaseSuffix=t2-hwe-next \ --releasePath=/repo/build/t2-hwe-next \ " From f37d99a1af5cadec9a74884acad0e7455c5dcb5b Mon Sep 17 00:00:00 2001 From: marcosfad Date: Sun, 29 Aug 2021 22:40:27 +0200 Subject: [PATCH 08/18] Fix wrong version suffix --- .github/workflows/build1.yml | 6 ++++-- .github/workflows/build2.yml | 6 ++++-- .github/workflows/build3.yml | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build1.yml b/.github/workflows/build1.yml index 90fd0005..6ca9f330 100644 --- a/.github/workflows/build1.yml +++ b/.github/workflows/build1.yml @@ -57,7 +57,7 @@ jobs: --patchset1Branch=master \ --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ --patchset1Filter="grep -vE 000[0-9]" \ - --releaseSuffix=${{ steps.variables.outputs.version }} \ + --releaseSuffix=${{ steps.variables.outputs.releaseSuffix }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts @@ -68,6 +68,7 @@ jobs: - name: Upload package artifact uses: actions/upload-artifact@v2 with: + name: linux-${{ steps.variables.outputs.tag }} path: /tmp/artifacts/* - name: Release @@ -143,7 +144,7 @@ jobs: --patchset2Branch=main \ --patchset2Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ --patchset2Filter="grep -E 8001" \ - --releaseSuffix=${{ steps.variables.outputs.version }} \ + --releaseSuffix=${{ steps.variables.outputs.releaseSuffix }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts @@ -154,6 +155,7 @@ jobs: - name: Upload package artifact uses: actions/upload-artifact@v2 with: + name: linux-${{ steps.variables.outputs.tag }} path: /tmp/artifacts/* - name: Release diff --git a/.github/workflows/build2.yml b/.github/workflows/build2.yml index 42326b93..25b8bddb 100644 --- a/.github/workflows/build2.yml +++ b/.github/workflows/build2.yml @@ -58,7 +58,7 @@ jobs: --patchset1Branch=main \ --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ --patchset1Filter="grep -vE 0001" \ - --releaseSuffix=${{ steps.variables.outputs.version }} \ + --releaseSuffix=${{ steps.variables.outputs.releaseSuffix }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts @@ -69,6 +69,7 @@ jobs: - name: Upload package artifact uses: actions/upload-artifact@v2 with: + name: linux-${{ steps.variables.outputs.tag }} path: /tmp/artifacts/* - name: Release @@ -144,7 +145,7 @@ jobs: --patchset2Branch=master \ --patchset2Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ --patchset2Filter="grep -E brcmfmac" \ - --releaseSuffix=${{ steps.variables.outputs.version }} \ + --releaseSuffix=${{ steps.variables.outputs.releaseSuffix }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts @@ -155,6 +156,7 @@ jobs: - name: Upload package artifact uses: actions/upload-artifact@v2 with: + name: linux-${{ steps.variables.outputs.tag }} path: /tmp/artifacts/* - name: Release diff --git a/.github/workflows/build3.yml b/.github/workflows/build3.yml index 97f62f74..c5ebc906 100644 --- a/.github/workflows/build3.yml +++ b/.github/workflows/build3.yml @@ -55,7 +55,7 @@ jobs: --patchset1Branch=main \ --patchset1Commit=c7507079923dbae525af591d0a680e6960ce769c \ --patchset1Filter="grep -vE 0001" \ - --releaseSuffix=t2-hwe \ + --releaseSuffix=${{ steps.variables.outputs.releaseSuffix }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts @@ -66,6 +66,7 @@ jobs: - name: Upload package artifact uses: actions/upload-artifact@v2 with: + name: linux-mbp-${{ steps.variables.outputs.tag }} path: /tmp/artifacts/* - name: Release @@ -136,7 +137,7 @@ jobs: --patchset1Branch=main \ --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ --patchset1Filter="grep -vE 0001" \ - --releaseSuffix=t2-hwe-next \ + --releaseSuffix=${{ steps.variables.outputs.releaseSuffix }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts cd /tmp/artifacts @@ -147,6 +148,7 @@ jobs: - name: Upload package artifact uses: actions/upload-artifact@v2 with: + name: linux-mbp-${{ steps.variables.outputs.tag }} path: /tmp/artifacts/* - name: Release From aaf49bf4d70f8edff1778e602b069673508340e1 Mon Sep 17 00:00:00 2001 From: marcosfad Date: Mon, 30 Aug 2021 00:02:57 +0200 Subject: [PATCH 09/18] Fix wrong patch --- .github/workflows/build1.yml | 4 ++-- .github/workflows/build3.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build1.yml b/.github/workflows/build1.yml index 6ca9f330..3169e87a 100644 --- a/.github/workflows/build1.yml +++ b/.github/workflows/build1.yml @@ -142,8 +142,8 @@ jobs: --patchset1Filter="grep -vE 000[0-9]" \ --patchset2Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ --patchset2Branch=main \ - --patchset2Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset2Filter="grep -E 8001" \ + --patchset2Commit=4c8b393ed7a874e3d9e44a2a467c1b7c74af1260 \ + --patchset2Filter="grep -E wifi-bigsur" \ --releaseSuffix=${{ steps.variables.outputs.releaseSuffix }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts diff --git a/.github/workflows/build3.yml b/.github/workflows/build3.yml index c5ebc906..15ae987c 100644 --- a/.github/workflows/build3.yml +++ b/.github/workflows/build3.yml @@ -48,7 +48,7 @@ jobs: echo Building ${{ steps.variables.outputs.tag }} sudo ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ - --kernelBranch="Ubuntu-hwe-5.11-5.11.0-34.36_20.04.1" \ + --kernelBranch="hwe-5.11" \ --kernelRepository="git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal" \ --debianSaucePatches=no \ --patchset1Repo="git://github.com/AdityaGarg8/5.10-patches.git" \ @@ -129,7 +129,7 @@ jobs: echo Building ${{ steps.variables.outputs.tag }} sudo ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ - --kernelBranch="Ubuntu-hwe-5.13-5.13.0-14.14_20.04.2" \ + --kernelBranch="hwe-5.13" \ --kernelRepository="git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal" \ --debianSaucePatches=no \ --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ From e2328214a07705bf313bae81448c954570fbde0c Mon Sep 17 00:00:00 2001 From: marcosfad Date: Thu, 2 Sep 2021 21:52:34 +0200 Subject: [PATCH 10/18] Fix duplicate arguments --- .github/workflows/build3.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build3.yml b/.github/workflows/build3.yml index 15ae987c..038e1e3b 100644 --- a/.github/workflows/build3.yml +++ b/.github/workflows/build3.yml @@ -132,7 +132,6 @@ jobs: --kernelBranch="hwe-5.13" \ --kernelRepository="git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal" \ --debianSaucePatches=no \ - --kernelRepository="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" \ --patchset1Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ --patchset1Branch=main \ --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ From af07edb478bc2ca62f17d6f28c02ca9fdd7abffa Mon Sep 17 00:00:00 2001 From: marcosfad Date: Thu, 2 Sep 2021 23:36:21 +0200 Subject: [PATCH 11/18] Improve naming and fix wrong params --- .../{build1.yml => buildAunalis.yml} | 14 ++++---- .../{build3.yml => buildHweJamlam.yml} | 4 +-- .../workflows/{build2.yml => buildJamlam.yml} | 12 +++---- build.sh | 35 +++++++++---------- build_in_docker.sh | 28 +++++++-------- 5 files changed, 45 insertions(+), 48 deletions(-) rename .github/workflows/{build1.yml => buildAunalis.yml} (95%) rename .github/workflows/{build3.yml => buildHweJamlam.yml} (97%) rename .github/workflows/{build2.yml => buildJamlam.yml} (96%) diff --git a/.github/workflows/build1.yml b/.github/workflows/buildAunalis.yml similarity index 95% rename from .github/workflows/build1.yml rename to .github/workflows/buildAunalis.yml index 3169e87a..86b20f5f 100644 --- a/.github/workflows/build1.yml +++ b/.github/workflows/buildAunalis.yml @@ -23,7 +23,7 @@ jobs: yamllint . shellcheck ./*.sh - build-latest-aunali1: + build-aunali1-mojave: needs: [lint] runs-on: ubuntu-20.04 steps: @@ -37,7 +37,7 @@ jobs: wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh chmod +x ubuntu-mainline-kernel.sh VERSION=$(./ubuntu-mainline-kernel.sh -r v5.12 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) - RELEASE_SUFFIX=t2-aunali1 + RELEASE_SUFFIX=t2-aunali1-mojave REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) echo "::set-output name=version::${VERSION}" echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" @@ -78,7 +78,7 @@ jobs: uses: softprops/action-gh-release@v1 with: body: | - Linux official kernel. + Linux official kernel. Requires Mojave WiFi drivers. Patchsets: https://github.com/aunali1/linux-mbp-arch excluding 0001 to 0009 files: | @@ -106,7 +106,7 @@ jobs: env: TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} - build-latest-aunali1-jamlam: + build-aunali1-bigsur: needs: [lint] runs-on: ubuntu-20.04 steps: @@ -120,7 +120,7 @@ jobs: wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh chmod +x ubuntu-mainline-kernel.sh VERSION=$(./ubuntu-mainline-kernel.sh -r v5.12 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) - RELEASE_SUFFIX=t2-aunali1-patched + RELEASE_SUFFIX=t2-aunali1-bigsur REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) echo "::set-output name=version::${VERSION}" echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" @@ -139,7 +139,7 @@ jobs: --patchset1Repo="git://github.com/aunali1/linux-mbp-arch.git" \ --patchset1Branch=master \ --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ - --patchset1Filter="grep -vE 000[0-9]" \ + --patchset1Filter="grep -vE 000[0-9] | grep -vE brcmfmac" \ --patchset2Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ --patchset2Branch=main \ --patchset2Commit=4c8b393ed7a874e3d9e44a2a467c1b7c74af1260 \ @@ -165,7 +165,7 @@ jobs: uses: softprops/action-gh-release@v1 with: body: | - Linux official kernel. + Linux official kernel. Requires Big Sur WiFi drivers. Patchsets: https://github.com/aunali1/linux-mbp-arch excluding 0001 to 0009 https://github.com/jamlam/mbp-16.1-linux-wifi only 8001 diff --git a/.github/workflows/build3.yml b/.github/workflows/buildHweJamlam.yml similarity index 97% rename from .github/workflows/build3.yml rename to .github/workflows/buildHweJamlam.yml index 038e1e3b..30e75ccd 100644 --- a/.github/workflows/build3.yml +++ b/.github/workflows/buildHweJamlam.yml @@ -76,7 +76,7 @@ jobs: uses: softprops/action-gh-release@v1 with: body: | - Ubuntu HWE + Linux Ubuntu HWE Kernel. Requires Big Sur WiFi drivers. Patchsets: https://github.com/AdityaGarg8/5.10-patches files: | @@ -157,7 +157,7 @@ jobs: uses: softprops/action-gh-release@v1 with: body: | - Ubuntu HWE Next + Linux Ubuntu HWE-Next Kernel. Requires Big Sur WiFi drivers. Patchsets: https://github.com/jamlam/mbp-16.1-linux-wifi files: | diff --git a/.github/workflows/build2.yml b/.github/workflows/buildJamlam.yml similarity index 96% rename from .github/workflows/build2.yml rename to .github/workflows/buildJamlam.yml index 25b8bddb..918ff01b 100644 --- a/.github/workflows/build2.yml +++ b/.github/workflows/buildJamlam.yml @@ -24,7 +24,7 @@ jobs: shellcheck ./*.sh - build-latest-jamlam: + build-jamlam-bigsur: needs: [lint] runs-on: ubuntu-20.04 steps: @@ -38,7 +38,7 @@ jobs: wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh chmod +x ubuntu-mainline-kernel.sh VERSION=$(./ubuntu-mainline-kernel.sh -r v5.13 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) - RELEASE_SUFFIX=t2-jamlam + RELEASE_SUFFIX=t2-jamlam-bigsur REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) echo "::set-output name=version::${VERSION}" echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" @@ -79,7 +79,7 @@ jobs: uses: softprops/action-gh-release@v1 with: body: | - Linux official kernel. + Linux official kernel. Requires Big Sur WiFi drivers. Patchsets: https://github.com/jamlam/mbp-16.1-linux-wifi excluding 0001 files: | @@ -107,7 +107,7 @@ jobs: env: TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} - build-latest-jamlam-aunali1: + build-jamlam-mojave: needs: [lint] runs-on: ubuntu-20.04 steps: @@ -121,7 +121,7 @@ jobs: wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh chmod +x ubuntu-mainline-kernel.sh VERSION=$(./ubuntu-mainline-kernel.sh -r v5.13 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) - RELEASE_SUFFIX=t2-jamlam-patched + RELEASE_SUFFIX=t2-jamlam-mojave REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) echo "::set-output name=version::${VERSION}" echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" @@ -166,7 +166,7 @@ jobs: uses: softprops/action-gh-release@v1 with: body: | - Linux official kernel. + Linux official kernel. Requires Mojave WiFi drivers. Patchsets: https://github.com/jamlam/mbp-16.1-linux-wifi excluding 0001 and 8001 to 8009 https://github.com/aunali1/linux-mbp-arch only including *brcmfmac* diff --git a/build.sh b/build.sh index bf246b96..4ffcd29e 100755 --- a/build.sh +++ b/build.sh @@ -113,47 +113,44 @@ git clone --depth 1 --single-branch --branch "${KERNEL_BRANCH}" \ "${KERNEL_REPOSITORY}" "${KERNEL_PATH}" cd "${KERNEL_PATH}" || exit -#### Create patch file with custom drivers -echo >&2 "===]> Info: Creating patch file... " -cd "${PATCHES_PATH}" || exit +#### Patches +echo >&2 "===]> Info: Adding Debian sauce patches... " +if [ "$debianSaucePatches" != "no" ]; then + while IFS= read -r file; do + echo "==> Adding $file" + patch -p1 <"$file" + done < <(find "${PATCHES_PATH}" -type f -name "*.patch" | sort) +fi ### Patchset 1 +echo >&2 "===]> Info: Adding patchset 1 ... " git clone --single-branch --branch ${PATCHSET_1_BRANCH} ${PATCHSET_1_URL} \ "${PATCHSET_1_GIT_PATH}" cd "${PATCHSET_1_GIT_PATH}" || exit git checkout ${PATCHSET_1_HASH} +cd "${KERNEL_PATH}" || exit while IFS= read -r file; do echo "==> Adding ${file}" - cp -rfv "${file}" "${PATCHES_PATH}/${file##*/}" + patch -p1 <"$file" done < <(find "${PATCHSET_1_GIT_PATH}" -type f -name "*.patch" | ${PATCHSET_1_FILTER} | sort) -### Patchset 2 +### Patchset 2 (optional) if [ "$PATCHSET_2_BRANCH" != "" ]; then + echo >&2 "===]> Info: Adding patchset 2 ... " git clone --single-branch --branch ${PATCHSET_2_BRANCH} ${PATCHSET_2_URL} \ "${PATCHSET_2_GIT_PATH}" cd "${PATCHSET_2_GIT_PATH}" || exit git checkout ${PATCHSET_2_HASH} + cd "${KERNEL_PATH}" || exit while IFS= read -r file; do echo "==> Adding ${file}" - cp -rfv "${file}" "${PATCHES_PATH}/${file##*/}" + patch -p1 <"$file" done < <(find "${PATCHSET_2_GIT_PATH}" -type f -name "*.patch" | ${PATCHSET_2_FILTER} | sort) fi -#### Apply patches -cd "${KERNEL_PATH}" || exit - -echo >&2 "===]> Info: Applying patches... " -[ ! -d "${PATCHES_PATH}" ] && { - echo 'Patches directory not found!' - exit 1 -} -echo "find ${PATCHES_PATH} -type f -name *.patch | sort" -while IFS= read -r file; do - echo "==> Adding $file" - patch -p1 <"$file" -done < <(find "${PATCHES_PATH}" -type f -name "*.patch" | sort) +### Build process chmod a+x "${KERNEL_PATH}"/debian/rules chmod a+x "${KERNEL_PATH}"/debian/scripts/* chmod a+x "${KERNEL_PATH}"/debian/scripts/misc/* diff --git a/build_in_docker.sh b/build_in_docker.sh index 74c6c382..3f983c63 100755 --- a/build_in_docker.sh +++ b/build_in_docker.sh @@ -26,8 +26,8 @@ docker run \ --patchset1Branch=master \ --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ --patchset1Filter=\"grep -vE 000[0-9]\" \ - --releaseSuffix=t2-aunali1 \ - --releasePath=/repo/build/t2-aunali1 \ + --releaseSuffix=t2-aunali1-mojave \ + --releasePath=/repo/build/t2-aunali1-mojave \ " docker run \ -t \ @@ -44,13 +44,13 @@ docker run \ --patchset1Repo='git://github.com/aunali1/linux-mbp-arch.git' \ --patchset1Branch=master \ --patchset1Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ - --patchset1Filter=\"grep -vE 000[0-9]\" \ + --patchset1Filter=\"grep -vE 000[0-9] | grep -vE brcmfmac\" \ --patchset2Repo='git://github.com/jamlam/mbp-16.1-linux-wifi.git' \ --patchset2Branch=main \ - --patchset2Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset2Filter=\"grep -E 8001\" \ - --releaseSuffix=t2-aunali1-patched \ - --releasePath=/repo/build/t2-aunali1-patched \ + --patchset2Commit=4c8b393ed7a874e3d9e44a2a467c1b7c74af1260 \ + --patchset2Filter=\"grep -E wifi-bigsur\" \ + --releaseSuffix=t2-aunali1-bigSur \ + --releasePath=/repo/build/t2-aunali1-bigsur \ " ## jamlam VERSION=$(ubuntu-mainline-kernel.sh -r v5.13 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) @@ -69,9 +69,9 @@ docker run \ --patchset1Repo='git://github.com/jamlam/mbp-16.1-linux-wifi.git' \ --patchset1Branch=main \ --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset1Filter=\"grep -vE 0001|800[0-9]\" \ - --releaseSuffix=t2-jamlam \ - --releasePath=/repo/build/t2-jamlam \ + --patchset1Filter=\"grep -vE 0001\" \ + --releaseSuffix=t2-jamlam-bigsur \ + --releasePath=/repo/build/t2-jamlam-bigsur \ " docker run \ @@ -94,8 +94,8 @@ docker run \ --patchset2Branch=master \ --patchset2Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ --patchset2Filter=\"grep -E brcmfmac\" \ - --releaseSuffix=t2-jamlam-patched - --releasePath=/repo/build/t2-jamlam-patched \ + --releaseSuffix=t2-jamlam-mojave + --releasePath=/repo/build/t2-jamlam-mojave \ " # HWE @@ -109,7 +109,7 @@ docker run \ && \ ./build.sh \ --kernel=5.11.0 \ - --kernelBranch=Ubuntu-hwe-5.11-5.11.0-34.36_20.04.1 \ + --kernelBranch=hwe-5.11 \ --kernelRepository='git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal' \ --debianSaucePatches=no \ --patchset1Repo='git://github.com/AdityaGarg8/5.10-patches.git' \ @@ -129,7 +129,7 @@ docker run \ && \ ./build.sh \ --kernel=5.13.0 \ - --kernelBranch=Ubuntu-hwe-5.13-5.13.0-14.14_20.04.2 \ + --kernelBranch=hwe-5.13 \ --kernelRepository='git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal' \ --debianSaucePatches=no \ --patchset1Repo='git://github.com/jamlam/mbp-16.1-linux-wifi.git' \ From 14f224a352686f6d738901bef8b35e09e9a80d5f Mon Sep 17 00:00:00 2001 From: marcosfad Date: Fri, 3 Sep 2021 12:07:11 +0200 Subject: [PATCH 12/18] Rename kernels --- .github/workflows/buildAunalis.yml | 8 ++++---- .github/workflows/buildHweJamlam.yml | 26 +++++++++++++++----------- .github/workflows/buildJamlam.yml | 6 +++--- .gitignore | 1 + 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/.github/workflows/buildAunalis.yml b/.github/workflows/buildAunalis.yml index 86b20f5f..a70f88e7 100644 --- a/.github/workflows/buildAunalis.yml +++ b/.github/workflows/buildAunalis.yml @@ -23,7 +23,7 @@ jobs: yamllint . shellcheck ./*.sh - build-aunali1-mojave: + build-a-mojave: needs: [lint] runs-on: ubuntu-20.04 steps: @@ -37,7 +37,7 @@ jobs: wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh chmod +x ubuntu-mainline-kernel.sh VERSION=$(./ubuntu-mainline-kernel.sh -r v5.12 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) - RELEASE_SUFFIX=t2-aunali1-mojave + RELEASE_SUFFIX=t2-a-mojave REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) echo "::set-output name=version::${VERSION}" echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" @@ -106,7 +106,7 @@ jobs: env: TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} - build-aunali1-bigsur: + build-a-bigsur: needs: [lint] runs-on: ubuntu-20.04 steps: @@ -120,7 +120,7 @@ jobs: wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh chmod +x ubuntu-mainline-kernel.sh VERSION=$(./ubuntu-mainline-kernel.sh -r v5.12 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) - RELEASE_SUFFIX=t2-aunali1-bigsur + RELEASE_SUFFIX=t2-a-bigsur REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) echo "::set-output name=version::${VERSION}" echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" diff --git a/.github/workflows/buildHweJamlam.yml b/.github/workflows/buildHweJamlam.yml index 30e75ccd..f04db49a 100644 --- a/.github/workflows/buildHweJamlam.yml +++ b/.github/workflows/buildHweJamlam.yml @@ -23,7 +23,7 @@ jobs: yamllint . shellcheck ./*.sh - build-hwe-jamalam: + build-hwe-bigsur: needs: [lint] runs-on: ubuntu-20.04 steps: @@ -34,7 +34,7 @@ jobs: id: variables run: | VERSION=5.11.0 - RELEASE_SUFFIX=t2-hwe + RELEASE_SUFFIX=t2-hwe-bigsur REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) echo "::set-output name=version::${VERSION}" echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" @@ -104,7 +104,7 @@ jobs: env: TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} - build-hwe-next: + build-hwe-mojave: needs: [lint] runs-on: ubuntu-20.04 steps: @@ -114,8 +114,8 @@ jobs: - name: find latest release id: variables run: | - VERSION=5.13.0 - RELEASE_SUFFIX=t2-hwe-next + VERSION=5.11.0 + RELEASE_SUFFIX=t2-hwe-mojave REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) echo "::set-output name=version::${VERSION}" echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" @@ -129,13 +129,17 @@ jobs: echo Building ${{ steps.variables.outputs.tag }} sudo ./build.sh \ --kernel=${{ steps.variables.outputs.version }} \ - --kernelBranch="hwe-5.13" \ + --kernelBranch="hwe-5.11" \ --kernelRepository="git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal" \ --debianSaucePatches=no \ - --patchset1Repo="git://github.com/jamlam/mbp-16.1-linux-wifi.git" \ + --patchset1Repo="git://github.com/AdityaGarg8/5.10-patches.git" \ --patchset1Branch=main \ - --patchset1Commit=843ecfcaaec0a10707d447ac6d1840db940a9d29 \ - --patchset1Filter="grep -vE 0001" \ + --patchset1Commit=c7507079923dbae525af591d0a680e6960ce769c \ + --patchset1Filter="grep -vE 0001|800[0-9]" \ + --patchset2Repo="git://github.com/aunali1/linux-mbp-arch.git" \ + --patchset2Branch=master \ + --patchset2Commit=763c20a12ce19a9dc2d3421c65c9a0e328728e38 \ + --patchset2Filter="grep -E brcmfmac" \ --releaseSuffix=${{ steps.variables.outputs.releaseSuffix }} \ --releasePath=/tmp/artifacts sudo chmod 777 -R /tmp/artifacts @@ -157,9 +161,9 @@ jobs: uses: softprops/action-gh-release@v1 with: body: | - Linux Ubuntu HWE-Next Kernel. Requires Big Sur WiFi drivers. + Linux Ubuntu HWE Kernel. Requires Big Sur WiFi drivers. Patchsets: - https://github.com/jamlam/mbp-16.1-linux-wifi + https://github.com/AdityaGarg8/5.10-patches files: | /tmp/artifacts/Packages.gz /tmp/artifacts/sha256 diff --git a/.github/workflows/buildJamlam.yml b/.github/workflows/buildJamlam.yml index 918ff01b..272417f4 100644 --- a/.github/workflows/buildJamlam.yml +++ b/.github/workflows/buildJamlam.yml @@ -24,7 +24,7 @@ jobs: shellcheck ./*.sh - build-jamlam-bigsur: + build-j-bigsur: needs: [lint] runs-on: ubuntu-20.04 steps: @@ -38,7 +38,7 @@ jobs: wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh chmod +x ubuntu-mainline-kernel.sh VERSION=$(./ubuntu-mainline-kernel.sh -r v5.13 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) - RELEASE_SUFFIX=t2-jamlam-bigsur + RELEASE_SUFFIX=t2-j-bigsur REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) echo "::set-output name=version::${VERSION}" echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" @@ -121,7 +121,7 @@ jobs: wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh chmod +x ubuntu-mainline-kernel.sh VERSION=$(./ubuntu-mainline-kernel.sh -r v5.13 | grep v | rev | cut -d'v' -f 1 | rev | tail -1) - RELEASE_SUFFIX=t2-jamlam-mojave + RELEASE_SUFFIX=t2-j-mojave REL=$(./next_version.sh ${VERSION}-${RELEASE_SUFFIX}) echo "::set-output name=version::${VERSION}" echo "::set-output name=releaseSuffix::${RELEASE_SUFFIX}" diff --git a/.gitignore b/.gitignore index a0cbf3c8..bd74e9b8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /releases /linux-* /.ideabuild +.idea From 30d53fea4a4c8d4ad5efc87b252f528b89bee13c Mon Sep 17 00:00:00 2001 From: marcosfad Date: Fri, 3 Sep 2021 12:21:27 +0200 Subject: [PATCH 13/18] Improve README.md --- README.md | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 0480a16e..d3abf9ad 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,13 @@ Ubuntu/Mint/Debian kernel 5.6+ with Apple T2 patches built-in. This repo try to keep up with kernel new releases. -We release 2 alternative kernels: **"mbp"** which includes all patches from [Aunali1's linux mbp arch](https://github.com/aunali1/linux-mbp-arch) which should work in mostly everywhere and an alternative release (**"mbp-16x-wifi"**) which includes all patches from [Jamlam's mbp-16.1-linux-wifi](https://github.com/jamlam/mbp-16.1-linux-wifi) which should allow you to use the internal wifi on Macs that came with BigSur pre-installed. +We release a matrix of kernels to allow you to test with which works the best for you. The main difference are +* the source used for building the kernel: kernel.org vs Ubuntu HWE +* the patchset used ([Aunali1](https://github.com/aunali1/linux-mbp-arch) or [Jamlam](https://github.com/jamlam/mbp-16.1-linux-wifi)) and with that the combination of which wifi driver you need. (See [WiFi guide](https://wiki.t2linux.org/guides/wifi/) for more information). -**!! Note for kernel 5.7:** +I suggest always starting with the Ubuntu HWE Kernels I have great stability with them. -The releases of the kernel 5.7: The "mbp" release did not include the patch 2001 (drm amd display force link-rate) of Aunali's. The mbp-alt included all patches**. - -**!! Warning:** - -It seems, that the kernel 5.8 is not working as smooth as the 5.7 branch. If you experience problems while installing or running the linux in your mbp, try using an older Kernel. +The old type of releases are now deprecated and should not be used. **Drivers included:** @@ -22,21 +20,13 @@ This project is closely inspired by mikeeq/mbp-fedora-kernel. Thank you @mikeeq **If this repo helped you in any way, consider inviting a coffee to the people in the [credits](https://github.com/marcosfad/mbp-ubuntu-kernel#credits) or [me](https://paypal.me/marcosfad)** -## CI status - -Build status: -[![Build Kernel Package](https://github.com/marcosfad/mbp-ubuntu-kernel/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/marcosfad/mbp-ubuntu-kernel/actions/workflows/build.yml) - -Travis kernel publish to repository status - : -[![Build Status](https://travis-ci.com/marcosfad/mbp-ubuntu-kernel.svg?branch=master)](https://travis-ci.com/marcosfad/mbp-ubuntu-kernel) - ## INSTALLATION ### The easy way Use the [mbp-ubuntu](https://github.com/marcosfad/mbp-ubuntu/releases) live cd to install ubuntu on your Mac. -### Manually +### Manually using the apt repository Add the repo to your apt sources ```bash @@ -49,6 +39,12 @@ Install the kernel using apt, for example kernel 5.10.47: apt-get install linux-headers-5.10.47-mbp linux-image-5.10.17-mbp ``` +### Manually downloading the kernel from the Github releases + +* Download the release you want to try: linux-image-* linux-headers-* to a folder +* `cd ` +* `sudo dpkg -i *.deb` + ## Docs - Discord: From 91264edc5c0852381c37b349c1ddbdac37573def Mon Sep 17 00:00:00 2001 From: marcosfad Date: Fri, 3 Sep 2021 15:17:08 +0200 Subject: [PATCH 14/18] [skipci] Fix typo --- build_in_docker.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_in_docker.sh b/build_in_docker.sh index 3f983c63..59b16856 100755 --- a/build_in_docker.sh +++ b/build_in_docker.sh @@ -49,7 +49,7 @@ docker run \ --patchset2Branch=main \ --patchset2Commit=4c8b393ed7a874e3d9e44a2a467c1b7c74af1260 \ --patchset2Filter=\"grep -E wifi-bigsur\" \ - --releaseSuffix=t2-aunali1-bigSur \ + --releaseSuffix=t2-aunali1-bigsur \ --releasePath=/repo/build/t2-aunali1-bigsur \ " ## jamlam @@ -94,7 +94,7 @@ docker run \ --patchset2Branch=master \ --patchset2Commit=9511d5ed2ae0e851dd6a82843daefb2be7d5e212 \ --patchset2Filter=\"grep -E brcmfmac\" \ - --releaseSuffix=t2-jamlam-mojave + --releaseSuffix=t2-jamlam-mojave \ --releasePath=/repo/build/t2-jamlam-mojave \ " From 32ffe4c4f3ebfb6b5758ef5756d0cf9ad87a04bf Mon Sep 17 00:00:00 2001 From: marcosfad Date: Sat, 11 Sep 2021 21:40:24 +0200 Subject: [PATCH 15/18] Multiple build improvements --- .github/workflows/buildAunalis.yml | 32 ---------------------------- .github/workflows/buildHweJamlam.yml | 32 ---------------------------- .github/workflows/buildJamlam.yml | 32 ---------------------------- .gitignore | 4 ++-- apt-repo/Dockerfile | 23 +++++++++++--------- next_version.sh | 9 ++++---- publish.sh | 5 +---- 7 files changed, 21 insertions(+), 116 deletions(-) diff --git a/.github/workflows/buildAunalis.yml b/.github/workflows/buildAunalis.yml index a70f88e7..1d777084 100644 --- a/.github/workflows/buildAunalis.yml +++ b/.github/workflows/buildAunalis.yml @@ -90,22 +90,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish Kernel - if: | - github.ref == 'refs/heads/master' || - startsWith(github.ref, 'refs/heads/release/') - run: | - PAYLOAD='{"request": {"branch":"master","sha":"9c060e2ebc7564921e28632232131e1dd80ce679"}}' - curl -sSf -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Travis-API-Version: 3" \ - -H "Authorization: token ${TRAVIS_TOKEN}" \ - -d "{\"request\": {${PAYLOAD}}}" \ - https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests - env: - TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} - build-a-bigsur: needs: [lint] runs-on: ubuntu-20.04 @@ -177,19 +161,3 @@ jobs: draft: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish Kernel - if: | - github.ref == 'refs/heads/master' || - startsWith(github.ref, 'refs/heads/release/') - run: | - PAYLOAD='{"request": {"branch":"master","sha":"9c060e2ebc7564921e28632232131e1dd80ce679"}}' - curl -sSf -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Travis-API-Version: 3" \ - -H "Authorization: token ${TRAVIS_TOKEN}" \ - -d "{\"request\": {${PAYLOAD}}}" \ - https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests - env: - TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} diff --git a/.github/workflows/buildHweJamlam.yml b/.github/workflows/buildHweJamlam.yml index f04db49a..24c05332 100644 --- a/.github/workflows/buildHweJamlam.yml +++ b/.github/workflows/buildHweJamlam.yml @@ -88,22 +88,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish Kernel - if: | - github.ref == 'refs/heads/master' || - startsWith(github.ref, 'refs/heads/release/') - run: | - PAYLOAD='{"request": {"branch":"master","sha":"9c060e2ebc7564921e28632232131e1dd80ce679"}}' - curl -sSf -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Travis-API-Version: 3" \ - -H "Authorization: token ${TRAVIS_TOKEN}" \ - -d "{\"request\": {${PAYLOAD}}}" \ - https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests - env: - TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} - build-hwe-mojave: needs: [lint] runs-on: ubuntu-20.04 @@ -172,19 +156,3 @@ jobs: draft: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish Kernel - if: | - github.ref == 'refs/heads/master' || - startsWith(github.ref, 'refs/heads/release/') - run: | - PAYLOAD='{"request": {"branch":"master","sha":"9c060e2ebc7564921e28632232131e1dd80ce679"}}' - curl -sSf -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Travis-API-Version: 3" \ - -H "Authorization: token ${TRAVIS_TOKEN}" \ - -d "{\"request\": {${PAYLOAD}}}" \ - https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests - env: - TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} diff --git a/.github/workflows/buildJamlam.yml b/.github/workflows/buildJamlam.yml index 272417f4..7e897f9a 100644 --- a/.github/workflows/buildJamlam.yml +++ b/.github/workflows/buildJamlam.yml @@ -91,22 +91,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish Kernel - if: | - github.ref == 'refs/heads/master' || - startsWith(github.ref, 'refs/heads/release/') - run: | - PAYLOAD='{"request": {"branch":"master","sha":"9c060e2ebc7564921e28632232131e1dd80ce679"}}' - curl -sSf -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Travis-API-Version: 3" \ - -H "Authorization: token ${TRAVIS_TOKEN}" \ - -d "{\"request\": {${PAYLOAD}}}" \ - https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests - env: - TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} - build-jamlam-mojave: needs: [lint] runs-on: ubuntu-20.04 @@ -178,19 +162,3 @@ jobs: draft: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish Kernel - if: | - github.ref == 'refs/heads/master' || - startsWith(github.ref, 'refs/heads/release/') - run: | - PAYLOAD='{"request": {"branch":"master","sha":"9c060e2ebc7564921e28632232131e1dd80ce679"}}' - curl -sSf -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Travis-API-Version: 3" \ - -H "Authorization: token ${TRAVIS_TOKEN}" \ - -d "{\"request\": {${PAYLOAD}}}" \ - https://api.travis-ci.com/repo/marcosfad%2Fmbp-ubuntu-kernel/requests - env: - TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }} diff --git a/.gitignore b/.gitignore index bd74e9b8..f185f78a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /patches/custom-drivers.patch /releases /linux-* -/.ideabuild -.idea +/.idea +build diff --git a/apt-repo/Dockerfile b/apt-repo/Dockerfile index 669048e5..8b508dd0 100644 --- a/apt-repo/Dockerfile +++ b/apt-repo/Dockerfile @@ -1,11 +1,11 @@ FROM ubuntu:20.04 -ARG RELEASE_VERSION=5.6.4 ARG GPG_KEY=some_key ARG GPG_PASS=some_pass ARG GPG_KEY_ID=some_id ENV GITHUB_URL=github.com/marcosfad/mbp-ubuntu-kernel/releases +ENV GITHUB_API=api.github.com/repos/marcosfad/mbp-ubuntu-kernel ENV REPO_URL=mbp-ubuntu-kernel.herokuapp.com ENV LANG en_US.utf8 @@ -13,7 +13,7 @@ WORKDIR /var/repo RUN DEBIAN_FRONTEND=noninteractive apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - locales dpkg-dev dpkg-sig nginx gettext wget curl apt-utils \ + locales dpkg-dev dpkg-sig nginx gettext wget curl apt-utils jq \ && rm -rf /var/lib/apt/lists/* \ && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 @@ -23,17 +23,20 @@ RUN echo "${GPG_KEY}" > PRIVATE_GPG_KEY.asc \ && gpg --list-keys \ && gpg --output /var/repo/KEY.gpg --armor --export ${GPG_KEY_ID} -RUN for deb in $(curl -s https://${REPO_URL}/ -L | grep deb | grep a | cut -d'>' -f2 | cut -d'<' -f1); do \ - wget -q --backups=1 https://${REPO_URL}/${deb}; \ - done \ - ; rm -rfv *.1 +#RUN for deb in $(curl -s https://${REPO_URL}/ -L | grep deb | grep a | cut -d'>' -f2 | cut -d'<' -f1); do \ +# wget -q --backups=1 https://${REPO_URL}/${deb}; \ +# done \ +# ; rm -rfv *.1 RUN echo "${GPG_PASS}" > PRIVATE_GPG_PASS \ && export GPG_TTY=$(tty) && \ - for deb in $(curl -s https://${GITHUB_URL}/latest -L | grep deb | grep span | cut -d'>' -f2 | cut -d'<' -f1); do \ - wget -q --backups=1 https://${GITHUB_URL}/download/v${RELEASE_VERSION}/${deb} && \ - dpkg-sig -k ${GPG_KEY_ID} -v --sign builder "./${deb}" \ - --gpg-options="--batch --pinentry-mode loopback --no-tty --passphrase-file ./PRIVATE_GPG_PASS"; \ + for release in $(curl -s https://${GITHUB_API}/releases | jq '.[].name'| grep t2 | cut -d'"' -f2 | sort); do \ + for deb in $(curl -s https://${GITHUB_URL}/tag/${release} -L | grep deb | grep span | cut -d'>' -f2 | cut -d'<' -f1 | grep -v linux-libc-dev); do \ + echo ${deb} ; \ + wget -q --backups=1 https://${GITHUB_URL}/download/${release}/${deb} && \ + dpkg-sig -k ${GPG_KEY_ID} -v --sign builder "./${deb}" \ + --gpg-options="--batch --pinentry-mode loopback --no-tty --passphrase-file ./PRIVATE_GPG_PASS"; \ + done; \ done \ ; rm PRIVATE_GPG_PASS \ ; rm -rfv *.1 diff --git a/next_version.sh b/next_version.sh index e4641b84..498f1d08 100755 --- a/next_version.sh +++ b/next_version.sh @@ -1,11 +1,12 @@ #!/bin/bash -curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep "linux-image-${1}" > /dev/null +VERSION=${1} +NEXT_VERSION=1 +curl -s "https://github.com/marcosfad/mbp-ubuntu-kernel/releases/tag/v${VERSION}-${NEXT_VERSION}" -L | grep "linux-image-" > /dev/null OLD_BUILD_EXIST=$? if test $OLD_BUILD_EXIST -eq 0 then - LATEST_BUILD=$(curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep "linux-image-${1}" | - grep a | cut -d'>' -f2 | cut -d'<' -f1 | - sort -r | head -n 1 | cut -d'-' -f6 | cut -d'_' -f1) + NEXT_VERSION=$((LATEST_BUILD+1)) + LATEST_BUILD=$(./next_version.sh "${VERSION}-${NEXT_VERSION}") else LATEST_BUILD=0 fi diff --git a/publish.sh b/publish.sh index 9536e8b6..a95dfb1e 100755 --- a/publish.sh +++ b/publish.sh @@ -3,9 +3,6 @@ set -eu -o pipefail # export HEROKU_API_KEY= -LATEST_RELEASE=$(curl -s https://github.com/marcosfad/mbp-ubuntu-kernel/releases/latest | cut -d'v' -f2 | cut -d'"' -f1) - -echo "Release: ${LATEST_RELEASE}" cd apt-repo || exit @@ -14,7 +11,7 @@ curl https://cli-assets.heroku.com/install.sh | sh heroku container:login heroku container:push -a mbp-ubuntu-kernel web \ - --arg RELEASE_VERSION="${LATEST_RELEASE}",GPG_KEY_ID="${GPG_KEY_ID}",GPG_PASS="${GPG_PASS}",GPG_KEY="${GPG_KEY}" + --arg GPG_KEY_ID="${GPG_KEY_ID}",GPG_PASS="${GPG_PASS}",GPG_KEY="${GPG_KEY}" heroku container:release -a mbp-ubuntu-kernel web # Docker build From f8bc8fbef6bfa32cae49bfda81331286e136a3f3 Mon Sep 17 00:00:00 2001 From: AdityaGarg8 <85610623+AdityaGarg8@users.noreply.github.com> Date: Wed, 6 Oct 2021 16:21:58 +0530 Subject: [PATCH 16/18] Add support for exfat file system --- templates/default-config | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/default-config b/templates/default-config index 3a42d9b5..0e10e2f9 100644 --- a/templates/default-config +++ b/templates/default-config @@ -9701,7 +9701,7 @@ CONFIG_UDF_FS=m # end of CD-ROM/DVD Filesystems # -# DOS/FAT/NT Filesystems +# DOS/FAT/EXFAT/NT Filesystems # CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m @@ -9709,10 +9709,11 @@ CONFIG_VFAT_FS=m CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_FAT_DEFAULT_UTF8=y +CONFIG_EXFAT_FS=m CONFIG_NTFS_FS=m # CONFIG_NTFS_DEBUG is not set CONFIG_NTFS_RW=y -# end of DOS/FAT/NT Filesystems +# end of DOS/FAT/EXFAT/NT Filesystems # # Pseudo filesystems From 40ba75e247191fdaec19a2f127750495cbc6bf28 Mon Sep 17 00:00:00 2001 From: AdityaGarg8 <85610623+AdityaGarg8@users.noreply.github.com> Date: Wed, 6 Oct 2021 18:59:14 +0530 Subject: [PATCH 17/18] Additional exFAT parameters --- templates/default-config | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/default-config b/templates/default-config index 0e10e2f9..768660d3 100644 --- a/templates/default-config +++ b/templates/default-config @@ -9711,6 +9711,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_FAT_DEFAULT_UTF8=y CONFIG_EXFAT_FS=m CONFIG_NTFS_FS=m +CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_DEBUG is not set CONFIG_NTFS_RW=y # end of DOS/FAT/EXFAT/NT Filesystems From 6a7e8d98371d45579b82804b75b39f0f40ca7b6c Mon Sep 17 00:00:00 2001 From: AdityaGarg8 <85610623+AdityaGarg8@users.noreply.github.com> Date: Thu, 7 Oct 2021 17:08:47 +0530 Subject: [PATCH 18/18] Fixed line error --- templates/default-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default-config b/templates/default-config index 768660d3..e6c1ff25 100644 --- a/templates/default-config +++ b/templates/default-config @@ -9710,8 +9710,8 @@ CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_FAT_DEFAULT_UTF8=y CONFIG_EXFAT_FS=m -CONFIG_NTFS_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" +CONFIG_NTFS_FS=m # CONFIG_NTFS_DEBUG is not set CONFIG_NTFS_RW=y # end of DOS/FAT/EXFAT/NT Filesystems