diff --git a/.github/workflows/buildPi4.yml b/.github/workflows/buildPi4.yml new file mode 100644 index 0000000..cbf6c59 --- /dev/null +++ b/.github/workflows/buildPi4.yml @@ -0,0 +1,69 @@ +name: build Pi4 + +# Controls when the action will run. +# Triggers the workflow on push or pull request events but only for the master branch +# Allows you to run this workflow manually from the Actions tab +on: [push, pull_request, workflow_dispatch] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + strategy: + matrix: + PLATFORM: [pi] + DISTRO: [bullseye] + env: + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 10 + + - name: Install depencies + run: | + sudo apt update + sudo apt install bc bison ccache gcc-arm-linux-gnueabihf fakeroot flex git kmod libelf-dev libssl-dev make python3-pip ruby + sudo gem install --no-document fpm + sudo pip3 install --upgrade cloudsmith-cli + + - name: Setup env + run: | + ccache --set-config=compiler_check=content && ccache --set-config=hash_dir=false + echo "DT=$(date +'%Y-%m-%d_%H%M')" >> $GITHUB_ENV + echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV + + - name: Setup cache + id: cache + uses: actions/cache@v2 + with: + path: ~/.ccache + key: ${{ runner.os }}-ccache + restore-keys: | + ${{ runner.os }}-ccache + ${{ runner.os }}-ccache- + + - name: Build ${{ matrix.PLATFORM }} ${{ matrix.DISTRO }} true + run: | + export PATH=/usr/lib/ccache:$PATH + bash buildwithlog.sh ${{ matrix.PLATFORM }} ${{ matrix.DISTRO }} ONLINE + + - name: Compose release filename + # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions + run: echo "artifact_name=ohd-kernel-${{ matrix.PLATFORM }}-${{ matrix.DISTRO }}-${GITHUB_REF##*/}" >> $GITHUB_ENV + + - name: Package firmware ${{ matrix.PLATFORM }} ${{ matrix.DISTRO }} + uses: 'actions/upload-artifact@v2' + with: + name: "${{ env.artifact_name }}" + path: | + *.deb + *.log + if-no-files-found: error + diff --git a/build.sh b/build.sh index 3badc93..b8acfbd 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,8 @@ #!/bin/bash PLATFORM=$1 DISTRO=$2 -ONLINE=$3 +PI4=$3 +ONLINE=$4 if [[ "${PLATFORM}" != "pi" ]] && [[ "${PLATFORM}" != "jetson" ]]; then echo "Usage: ./build.sh pi bullseye" @@ -306,15 +307,16 @@ set -x #echo "Set Overlays" - # source $SRC_DIR/kernels/${PLATFORM}-${DISTRO}-v7 - # prepare_build - # build_pi_kernel - # echo "Copy kernel7" - # pushd ${LINUX_DIR} - # ls -a - # cp arch/arm/boot/zImage "${PACKAGE_DIR}/usr/local/share/openhd/kernel/kernel7.img" || exit 1 - + if [[ "${PI4}" == "true" ]]; then + source $SRC_DIR/kernels/${PLATFORM}-${DISTRO}-v7 + prepare_build + build_pi_kernel + echo "Copy kernel7" + pushd ${LINUX_DIR} + ls -a + cp arch/arm/boot/zImage "${PACKAGE_DIR}/usr/local/share/openhd/kernel/kernel7.img" || exit 1 + else source $SRC_DIR/kernels/${PLATFORM}-${DISTRO}-v7l prepare_build build_pi_kernel @@ -323,7 +325,7 @@ set -x ls -a cp arch/arm/boot/zImage "${PACKAGE_DIR}/usr/local/share/openhd/kernel/kernel7l.img" || exit 1 - + fi fi if [[ "${PLATFORM}" == "jetson" ]]; then diff --git a/kernels/pi-bullseye-v7 b/kernels/pi-bullseye-v7 index 9b947f5..cfc4b99 100644 --- a/kernels/pi-bullseye-v7 +++ b/kernels/pi-bullseye-v7 @@ -1,5 +1,5 @@ KERNEL=kernel7 KERNEL_BRANCH="rpi-6.1.y" -KERNEL_VERSION="6.1.55-v7+" +KERNEL_VERSION="6.1.74-v7+" KERNEL_COMMIT="20cb6d7b533b5e6d7df8a2cb7a83bd4555834bde" ISA=v7 diff --git a/kernels/pi-bullseye-v7l b/kernels/pi-bullseye-v7l index 2373431..4d8a830 100644 --- a/kernels/pi-bullseye-v7l +++ b/kernels/pi-bullseye-v7l @@ -1,5 +1,5 @@ KERNEL=kernel7l KERNEL_BRANCH="rpi-6.1.y" -KERNEL_VERSION="6.1.55-v7l+" +KERNEL_VERSION="6.1.74-v7l+" KERNEL_COMMIT="20cb6d7b533b5e6d7df8a2cb7a83bd4555834bde" ISA=v7l diff --git a/scripts/common.sh b/scripts/common.sh index 34ac0a0..4ebd823 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -24,11 +24,17 @@ function package() { rm ${PACKAGE_NAME}_${VERSION}_${PACKAGE_ARCH}.deb >/dev/null 2>&1 if [[ "${PLATFORM}" == "pi" ]]; then cd ${SRC_DIR} - rm -Rf ${PACKAGE_DIR}/lib/modules/6.1.55-v7+/source - rm -Rf ${PACKAGE_DIR}/lib/modules/6.1.55-v7+/build - rm -Rf ${PACKAGE_DIR}/lib/modules/6.1.55-v7l+/source - rm -Rf ${PACKAGE_DIR}/lib/modules/6.1.55-v7l+/build - fpm -a ${PACKAGE_ARCH} -s dir -t deb -n ${PACKAGE_NAME} -v ${VERSION} -C ${PACKAGE_DIR} \ + rm -Rf ${PACKAGE_DIR}/lib/modules/6.1.74-v7+/source + rm -Rf ${PACKAGE_DIR}/lib/modules/6.1.74-v7+/build + rm -Rf ${PACKAGE_DIR}/lib/modules/6.1.74-v7l+/source + rm -Rf ${PACKAGE_DIR}/lib/modules/6.1.74-v7l+/build + if [[ "${PI4}" == "true" ]]; then + fpm -a ${PACKAGE_ARCH} -s dir -t deb -n ${PACKAGE_NAME}-v7l -v ${VERSION} -C ${PACKAGE_DIR} \ + --after-install after-install.sh \ + --before-install before-install.sh \ + -p ${PACKAGE_NAME}_VERSION_ARCH.deb || exit 1 + else + fpm -a ${PACKAGE_ARCH} -s dir -t deb -n ${PACKAGE_NAME}-v7 -v ${VERSION} -C ${PACKAGE_DIR} \ --after-install after-install.sh \ --before-install before-install.sh \ -p ${PACKAGE_NAME}_VERSION_ARCH.deb || exit 1