Skip to content

Commit

Permalink
Add config for rpi-5; add github workflows for rpi-5
Browse files Browse the repository at this point in the history
The workflow was added to create builds with and without nbd168
patch [1].

[1] https://nbd.name/p/44208690
  • Loading branch information
danpawlik committed Oct 22, 2024
1 parent ca37b45 commit 82ece5a
Show file tree
Hide file tree
Showing 2 changed files with 148 additions and 0 deletions.
138 changes: 138 additions & 0 deletions .github/workflows/rpi-5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
# MORE INFO: https://github.com/openwrt/openwrt/issues/16273
name: Build for Raspberry Pi 5 with or without nbd patch

on:
workflow_dispatch:
inputs:
IS_PATCH:
description: "Should build be with/without patch? (default: with)"
required: true
type: choice
default: 'with'
options:
- with
- without

env:
REMOTE_REPOSITORY: openwrt/openwrt
REMOTE_BRANCH: main
RELEASE_PREFIX: rpi-5-${{ inputs.IS_PATCH == 'with' && 'with' || 'without' }}
DEVICE_CONFIG: configs/bcm27xx/bcm2712/rpi-5
ROLE_CONFIG: ''

jobs:
check_commits:
name: Check Commits
runs-on: ubuntu-24.04
outputs:
latest_commit_sha: ${{ steps.get_sha.outputs.latest_commit_sha }}
steps:
- name: Checkout remote repository
uses: actions/checkout@v4
with:
repository: ${{ env.REMOTE_REPOSITORY }}
ref: ${{ env.REMOTE_BRANCH }}

- name: Get the latest commit SHA
id: get_sha
run: |
echo "latest_commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "latest_commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
build:
name: Build rpi-5
needs: [check_commits]
runs-on: ubuntu-24.04
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y \
build-essential clang flex bison g++ gawk \
gcc-multilib g++-multilib gettext git libncurses5-dev libssl-dev \
python3-setuptools rsync swig unzip zlib1g-dev file wget curl zstd \
git
sudo apt full-upgrade -y
- name: Checkout remote repository
uses: actions/checkout@v4
with:
repository: ${{ env.REMOTE_REPOSITORY }}
ref: ${{ env.REMOTE_BRANCH }}

- name: What version it is created
run: |
echo "Version ${{ inputs.IS_PATCH == 'with' && 'with patch' || 'without patch' }} for ${{ env.DEVICE_CONFIG }} based on branch ${{ env.REMOTE_BRANCH }}"
- name: Update and install feeds
run: |
./scripts/feeds update -a && ./scripts/feeds install -a
- name: Configure firmware image
run: |
curl -SL https://raw.githubusercontent.com/${{ github.repository_owner }}/openwrt-builder/master/${{ env.DEVICE_CONFIG }} > .config
curl -SL https://raw.githubusercontent.com/${{ github.repository_owner }}/openwrt-builder/master/configs/common/luci >> .config
curl -SL https://raw.githubusercontent.com/${{ github.repository_owner }}/openwrt-builder/master/configs/common/snapshot-short >> .config
sed -i '/CONFIG_PACKAGE_wpad-mbedtls=y/d' .config
curl -SL https://raw.githubusercontent.com/${{ github.repository_owner }}/openwrt-builder/master/configs/common/openssl >> .config
- name: Run defconfig
run: |
make defconfig
- name: Remove packages that are marked as modules just to save time
run: |
grep "=m" .config | grep -v 'CONFIG_PACKAGE_libustream-mbedtls=m' | while read -r line; do module=$(echo "$line" | cut -f1 -d'='); sed -i "s/^$line$/# $module is not set/" .config; done
- name: Build the firmware image
run: make -j $(nproc) defconfig download world

- name: Package output
run: tar -cvf rpi-5-images.tar bin/targets/bcm27xx/bcm2712

- name: Add config file
run: cp .config bin/targets/bcm27xx/bcm2712/config-full

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: rpi-5-images
path: rpi-5-images.tar

release:
name: Create release
needs: [build, check_commits]
if: needs.build.result == 'success'
runs-on: ubuntu-24.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: rpi-5-images

- name: Extract artifacts
run: tar xf rpi-5-images.tar

- name: Get current date
run: echo "RELEASE_DATE=$(date +%F)" >> $GITHUB_ENV

- name: Create release
uses: softprops/action-gh-release@master
with:
files: bin/targets/bcm27xx/bcm2712/*
tag_name: ${{ env.RELEASE_PREFIX }}-${{ env.REMOTE_BRANCH }}-${{ env.RELEASE_DATE }}
name: OpenWRT rpi-5 ${{ inputs.IS_PATCH == 'with' && 'with' || 'without' }} - ${{ env.REMOTE_BRANCH }} - ${{ env.RELEASE_DATE }}
body: |
Build ${{ inputs.IS_PATCH == 'with' && 'with nbd168 patch' || 'without any patch' }} just with luci and openssl.
Build Commit: ${{ needs.check_commits.outputs.latest_commit_sha }}
More details: https://github.com/openwrt/openwrt/issues/16273
- name: Clean up old releases
uses: dev-drprasad/delete-older-releases@master
with:
keep_latest: 5
delete_tags: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 10 additions & 0 deletions configs/bcm27xx/bcm2712/rpi-5
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CONFIG_TARGET_bcm27xx=y
CONFIG_TARGET_bcm27xx_bcm2712=y
CONFIG_TARGET_DEVICE_bcm27xx_bcm2712_DEVICE_rpi-5=y

# MT7925
CONFIG_PACKAGE_kmod-mt7925-common=y
CONFIG_PACKAGE_kmod-mt7925e=y
CONFIG_PACKAGE_kmod-mt7925-firmware=y
CONFIG_PACKAGE_kmod-mt792x-common=y
CONFIG_PACKAGE_kmod-mt792x-usb=y

0 comments on commit 82ece5a

Please sign in to comment.