From b18d5e5593156da0719ebe481cb87f5d65484935 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin Date: Sat, 20 Aug 2022 10:01:25 +0300 Subject: [PATCH] Add old gen Goke to CI as well --- .github/workflows/gk7102_images.yml | 143 ------------------ .github/workflows/gk7102s_images.yml | 143 ------------------ .github/workflows/matrix_build.yml | 7 + .../gk710x/kernel/patches/20_fix_gcc8.patch | 1 + general/package/anyka_patcher/apply.sh | 16 +- general/package/goke_patcher/apply.sh | 16 +- 6 files changed, 28 insertions(+), 298 deletions(-) delete mode 100644 .github/workflows/gk7102_images.yml delete mode 100644 .github/workflows/gk7102s_images.yml create mode 120000 br-ext-chip-goke/board/gk710x/kernel/patches/20_fix_gcc8.patch diff --git a/.github/workflows/gk7102_images.yml b/.github/workflows/gk7102_images.yml deleted file mode 100644 index 8ef151d0..00000000 --- a/.github/workflows/gk7102_images.yml +++ /dev/null @@ -1,143 +0,0 @@ -name: "GK7102" - -on: - workflow_dispatch: - -jobs: - build_core: - name: OpenIPC firmware for GK7102 - runs-on: ubuntu-latest - - steps: - - - name: Checkout - id: checkout - uses: actions/checkout@v2 - - - name: Install build dependencies - run: | - make install-deps - mkdir -p tmp - if [ ! -z "$ACT" ]; then - apt install -y cpio rsync bc - echo "FORCE_UNSAFE_CONFIGURE=1" >> $GITHUB_ENV - # Mitigate #325 issue - apt install -y pip && pip install cmake - else - # https://github.com/actions/runner-images/issues/2577 - echo "1.1.1.1 invisible-mirror.net" | sudo tee -a /etc/hosts - fi - - - name: Free disk space - if: ${{ !env.ACT }} - run: | - sudo swapoff -a - sudo rm -f /swapfile - sudo apt clean - docker rmi $(docker image ls -aq) - df -h - - - name: Prepare buildroot - id: prepare - run: | - HEAD_TAG=$(git tag --points-at HEAD) - GIT_HASH=$(git rev-parse --short $GITHUB_SHA) - BRANCH_NAME=$(echo $GITHUB_REF | cut -d'/' -f 3) - if [ -z "$HEAD_TAG" ]; then - TAG_NAME="latest" - RELEASE_NAME="Development Build" - PRERELEASE=true - else - TAG_NAME=${{ github.ref }} - RELEASE_NAME="Release ${{ github.ref }}" - PRERELEASE=false - fi - echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV - echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV - echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV - echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV - echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - cd $GITHUB_WORKSPACE - make prepare - - - name: Build GK7102 firmware - id: build-gk7102-firmware - continue-on-error: true - run: | - ARCHIVE_FW="${GITHUB_WORKSPACE}/output/images/openipc.gk7102-br.tgz" - echo "ARCHIVE_FW=$ARCHIVE_FW" >> $GITHUB_ENV - cd $GITHUB_WORKSPACE - make PLATFORM=goke BOARD=unknown_unknown_gk7102_openipc all - [[ $(stat --printf="%s" ${GITHUB_WORKSPACE}/output/images/uImage) -gt 2097152 ]] && echo "TG_NOTIFY=Warning, kernel size exceeded : $(stat --printf="%s" ${GITHUB_WORKSPACE}/output/images/uImage) vs 2097152... GK7102" >> $GITHUB_ENV && exit 1 - [[ $(stat --printf="%s" ${GITHUB_WORKSPACE}/output/images/rootfs.squashfs) -gt 5242880 ]] && echo "TG_NOTIFY=Warning, rootfs size exceeded - $(stat --printf="%s" ${GITHUB_WORKSPACE}/output/images/rootfs.squashfs) vs 5242880... GK7102" >> $GITHUB_ENV && exit 1 - cd ${GITHUB_WORKSPACE}/output/images - mv uImage uImage.gk7102 - mv rootfs.squashfs rootfs.squashfs.gk7102 - tar -C ${GITHUB_WORKSPACE}/output/images -cvzf $ARCHIVE_FW rootfs.squashfs.fh8856 uImage.gk7102 - - - name: Build GK7102 SDK - id: build-gk7102-sdk - continue-on-error: true - run: | - ARCHIVE_SDK="${GITHUB_WORKSPACE}/output/images/arm-openipc-linux-musleabi_sdk-buildroot.tar.gz" - echo "ARCHIVE_SDK=$ARCHIVE_SDK" >> $GITHUB_ENV - cd $GITHUB_WORKSPACE/output - make sdk - - - name: Send error message to telegram channel - env: - TG_TOKEN: ${{ secrets.TELEGRAM_TOKEN_BOT_OPENIPC }} - TG_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL_OPENIPC_DEV }} - if: steps.build-gk7102-firmware.outcome != 'success' || steps.build-gk7102-sdk.outcome != 'success' - run: | - TG_OPTIONS="-s --connect-timeout 30 --max-time 30" - TG_NOTIFY="${TG_NOTIFY:=Warning, Buildroot compiling error... GK7102}" - TG_HEADER=$(echo -e "\r\n$TG_NOTIFY \r\n\r\nCommit: $GIT_HASH \r\nBranch: $BRANCH_NAME \r\nTag: $TAG_NAME \r\n\r\n\xE2\x9A\xA0 GitHub Actions") - curl $TG_OPTIONS -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot$TG_TOKEN/sendMessage \ - -F chat_id=$TG_CHANNEL -F text="$TG_HEADER" - exit 2 - - - name: Create release - if: ${{ !env.ACT }} - uses: actions/create-release@v1 - continue-on-error: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.TAG_NAME }} - release_name: ${{ env.RELEASE_NAME }} - draft: false - prerelease: ${{ env.PRERELEASE }} - - - name: Upload NOR FW to release - if: ${{ !env.ACT }} - uses: svenstaro/upload-release-action@v2 - continue-on-error: true - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ env.ARCHIVE_FW }} - asset_name: "openipc.gk7102-br.tgz" - tag: ${{ env.TAG_NAME }} - overwrite: true - - - name: Upload SDK to release - if: ${{ !env.ACT }} - uses: svenstaro/upload-release-action@v2 - continue-on-error: true - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ env.ARCHIVE_SDK }} - asset_name: "arm-openipc-gk7102-linux-musleabi_sdk-buildroot.tar.gz" - tag: ${{ env.TAG_NAME }} - overwrite: true - - - name: Send binary file to telegram channel - if: ${{ !env.ACT }} - env: - TG_TOKEN: ${{ secrets.TELEGRAM_TOKEN_BOT_OPENIPC }} - TG_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL_OPENIPC_DEV }} - run: | - TG_OPTIONS="-s --connect-timeout 30 --max-time 30" - TG_HEADER=$(echo -e "\r\nCommit: $GIT_HASH \r\nBranch: $BRANCH_NAME \r\nTag: $TAG_NAME \r\n\r\n\xE2\x9C\x85 GitHub Actions") - curl $TG_OPTIONS -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot$TG_TOKEN/sendDocument \ - -F chat_id=$TG_CHANNEL -F document="@$ARCHIVE_FW" -F caption="$TG_HEADER" diff --git a/.github/workflows/gk7102s_images.yml b/.github/workflows/gk7102s_images.yml deleted file mode 100644 index 61115bd9..00000000 --- a/.github/workflows/gk7102s_images.yml +++ /dev/null @@ -1,143 +0,0 @@ -name: "GK7102S " - -on: - workflow_dispatch: - -jobs: - build_core: - name: OpenIPC firmware for GK7102S - runs-on: ubuntu-latest - - steps: - - - name: Checkout - id: checkout - uses: actions/checkout@v2 - - - name: Install build dependencies - run: | - make install-deps - mkdir -p tmp - if [ ! -z "$ACT" ]; then - apt install -y cpio rsync bc - echo "FORCE_UNSAFE_CONFIGURE=1" >> $GITHUB_ENV - # Mitigate #325 issue - apt install -y pip && pip install cmake - else - # https://github.com/actions/runner-images/issues/2577 - echo "1.1.1.1 invisible-mirror.net" | sudo tee -a /etc/hosts - fi - - - name: Free disk space - if: ${{ !env.ACT }} - run: | - sudo swapoff -a - sudo rm -f /swapfile - sudo apt clean - docker rmi $(docker image ls -aq) - df -h - - - name: Prepare buildroot - id: prepare - run: | - HEAD_TAG=$(git tag --points-at HEAD) - GIT_HASH=$(git rev-parse --short $GITHUB_SHA) - BRANCH_NAME=$(echo $GITHUB_REF | cut -d'/' -f 3) - if [ -z "$HEAD_TAG" ]; then - TAG_NAME="latest" - RELEASE_NAME="Development Build" - PRERELEASE=true - else - TAG_NAME=${{ github.ref }} - RELEASE_NAME="Release ${{ github.ref }}" - PRERELEASE=false - fi - echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV - echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV - echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV - echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV - echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - cd $GITHUB_WORKSPACE - make prepare - - - name: Build GK7102S firmware - id: build-gk7102s-firmware - continue-on-error: true - run: | - ARCHIVE_FW="${GITHUB_WORKSPACE}/output/images/openipc.gk7102s-br.tgz" - echo "ARCHIVE_FW=$ARCHIVE_FW" >> $GITHUB_ENV - cd $GITHUB_WORKSPACE - make PLATFORM=goke BOARD=unknown_unknown_gk7102s_openipc all - [[ $(stat --printf="%s" ${GITHUB_WORKSPACE}/output/images/uImage) -gt 2097152 ]] && echo "TG_NOTIFY=Warning, kernel size exceeded : $(stat --printf="%s" ${GITHUB_WORKSPACE}/output/images/uImage) vs 2097152... GK7102S" >> $GITHUB_ENV && exit 1 - [[ $(stat --printf="%s" ${GITHUB_WORKSPACE}/output/images/rootfs.squashfs) -gt 5242880 ]] && echo "TG_NOTIFY=Warning, rootfs size exceeded - $(stat --printf="%s" ${GITHUB_WORKSPACE}/output/images/rootfs.squashfs) vs 5242880... GK7102S" >> $GITHUB_ENV && exit 1 - cd ${GITHUB_WORKSPACE}/output/images - mv uImage uImage.gk7102s - mv rootfs.squashfs rootfs.squashfs.gk7102s - tar -C ${GITHUB_WORKSPACE}/output/images -cvzf $ARCHIVE_FW rootfs.squashfs.fh8856 uImage.gk7102s - - - name: Build GK7102S SDK - id: build-gk7102s-sdk - continue-on-error: true - run: | - ARCHIVE_SDK="${GITHUB_WORKSPACE}/output/images/arm-openipc-linux-musleabi_sdk-buildroot.tar.gz" - echo "ARCHIVE_SDK=$ARCHIVE_SDK" >> $GITHUB_ENV - cd $GITHUB_WORKSPACE/output - make sdk - - - name: Send error message to telegram channel - env: - TG_TOKEN: ${{ secrets.TELEGRAM_TOKEN_BOT_OPENIPC }} - TG_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL_OPENIPC_DEV }} - if: steps.build-gk7102s-firmware.outcome != 'success' || steps.build-gk7102s-sdk.outcome != 'success' - run: | - TG_OPTIONS="-s --connect-timeout 30 --max-time 30" - TG_NOTIFY="${TG_NOTIFY:=Warning, Buildroot compiling error... GK7102S}" - TG_HEADER=$(echo -e "\r\n$TG_NOTIFY \r\n\r\nCommit: $GIT_HASH \r\nBranch: $BRANCH_NAME \r\nTag: $TAG_NAME \r\n\r\n\xE2\x9A\xA0 GitHub Actions") - curl $TG_OPTIONS -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot$TG_TOKEN/sendMessage \ - -F chat_id=$TG_CHANNEL -F text="$TG_HEADER" - exit 2 - - - name: Create release - if: ${{ !env.ACT }} - uses: actions/create-release@v1 - continue-on-error: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.TAG_NAME }} - release_name: ${{ env.RELEASE_NAME }} - draft: false - prerelease: ${{ env.PRERELEASE }} - - - name: Upload NOR FW to release - if: ${{ !env.ACT }} - uses: svenstaro/upload-release-action@v2 - continue-on-error: true - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ env.ARCHIVE_FW }} - asset_name: "openipc.gk7102s-br.tgz" - tag: ${{ env.TAG_NAME }} - overwrite: true - - - name: Upload SDK to release - if: ${{ !env.ACT }} - uses: svenstaro/upload-release-action@v2 - continue-on-error: true - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ env.ARCHIVE_SDK }} - asset_name: "arm-openipc-gk7102s-linux-musleabi_sdk-buildroot.tar.gz" - tag: ${{ env.TAG_NAME }} - overwrite: true - - - name: Send binary file to telegram channel - if: ${{ !env.ACT }} - env: - TG_TOKEN: ${{ secrets.TELEGRAM_TOKEN_BOT_OPENIPC }} - TG_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL_OPENIPC_DEV }} - run: | - TG_OPTIONS="-s --connect-timeout 30 --max-time 30" - TG_HEADER=$(echo -e "\r\nCommit: $GIT_HASH \r\nBranch: $BRANCH_NAME \r\nTag: $TAG_NAME \r\n\r\n\xE2\x9C\x85 GitHub Actions") - curl $TG_OPTIONS -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot$TG_TOKEN/sendDocument \ - -F chat_id=$TG_CHANNEL -F document="@$ARCHIVE_FW" -F caption="$TG_HEADER" diff --git a/.github/workflows/matrix_build.yml b/.github/workflows/matrix_build.yml index 13c492f0..bd9a1439 100644 --- a/.github/workflows/matrix_build.yml +++ b/.github/workflows/matrix_build.yml @@ -39,6 +39,7 @@ jobs: # hi3516cv500 # hi3516ev200 - ak3918ev300 + - gk7102 steps: @@ -206,6 +207,12 @@ jobs: - platform: ak3918ev300 release: lite todo: true + - platform: gk7102 + release: lite + todo: true + - platform: gk7102s + release: lite + todo: true exclude: - platform: hi3516dv200 diff --git a/br-ext-chip-goke/board/gk710x/kernel/patches/20_fix_gcc8.patch b/br-ext-chip-goke/board/gk710x/kernel/patches/20_fix_gcc8.patch new file mode 120000 index 00000000..32a424bc --- /dev/null +++ b/br-ext-chip-goke/board/gk710x/kernel/patches/20_fix_gcc8.patch @@ -0,0 +1 @@ +../../../../../patches/linux/3.4.x/gcc8_err_encountered.patch \ No newline at end of file diff --git a/general/package/anyka_patcher/apply.sh b/general/package/anyka_patcher/apply.sh index 1dc00d99..6a3bdd5f 100755 --- a/general/package/anyka_patcher/apply.sh +++ b/general/package/anyka_patcher/apply.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + function log() { echo "--- $@" } @@ -8,19 +10,21 @@ function apply_patch() { DST=$1 SRC=$2 - if [[ -d $SRC ]]; then + if [[ -d "$SRC" ]]; then if [[ ${SRC:${#SRC}-1} != '/' ]]; then log Apply \"$SRC\" as overlay directory cp -r $SRC/* $DST/ else log Apply \"$SRC\" as patches directory for P in $SRC/*.patch; do - patch -d $DST -p1 < $P + patch -d $DST -p1 <$P done fi else - log Apply \"$SRC\" as single patch - patch -d $DST -p1 < $SRC + if [[ -f "$SRC" ]]; then + log Apply \"$SRC\" as single patch + patch -d $DST -p1 <$SRC + fi fi } @@ -35,10 +39,10 @@ function apply_patches() { DST=$1 shift -if [ -f $DST/.anyka-patched ]; then +if [ -f $DST/.already-patched ]; then log Patched already exit fi apply_patches $@ -touch $DST/.anyka-patched +touch $DST/.already-patched diff --git a/general/package/goke_patcher/apply.sh b/general/package/goke_patcher/apply.sh index 410486d8..6a3bdd5f 100755 --- a/general/package/goke_patcher/apply.sh +++ b/general/package/goke_patcher/apply.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + function log() { echo "--- $@" } @@ -8,19 +10,21 @@ function apply_patch() { DST=$1 SRC=$2 - if [[ -d $SRC ]]; then + if [[ -d "$SRC" ]]; then if [[ ${SRC:${#SRC}-1} != '/' ]]; then log Apply \"$SRC\" as overlay directory cp -r $SRC/* $DST/ else log Apply \"$SRC\" as patches directory for P in $SRC/*.patch; do - patch -d $DST -p1 < $P + patch -d $DST -p1 <$P done fi else - log Apply \"$SRC\" as single patch - patch -d $DST -p1 < $SRC + if [[ -f "$SRC" ]]; then + log Apply \"$SRC\" as single patch + patch -d $DST -p1 <$SRC + fi fi } @@ -35,10 +39,10 @@ function apply_patches() { DST=$1 shift -if [ -f $DST/.goke-patched ]; then +if [ -f $DST/.already-patched ]; then log Patched already exit fi apply_patches $@ -touch $DST/.goke-patched +touch $DST/.already-patched