From 023f90fbc828a7d146bc1dce057c205a67e313a7 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 9 Oct 2023 00:26:18 +0200 Subject: [PATCH 01/40] Revert "lantiq: xrx200: mark subtarget as source-only" This reverts commit 0c117e1f6ccbee684ea0589d9024ca9dec4679c9. Activate the lantiq/xrx200 target again. There are still some problems with the GSWIP, but it is not leaking packets to the wrong bridge in normal operations. It shows some error messages at configuration like these: [ 54.308861] gswip 1e108000.switch: port 5 failed to add ce:9d:84:d1:81:f0 vid 1 to fdb: -22 [ 54.325633] gswip 1e108000.switch: port 5 failed to add e8:de:27:95:c1:b4 vid 0 to fdb: -22 [ 54.351242] gswip 1e108000.switch: port 5 failed to add e8:de:27:95:c1:b4 vid 1 to fdb: -22 [ 54.358311] gswip 1e108000.switch: port 5 failed to delete ce:9d:84:d1:81:f0 vid 1 from fdb: -2 The problems are described in this pull request: https://github.com/openwrt/openwrt/pull/13200 Signed-off-by: Hauke Mehrtens (cherry picked from commit e1aaa1defd2340be3544dc614f905795b4d52f81) --- target/linux/lantiq/xrx200/target.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/lantiq/xrx200/target.mk b/target/linux/lantiq/xrx200/target.mk index 6e01fc79e4..0f119edd6f 100644 --- a/target/linux/lantiq/xrx200/target.mk +++ b/target/linux/lantiq/xrx200/target.mk @@ -1,7 +1,7 @@ ARCH:=mips SUBTARGET:=xrx200 BOARDNAME:=XRX200 -FEATURES+=atm nand ramdisk source-only +FEATURES+=atm nand ramdisk CPU_TYPE:=24kc DEFAULT_PACKAGES+=kmod-leds-gpio \ From ee3600a91efaad112d1fabffffeb371f6f3b8e7f Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Tue, 24 Oct 2023 13:10:51 +0200 Subject: [PATCH 02/40] image: Fix the CONFIG_EXTERNAL_CPIO logic Fix the qstrip call. Fixes: #13776. Signed-off-by: Luca Barbato (cherry picked from commit 330492a101cdb1608d1194496c1b620315ef8bd8) --- include/kernel-defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index 6a341c3225..b17ff7f932 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -166,7 +166,7 @@ define Kernel/CompileImage/Initramfs $(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR) $(TARGET_DIR)/init) rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio* ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),y) -ifneq ($(qstrip $(CONFIG_EXTERNAL_CPIO)),) +ifneq ($(call qstrip,$(CONFIG_EXTERNAL_CPIO)),) $(CP) $(CONFIG_EXTERNAL_CPIO) $(KERNEL_BUILD_DIR)/initrd.cpio else ( cd $(TARGET_DIR); find . | LC_ALL=C sort | $(STAGING_DIR_HOST)/bin/cpio --reproducible -o -H newc -R 0:0 > $(KERNEL_BUILD_DIR)/initrd.cpio ) From 6420851c0c4241d075600662612b3ca4d8906bcd Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 27 May 2023 22:08:26 +0200 Subject: [PATCH 03/40] CI: build: drop redundant generate ccache hash job Drop redundant generare ccache hash job as that can be done by integrated github expressions to generate an hash. The only change is that the integrated way generate a sha256 hash instead of an md5 sum. Signed-off-by: Christian Marangi (cherry picked from commit 457f6b0b9c07772f529a9714a974f3eb74f9b99d) --- .github/workflows/build.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 816ef6ab3c..eba4df7e91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,6 @@ jobs: runs-on: ubuntu-latest outputs: owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} - ccache_hash: ${{ steps.ccache_hash.outputs.ccache_hash }} container_tag: ${{ steps.determine_tools_container.outputs.container_tag }} steps: @@ -76,13 +75,6 @@ jobs: echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT - - name: Generate ccache hash - id: ccache_hash - run: | - CCACHE_HASH=$(md5sum include/kernel-* | awk '{ print $1 }' \ - | md5sum | awk '{ print $1 }') - echo "ccache_hash=$CCACHE_HASH" >> $GITHUB_OUTPUT - # Per branch tools container tag # By default stick to latest # For official test targetting openwrt stable branch @@ -231,7 +223,7 @@ jobs: uses: actions/cache@v3 with: path: openwrt/.ccache - key: ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}-${{ needs.setup_build.outputs.ccache_hash }} + key: ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}-${{ hashFiles('openwrt/include/kernel-**') }} restore-keys: | ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}- From b98b3d42969742b29d965558262e903e3642be14 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Tue, 20 Dec 2022 20:02:35 +0100 Subject: [PATCH 04/40] CI: build: package external toolchain after build Package external toolchain after correct build. Signed-off-by: Christian Marangi (cherry picked from commit ce2e7c52f8ebc7ea92a1436ee2dbeecf149132dc) --- .github/workflows/build.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eba4df7e91..5ca6f4e32e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,6 +47,10 @@ on: mbedtls wolfssl openssl + build_external_toolchain: + type: boolean + upload_external_toolchain: + type: boolean permissions: contents: read @@ -368,6 +372,12 @@ jobs: working-directory: openwrt run: make -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + - name: Build external toolchain + if: inputs.build_external_toolchain == true + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make target/toolchain/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + - name: Coverity prepare toolchain if: inputs.coverity_check_packages != '' shell: su buildbot -c "sh -e {0}" @@ -425,3 +435,19 @@ jobs: with: name: ${{ inputs.target }}-${{ inputs.subtarget }}-logs path: "openwrt/logs" + + - name: Find external toolchain name + id: get-toolchain-name + if: inputs.upload_external_toolchain == true + working-directory: openwrt + run: | + TOOLCHAIN_NAME=$(ls bin/targets/${{inputs.target }}/${{ inputs.subtarget }} | grep toolchain) + echo "toolchain-name=$TOOLCHAIN_NAME" >> $GITHUB_OUTPUT + + - name: Upload prebuilt toolchain + if: inputs.upload_external_toolchain == true + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.target }}-${{ inputs.subtarget }}-external-toolchain + path: openwrt/bin/targets/${{ inputs.target }}/${{ inputs.subtarget }}/${{ steps.get-toolchain-name.outputs.toolchain-name }} + retention-days: 1 From 6c80c7533b7524bd333762523f089ff84cf64bdd Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 17 Dec 2022 02:02:26 +0100 Subject: [PATCH 05/40] CI: build: add option to configure container to use Add option to configure container to use for build test. By default the tools container is used if no option is provided. Signed-off-by: Christian Marangi (cherry picked from commit 803b0110485a12c1119a51044d17979795ede966) --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ca6f4e32e..da389e9cf8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,9 @@ on: secrets: coverity_api_token: inputs: + container_name: + type: string + default: tools target: required: true type: string @@ -112,7 +115,7 @@ jobs: needs: setup_build runs-on: ubuntu-latest - container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:${{ needs.setup_build.outputs.container_tag }} + container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/${{ inputs.container_name }}:${{ needs.setup_build.outputs.container_tag }} permissions: contents: read From 6099d083a656816847207c9cfcb4a1cf86e7aa00 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Tue, 23 May 2023 15:25:56 +0200 Subject: [PATCH 06/40] CI: build: add checks to test if toolchain container can be used Add checks to test if toolchain container can be used. This is to handle case of new target or migration of any sort. If the toolchain container can't be found, the tools container is used instead. Signed-off-by: Christian Marangi (cherry picked from commit 23a5c715a9296e828be5c32eadf68eacdb326a0a) --- .github/workflows/build.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da389e9cf8..c3843d1dfc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,6 +65,7 @@ jobs: outputs: owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} container_tag: ${{ steps.determine_tools_container.outputs.container_tag }} + container_name: ${{ steps.determine_tools_container.outputs.container_name }} steps: - name: Checkout @@ -91,6 +92,7 @@ jobs: - name: Determine tools container tag id: determine_tools_container run: | + CONTAINER_NAME=${{ inputs.container_name }} CONTAINER_TAG=latest if [ -n "${{ github.base_ref }}" ]; then if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then @@ -107,15 +109,29 @@ jobs: CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/^v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" fi fi - echo "Tools container to use tools:$CONTAINER_TAG" + + if [ "$CONTAINER_NAME" = "toolchain" ]; then + GHCR_TOKEN=$(echo ${{ secrets.GITHUB_TOKEN }} | base64) + GHCR_HEADER="Authorization: Bearer ${GHCR_TOKEN}" + GHCR_MANIFEST_LINK=https://ghcr.io/v2/${{ steps.lower_owner.outputs.owner_lc }}/${{ inputs.container_name }}/manifests/${{ inputs.target }}-${{ inputs.subtarget }}-"$CONTAINER_TAG" + # Check if container exist + if [ $(curl -s -o /dev/null -w "%{http_code}" -H "$GHCR_HEADER" -I "$GHCR_MANIFEST_LINK") = 200 ]; then + CONTAINER_TAG=${{ inputs.target }}-${{ inputs.subtarget }}-"$CONTAINER_TAG" + else + CONTAINER_NAME=tools + fi + fi + + echo "Tools container to use $CONTAINER_NAME:$CONTAINER_TAG" echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT + echo "container_name=$CONTAINER_NAME" >> $GITHUB_OUTPUT build: name: Build ${{ inputs.target }}/${{ inputs.subtarget }} needs: setup_build runs-on: ubuntu-latest - container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/${{ inputs.container_name }}:${{ needs.setup_build.outputs.container_tag }} + container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/${{ needs.setup_build.outputs.container_name }}:${{ needs.setup_build.outputs.container_tag }} permissions: contents: read From e2780cbb2feac4a5e5e7f010202a5e6eb92d8db3 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 17 Dec 2022 00:21:31 +0100 Subject: [PATCH 07/40] CI: push-containers: build and push container with external toolchain Build and push container with external toolchain embedded in the container image. Signed-off-by: Christian Marangi (cherry picked from commit e1370cdd497a07612413106d707973155ad3004b) --- .github/workflows/Dockerfile.toolchain | 8 ++ .github/workflows/push-containers.yml | 156 ++++++++++++++++++++++--- 2 files changed, 146 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/Dockerfile.toolchain diff --git a/.github/workflows/Dockerfile.toolchain b/.github/workflows/Dockerfile.toolchain new file mode 100644 index 0000000000..949bc2bb5c --- /dev/null +++ b/.github/workflows/Dockerfile.toolchain @@ -0,0 +1,8 @@ +ARG OWNER_LC +ARG CONTAINER_TAG + +FROM ghcr.io/$OWNER_LC/tools:$CONTAINER_TAG + +ARG TOOLCHAIN_NAME + +ADD $TOOLCHAIN_NAME /external-toolchain/ diff --git a/.github/workflows/push-containers.yml b/.github/workflows/push-containers.yml index e74e7c2216..3cc08dbef8 100644 --- a/.github/workflows/push-containers.yml +++ b/.github/workflows/push-containers.yml @@ -9,6 +9,10 @@ on: - '.github/workflows/build-tools.yml' - '.github/workflows/push-containers.yml' - '.github/workflows/Dockerfile.tools' + - 'toolchain/**' + - '.github/workflows/build.yml' + - '.github/workflows/toolchain.yml' + - '.github/workflows/Dockerfile.toolchain' permissions: contents: read @@ -18,29 +22,21 @@ concurrency: cancel-in-progress: true jobs: - build-linux-buildbot: - name: Build tools with buildbot container - if: ${{ github.repository_owner == 'openwrt' }} - uses: ./.github/workflows/build-tools.yml - with: - generate_prebuilt_artifacts: true - - push-tools-container: - needs: build-linux-buildbot - name: Push prebuilt tools container + determine-container-info: + name: Determine needed info to push containers if: ${{ github.repository_owner == 'openwrt' }} runs-on: ubuntu-latest - - permissions: - contents: read - packages: write + outputs: + owner-lc: ${{ steps.generate-owner-lc.outputs.owner-lc }} + container-tag: ${{ steps.determine-container-tag.outputs.container-tag }} steps: - name: Set lower case owner name + id: generate-owner-lc env: OWNER: ${{ github.repository_owner }} run: | - echo "OWNER_LC=${OWNER,,}" >> "$GITHUB_ENV" + echo "owner-lc=${OWNER,,}" >> "$GITHUB_OUTPUT" # Per branch tools container tag # By default stick to latest @@ -51,6 +47,7 @@ jobs: # (example branch openwrt-22.03 -> tools:openwrt-22.03) # (example branch openwrt-22.03-test -> tools:openwrt-22.03) - name: Determine tools container tag + id: determine-container-tag run: | CONTAINER_TAG=latest @@ -64,9 +61,27 @@ jobs: fi fi - echo "Tools container to push tools:$CONTAINER_TAG" - echo "CONTAINER_TAG=$CONTAINER_TAG" >> "$GITHUB_ENV" + echo "Container tag to push for tools and toolchain is $CONTAINER_TAG" + echo "container-tag=$CONTAINER_TAG" >> "$GITHUB_OUTPUT" + build-linux-buildbot: + name: Build tools with buildbot container + if: ${{ github.repository_owner == 'openwrt' }} + uses: ./.github/workflows/build-tools.yml + with: + generate_prebuilt_artifacts: true + + push-tools-container: + needs: [ determine-container-info, build-linux-buildbot ] + if: ${{ github.repository_owner == 'openwrt' }} + name: Push prebuilt tools container + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: - name: Checkout uses: actions/checkout@v3 with: @@ -94,5 +109,110 @@ jobs: with: context: openwrt push: true - tags: ghcr.io/${{ env.OWNER_LC }}/tools:${{ env.CONTAINER_TAG }} + tags: ghcr.io/${{ needs.determine-container-info.outputs.owner-lc }}/tools:${{ needs.determine-container-info.outputs.container-tag }} file: openwrt/.github/workflows/Dockerfile.tools + + determine-targets: + name: Set targets + if: ${{ github.repository_owner == 'openwrt' }} + runs-on: ubuntu-latest + outputs: + target: ${{ steps.find_targets.outputs.target }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set targets + id: find_targets + run: | + export TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null \ + | awk '{ print $1 }')" + + JSON='[' + FIRST=1 + for TARGET in $TARGETS; do + TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}' + [[ $FIRST -ne 1 ]] && JSON="$JSON"',' + JSON="$JSON""$TUPLE" + FIRST=0 + done + JSON="$JSON"']' + + echo -e "\n---- targets ----\n" + echo "$JSON" + echo -e "\n---- targets ----\n" + + echo "target=$JSON" >> $GITHUB_OUTPUT + + build: + name: Build Target Toolchain + if: ${{ github.repository_owner == 'openwrt' }} + needs: [ determine-targets, push-tools-container ] + permissions: + contents: read + packages: read + strategy: + fail-fast: False + matrix: + include: ${{fromJson(needs.determine-targets.outputs.target)}} + uses: ./.github/workflows/build.yml + with: + target: ${{ matrix.target }} + subtarget: ${{ matrix.subtarget }} + build_toolchain: true + build_external_toolchain: true + upload_external_toolchain: true + + push-toolchain-container: + name: Push Target Toolchain container + if: ${{ github.repository_owner == 'openwrt' }} + needs: [ determine-container-info, determine-targets, build ] + runs-on: ubuntu-latest + + strategy: + fail-fast: False + matrix: + include: ${{fromJson(needs.determine-targets.outputs.target)}} + + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: 'openwrt' + + - name: Download external toolchain from build job + uses: actions/download-artifact@v3 + with: + name: ${{ matrix.target }}-${{ matrix.subtarget }}-external-toolchain + path: openwrt + + - name: Find external toolchain name + id: get-toolchain-name + working-directory: openwrt + run: | + TOOLCHAIN_NAME=$(ls | grep toolchain-${{ matrix.target }}-${{ matrix.subtarget }}) + echo "toolchain-name=$TOOLCHAIN_NAME" >> $GITHUB_OUTPUT + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: openwrt + push: true + tags: ghcr.io/${{ needs.determine-container-info.outputs.owner-lc }}/toolchain:${{ matrix.target }}-${{ matrix.subtarget }}-${{ needs.determine-container-info.outputs.container-tag }} + file: openwrt/.github/workflows/Dockerfile.toolchain + build-args: | + OWNER_LC=${{ needs.determine-container-info.outputs.owner-lc }} + CONTAINER_TAG=${{ needs.determine-container-info.outputs.container-tag }} + TOOLCHAIN_NAME=${{ steps.get-toolchain-name.outputs.toolchain-name }} From e83384b87e2d3789800084bedc7ae3be2b203663 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 17 Dec 2022 15:07:28 +0100 Subject: [PATCH 08/40] CI: build: Add support to use container included external toolchain Add support to use container included external toolchain and skip redownloading external sdk for each test. Signed-off-by: Christian Marangi (cherry picked from commit 0fe5776f4a79a2b095912e258738e3203207e9dd) --- .github/workflows/build.yml | 21 ++++++++++++++++++++- .github/workflows/coverity.yml | 1 + .github/workflows/kernel.yml | 1 + .github/workflows/packages.yml | 1 + 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3843d1dfc..6948caf11e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -176,6 +176,11 @@ jobs: id: parse-toolchain working-directory: openwrt run: | + if [ -d /external-toolchain/ ]; then + echo "toolchain-type=external_container" >> $GITHUB_OUTPUT + exit 0 + fi + TOOLCHAIN_PATH=snapshots if [ -n "${{ github.base_ref }}" ]; then @@ -251,7 +256,7 @@ jobs: ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}- - name: Download external toolchain/sdk - if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal' + if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal' && steps.parse-toolchain.outputs.toolchain-type != 'external_container' shell: su buildbot -c "sh -e {0}" working-directory: openwrt run: | @@ -288,6 +293,20 @@ jobs: echo CONFIG_TARGET_PER_DEVICE_ROOTFS=y >> .config echo CONFIG_TARGET_ALL_PROFILES=y >> .config + - name: Configure external toolchain in container + if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_container' + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_DEVEL=y >> .config + echo CONFIG_AUTOREMOVE=y >> .config + echo CONFIG_CCACHE=y >> .config + + ./scripts/ext-toolchain.sh \ + --toolchain /external-toolchain/$(ls /external-toolchain/ | grep openwrt-toolchain)/toolchain-* \ + --overwrite-config \ + --config ${{ inputs.target }}/${{ inputs.subtarget }} + - name: Configure external toolchain if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_toolchain' shell: su buildbot -c "sh -e {0}" diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index db59ef8ca6..1035545632 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -17,6 +17,7 @@ jobs: packages: read uses: ./.github/workflows/build.yml with: + container_name: toolchain target: x86 subtarget: 64 build_full: true diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 02aee8b27c..b918b2d88e 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -109,6 +109,7 @@ jobs: include: ${{fromJson(needs.determine_targets.outputs.targets_subtargets)}} uses: ./.github/workflows/build.yml with: + container_name: toolchain target: ${{ matrix.target }} subtarget: ${{ matrix.subtarget }} build_kernel: true diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index e2f932b1ba..d8270cbb82 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -43,6 +43,7 @@ jobs: subtarget: 64 uses: ./.github/workflows/build.yml with: + container_name: toolchain target: ${{ matrix.target }} subtarget: ${{ matrix.subtarget }} build_kernel: true From f666723f6d4b480da3ddce75f20fec965c72120c Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Thu, 25 May 2023 13:52:03 +0200 Subject: [PATCH 09/40] CI: ignore master branch for push events Due to problem with migrating from master to main as the default branch and downstream project still requiring the master branch to be present, we currently have for push events double CI runs, one for main and one for master. To solve this ignore any push event to the master branch for every workflow that react on push events. Signed-off-by: Christian Marangi (cherry picked from commit f5a5ce8822e9add9627ecb6ea289c8de2b8a76a9) --- .github/workflows/kernel.yml | 2 ++ .github/workflows/packages.yml | 2 ++ .github/workflows/push-containers.yml | 2 ++ .github/workflows/toolchain.yml | 2 ++ .github/workflows/tools.yml | 2 ++ 5 files changed, 10 insertions(+) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index b918b2d88e..6be7ef28c2 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -17,6 +17,8 @@ on: - 'include/kernel*' - 'package/kernel/**' - 'target/linux/**' + branches-ignore: + - master permissions: contents: read diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index d8270cbb82..d4d3565cd7 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -19,6 +19,8 @@ on: - 'package/**' - 'target/linux/generic/**' - 'toolchain/**' + branches-ignore: + - master permissions: contents: read diff --git a/.github/workflows/push-containers.yml b/.github/workflows/push-containers.yml index 3cc08dbef8..71b9e47253 100644 --- a/.github/workflows/push-containers.yml +++ b/.github/workflows/push-containers.yml @@ -13,6 +13,8 @@ on: - '.github/workflows/build.yml' - '.github/workflows/toolchain.yml' - '.github/workflows/Dockerfile.toolchain' + branches-ignore: + - master permissions: contents: read diff --git a/.github/workflows/toolchain.yml b/.github/workflows/toolchain.yml index 5755ca25b9..54e31069e6 100644 --- a/.github/workflows/toolchain.yml +++ b/.github/workflows/toolchain.yml @@ -11,6 +11,8 @@ on: - '.github/workflows/build.yml' - '.github/workflows/toolchain.yml' - 'toolchain/**' + branches-ignore: + - master permissions: contents: read diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 76ebdc664b..83bf5e98f5 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -13,6 +13,8 @@ on: - 'tools/**' - '.github/workflows/build-tools.yml' - '.github/workflows/tools.yml' + branches-ignore: + - master permissions: contents: read From c5441d24d9c51e597fc01cdca860f6fe5f4794d9 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 27 May 2023 17:25:29 +0200 Subject: [PATCH 10/40] CI: build: split cache ccache in separate restore and save jobs Split caching ccache in separate restore and save jobs to always refresh the ccache across different runs. Currently if a key is restored, cache is not saved resulting in a less useful ccache that benefits from multiple runs. Signed-off-by: Christian Marangi (cherry picked from commit 6321361c6b13a37b0cfa279a51a0cf8239a7852c) --- .github/workflows/build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6948caf11e..31da7fa7ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -247,8 +247,9 @@ jobs: ./scripts/feeds update -a ./scripts/feeds install -a - - name: Cache ccache - uses: actions/cache@v3 + - name: Restore ccache cache + id: restore-ccache-cache + uses: actions/cache/restore@v3 with: path: openwrt/.ccache key: ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}-${{ hashFiles('openwrt/include/kernel-**') }} @@ -474,6 +475,12 @@ jobs: name: ${{ inputs.target }}-${{ inputs.subtarget }}-logs path: "openwrt/logs" + - name: Save ccache cache + uses: actions/cache/save@v3 + with: + path: openwrt/.ccache + key: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }} + - name: Find external toolchain name id: get-toolchain-name if: inputs.upload_external_toolchain == true From fad08e8e23bc1db8224a7f34c5f3775b59cfb577 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 28 May 2023 02:55:26 +0200 Subject: [PATCH 11/40] CI: build: add job to remove previous ccache cache if already exist Github Actions cache doesn't permit to overwrite cache if it does already exist. As a trick to refresh and have fresh ccache pool, delete the ccache cache if it does exist with the help of Github REST API. An additional permission is needed to access this API. Add this permittion to each user of the build workflow. Signed-off-by: Christian Marangi (cherry picked from commit 203cc0a7ef0bbf3b5a19db3caa96e91963ec154c) --- .github/workflows/build.yml | 11 +++++++++++ .github/workflows/coverity.yml | 1 + .github/workflows/kernel.yml | 1 + .github/workflows/label-kernel.yml | 2 ++ .github/workflows/label-target.yml | 1 + .github/workflows/packages.yml | 1 + .github/workflows/push-containers.yml | 1 + .github/workflows/toolchain.yml | 1 + 8 files changed, 19 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31da7fa7ab..7ce8a7c034 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -136,6 +136,7 @@ jobs: permissions: contents: read packages: read + actions: write steps: - name: Checkout master directory @@ -475,6 +476,16 @@ jobs: name: ${{ inputs.target }}-${{ inputs.subtarget }}-logs path: "openwrt/logs" + - name: Delete already present ccache cache + if: steps.restore-ccache-cache.outputs.cache-hit == 'true' + uses: octokit/request-action@v2.x + with: + route: DELETE /repos/{repository}/actions/caches?key={key} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + INPUT_REPOSITORY: ${{ github.repository }} + INPUT_KEY: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }} + - name: Save ccache cache uses: actions/cache/save@v3 with: diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 1035545632..363ce3a29a 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -15,6 +15,7 @@ jobs: permissions: contents: read packages: read + actions: write uses: ./.github/workflows/build.yml with: container_name: toolchain diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 6be7ef28c2..d9ab8581c9 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -105,6 +105,7 @@ jobs: permissions: contents: read packages: read + actions: write strategy: fail-fast: False matrix: diff --git a/.github/workflows/label-kernel.yml b/.github/workflows/label-kernel.yml index 67faaddfcd..29a9d79558 100644 --- a/.github/workflows/label-kernel.yml +++ b/.github/workflows/label-kernel.yml @@ -30,6 +30,7 @@ jobs: permissions: contents: read packages: read + actions: write uses: ./.github/workflows/build.yml with: container_name: toolchain @@ -44,6 +45,7 @@ jobs: permissions: contents: read packages: read + actions: write uses: ./.github/workflows/check-kernel-patches.yml with: target: ${{ needs.set_target.outputs.target }} diff --git a/.github/workflows/label-target.yml b/.github/workflows/label-target.yml index 78aea28b10..610aab026a 100644 --- a/.github/workflows/label-target.yml +++ b/.github/workflows/label-target.yml @@ -30,6 +30,7 @@ jobs: permissions: contents: read packages: read + actions: write uses: ./.github/workflows/build.yml with: container_name: toolchain diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index d4d3565cd7..8ab07f1f07 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -35,6 +35,7 @@ jobs: permissions: contents: read packages: read + actions: write strategy: fail-fast: False matrix: diff --git a/.github/workflows/push-containers.yml b/.github/workflows/push-containers.yml index 71b9e47253..04a9b8d8e9 100644 --- a/.github/workflows/push-containers.yml +++ b/.github/workflows/push-containers.yml @@ -154,6 +154,7 @@ jobs: permissions: contents: read packages: read + actions: write strategy: fail-fast: False matrix: diff --git a/.github/workflows/toolchain.yml b/.github/workflows/toolchain.yml index 54e31069e6..4f4d78f4f8 100644 --- a/.github/workflows/toolchain.yml +++ b/.github/workflows/toolchain.yml @@ -61,6 +61,7 @@ jobs: permissions: contents: read packages: read + actions: write strategy: fail-fast: False matrix: From c8d4694d2c94fec836533b7a0635c9d41b4b7c3a Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 28 May 2023 03:22:51 +0200 Subject: [PATCH 12/40] CI: build: add option to disable use of ccache Add option to disable use of ccache. This can be useful for some sensible test that should not use ccache as they can cause side effects of any sort. (example Coverity Scan) Signed-off-by: Christian Marangi (cherry picked from commit b9a41c1e84067bcc63aac633b72e7dc808bfe6fe) --- .github/workflows/build.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ce8a7c034..27ed5cc218 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,9 @@ on: type: boolean upload_external_toolchain: type: boolean + use_ccache_cache: + type: boolean + default: true permissions: contents: read @@ -250,6 +253,7 @@ jobs: - name: Restore ccache cache id: restore-ccache-cache + if: inputs.use_ccache_cache == true uses: actions/cache/restore@v3 with: path: openwrt/.ccache @@ -295,6 +299,13 @@ jobs: echo CONFIG_TARGET_PER_DEVICE_ROOTFS=y >> .config echo CONFIG_TARGET_ALL_PROFILES=y >> .config + - name: Configure ccache + if: inputs.use_ccache_cache == true + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_CCACHE=y >> .config + - name: Configure external toolchain in container if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_container' shell: su buildbot -c "sh -e {0}" @@ -302,7 +313,6 @@ jobs: run: | echo CONFIG_DEVEL=y >> .config echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config ./scripts/ext-toolchain.sh \ --toolchain /external-toolchain/$(ls /external-toolchain/ | grep openwrt-toolchain)/toolchain-* \ @@ -316,7 +326,6 @@ jobs: run: | echo CONFIG_DEVEL=y >> .config echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config ./scripts/ext-toolchain.sh \ --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ @@ -358,7 +367,6 @@ jobs: run: | echo CONFIG_DEVEL=y >> .config echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config ./scripts/ext-toolchain.sh \ --toolchain ${{ env.TOOLCHAIN_FILE }}/staging_dir/toolchain-* \ @@ -372,7 +380,6 @@ jobs: run: | echo CONFIG_DEVEL=y >> .config echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config echo "CONFIG_TARGET_${{ inputs.target }}=y" >> .config echo "CONFIG_TARGET_${{ inputs.target }}_${{ inputs.subtarget }}=y" >> .config @@ -477,7 +484,7 @@ jobs: path: "openwrt/logs" - name: Delete already present ccache cache - if: steps.restore-ccache-cache.outputs.cache-hit == 'true' + if: steps.restore-ccache-cache.outputs.cache-hit == 'true' && inputs.use_ccache_cache == true uses: octokit/request-action@v2.x with: route: DELETE /repos/{repository}/actions/caches?key={key} @@ -487,6 +494,7 @@ jobs: INPUT_KEY: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }} - name: Save ccache cache + if: inputs.use_ccache_cache == true uses: actions/cache/save@v3 with: path: openwrt/.ccache From d7e2468e13fb871026e1969845a1c5ccb9a1dcee Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 28 May 2023 03:12:54 +0200 Subject: [PATCH 13/40] CI: build: add option to define custom ccache cache type Add new input to define custom ccache cache type. This is useful to use a different ccache cache for some special workflow that may do more test than simple kernel compilation. Signed-off-by: Christian Marangi (cherry picked from commit 07b52a8a25f261e3cee03f4980e4bc868e9ee5cc) --- .github/workflows/build.yml | 7 +++++-- .github/workflows/packages.yml | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27ed5cc218..0fbeb5b0f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,6 +57,9 @@ on: use_ccache_cache: type: boolean default: true + ccache_type: + type: string + default: kernel permissions: contents: read @@ -257,9 +260,9 @@ jobs: uses: actions/cache/restore@v3 with: path: openwrt/.ccache - key: ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}-${{ hashFiles('openwrt/include/kernel-**') }} + key: ccache-${{ inputs.ccache_type }}-${{ inputs.target }}/${{ inputs.subtarget }}-${{ hashFiles('openwrt/include/kernel-**') }} restore-keys: | - ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}- + ccache-${{ inputs.ccache_type }}-${{ inputs.target }}/${{ inputs.subtarget }}- - name: Download external toolchain/sdk if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal' && steps.parse-toolchain.outputs.toolchain-type != 'external_container' diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 8ab07f1f07..58bbcd0131 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -53,4 +53,5 @@ jobs: build_all_kmods: true build_all_modules: true build_full: true + ccache_type: packages From 51adcb7cd223f56984abdc27b929d16bde4284cf Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 28 May 2023 03:15:50 +0200 Subject: [PATCH 14/40] CI: build: fix ccache cache usage CCache cache is currently broken due to a funny bug in ccache compiler type detection. It seems ccache compiler type detection is very fragile and with the use of external toolchain doesn't correctly detect the type. The type detected is set to other instead of gcc resulting in ccache complaining for unsupported compiler options. To handle this problem, force the compiler type to gcc to make ccache correctly work and speedup compilation. Signed-off-by: Christian Marangi (cherry picked from commit ae7b05328cf471780de8559fba845c4b564e059e) --- .github/workflows/build.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fbeb5b0f5..0c0c05f402 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -302,11 +302,22 @@ jobs: echo CONFIG_TARGET_PER_DEVICE_ROOTFS=y >> .config echo CONFIG_TARGET_ALL_PROFILES=y >> .config - - name: Configure ccache + # ccache for some reason have problem detecting compiler type + # with external toolchain. This cause the complete malfunction + # of ccache with the result of tons of unsupported compiler + # option error. + # To fix this force compiler type to gcc. + - name: Configure ccache and apply fixes if: inputs.use_ccache_cache == true shell: su buildbot -c "sh -e {0}" working-directory: openwrt + env: + SYSTEM_CCACHE_CONF: staging_dir/host/etc/ccache.conf run: | + touch $SYSTEM_CCACHE_CONF + + echo compiler_type=gcc >> $SYSTEM_CCACHE_CONF + echo CONFIG_CCACHE=y >> .config - name: Configure external toolchain in container From 15f4d6b2441e47ed63df961c43515cba11da3a7b Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 28 May 2023 03:30:12 +0200 Subject: [PATCH 15/40] CI: coverity: disable ccache usage Disable ccache usage for coverity workflow as it may cause side effect in the produced bins. Signed-off-by: Christian Marangi (cherry picked from commit 2129ee1879f564a9992a6761d4c9e77077c48e95) --- .github/workflows/coverity.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 363ce3a29a..72f39a729b 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -23,6 +23,7 @@ jobs: subtarget: 64 build_full: true include_feeds: true + use_ccache_cache: false coverity_compiler_template_list: >- x86_64-openwrt-linux-gcc x86_64-openwrt-linux-musl-gcc From 5bfa66bcf3bfcadea059bae1f1d18b388318caa4 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 28 May 2023 09:11:29 +0200 Subject: [PATCH 16/40] CI: build: limit cache save/delete only on push events Limit ccache cache save/delete only on push events. Saving ccache cache for pull request will result in bloat and refreshing ccache is not possible due to security measure on enforcing read permission on pull_request events. Signed-off-by: Christian Marangi (cherry picked from commit ff66a7c1c0f012324c0d2d90f047e6976c4fba11) --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c0c05f402..95d19f4c4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -498,7 +498,7 @@ jobs: path: "openwrt/logs" - name: Delete already present ccache cache - if: steps.restore-ccache-cache.outputs.cache-hit == 'true' && inputs.use_ccache_cache == true + if: steps.restore-ccache-cache.outputs.cache-hit == 'true' && inputs.use_ccache_cache == true && github.event_name == 'push' uses: octokit/request-action@v2.x with: route: DELETE /repos/{repository}/actions/caches?key={key} @@ -508,7 +508,7 @@ jobs: INPUT_KEY: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }} - name: Save ccache cache - if: inputs.use_ccache_cache == true + if: inputs.use_ccache_cache == true && github.event_name == 'push' uses: actions/cache/save@v3 with: path: openwrt/.ccache From f7e4f8cbbf8c5ae8602a77112cb2aacb067fce05 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Tue, 30 May 2023 18:57:42 +0200 Subject: [PATCH 17/40] CI: add support for getting ccache cache from S3 Add support for getting ccache cache from S3. ccache is archieved in a tar and downloaded from S3 Cloud Storage. For push events, ccache is then uplodaed back to S3 to refresh and have a ccache cache always fresh. An additional workflow is added to upload files to an S3 Cloud Storage from artifacts uplodaed to github. The minio tool is used to upload files to S3. If the ccache can't be downloaded from s3, we fallback to github cache system. Also limit s3 upload to the openwrt repository since external fork won't have (obviously) the required secrtes to upload data to the S3 Cloud Storage. Signed-off-by: Christian Marangi (cherry picked from commit ebbc806d30502ff003ae7a19098c6afaaf1295a5) --- .github/workflows/build.yml | 40 ++++++++++++++++++++++-- .github/workflows/kernel.yml | 18 +++++++++++ .github/workflows/packages.yml | 23 ++++++++++++++ .github/workflows/upload-file-s3.yml | 46 ++++++++++++++++++++++++++++ 4 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/upload-file-s3.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95d19f4c4e..efaf759403 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,6 +60,8 @@ on: ccache_type: type: string default: kernel + upload_ccache_cache: + type: boolean permissions: contents: read @@ -232,6 +234,20 @@ jobs: echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" echo "TOOLCHAIN_PATH=$TOOLCHAIN_PATH" >> "$GITHUB_ENV" + - name: Download and extract ccache cache from s3 + id: restore-ccache-cache-s3 + if: inputs.use_ccache_cache == true + working-directory: openwrt + run: | + ENDPOINT=https://storage.googleapis.com + BUCKET=openwrt-ci-cache + CCACHE_TAR=ccache-${{ inputs.ccache_type }}-${{ inputs.target }}-${{ inputs.subtarget }}.tar + + if curl -o /dev/null -s --head --fail $ENDPOINT/$BUCKET/$CCACHE_TAR; then + wget -O - $ENDPOINT/$BUCKET/$CCACHE_TAR | tar -xf - + echo "cache-hit=true" >> $GITHUB_OUTPUT + fi + - name: Fix permission run: | chown -R buildbot:buildbot openwrt @@ -256,7 +272,7 @@ jobs: - name: Restore ccache cache id: restore-ccache-cache - if: inputs.use_ccache_cache == true + if: inputs.use_ccache_cache == true && steps.restore-ccache-cache-s3.outputs.cache-hit != 'true' uses: actions/cache/restore@v3 with: path: openwrt/.ccache @@ -498,7 +514,8 @@ jobs: path: "openwrt/logs" - name: Delete already present ccache cache - if: steps.restore-ccache-cache.outputs.cache-hit == 'true' && inputs.use_ccache_cache == true && github.event_name == 'push' + if: steps.restore-ccache-cache.outputs.cache-hit == 'true' && inputs.use_ccache_cache == true && + github.event_name == 'push' && steps.restore-ccache-cache-s3.outputs.cache-hit != 'true' uses: octokit/request-action@v2.x with: route: DELETE /repos/{repository}/actions/caches?key={key} @@ -508,12 +525,29 @@ jobs: INPUT_KEY: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }} - name: Save ccache cache - if: inputs.use_ccache_cache == true && github.event_name == 'push' + if: inputs.use_ccache_cache == true && github.event_name == 'push' && + steps.restore-ccache-cache-s3.outputs.cache-hit != 'true' uses: actions/cache/save@v3 with: path: openwrt/.ccache key: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }} + - name: Archive ccache + if: inputs.use_ccache_cache == true && github.event_name == 'push' && + inputs.upload_ccache_cache == true + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: tar -cf ccache-${{ inputs.ccache_type }}-${{ inputs.target }}-${{ inputs.subtarget }}.tar .ccache + + - name: Upload ccache cache + if: inputs.use_ccache_cache == true && github.event_name == 'push' && + inputs.upload_ccache_cache == true + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.target }}-${{ inputs.subtarget }}-ccache-cache + path: openwrt/ccache-${{ inputs.ccache_type }}-${{ inputs.target }}-${{ inputs.subtarget }}.tar + retention-days: 1 + - name: Find external toolchain name id: get-toolchain-name if: inputs.upload_external_toolchain == true diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index d9ab8581c9..5f18a39c55 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -117,6 +117,7 @@ jobs: subtarget: ${{ matrix.subtarget }} build_kernel: true build_all_kmods: true + upload_ccache_cache: ${{ github.repository_owner == 'openwrt' }} check-kernel-patches: name: Check Kernel patches @@ -133,3 +134,20 @@ jobs: target: ${{ matrix.target }} subtarget: ${{ matrix.subtarget }} + upload-ccache-cache-in-s3: + if: github.event_name == 'push' && github.repository_owner == 'openwrt' + name: Upload ccache cache to s3 + needs: [determine_targets, build] + strategy: + fail-fast: False + matrix: + include: ${{fromJson(needs.determine_targets.outputs.targets_subtargets)}} + secrets: + s3_access_key: ${{ secrets.GCS_S3_ACCESS_KEY }} + s3_secret_key: ${{ secrets.GCS_S3_SECRET_KEY }} + uses: ./.github/workflows/upload-file-s3.yml + with: + endpoint: https://storage.googleapis.com + bucket: openwrt-ci-cache + download_id: ${{ matrix.target }}-${{ matrix.subtarget }}-ccache-cache + filename: ccache-kernel-${{ matrix.target }}-${{ matrix.subtarget }}.tar diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 58bbcd0131..fe2898cacd 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -54,4 +54,27 @@ jobs: build_all_modules: true build_full: true ccache_type: packages + upload_ccache_cache: ${{ github.repository_owner == 'openwrt' }} + + upload-ccache-cache-in-s3: + if: github.event_name == 'push' && github.repository_owner == 'openwrt' + name: Upload ccache cache to s3 + needs: build + strategy: + fail-fast: False + matrix: + include: + - target: malta + subtarget: be + - target: x86 + subtarget: 64 + secrets: + s3_access_key: ${{ secrets.GCS_S3_ACCESS_KEY }} + s3_secret_key: ${{ secrets.GCS_S3_SECRET_KEY }} + uses: ./.github/workflows/upload-file-s3.yml + with: + endpoint: https://storage.googleapis.com + bucket: openwrt-ci-cache + download_id: ${{ matrix.target }}-${{ matrix.subtarget }}-ccache-cache + filename: ccache-packages-${{ matrix.target }}-${{ matrix.subtarget }}.tar diff --git a/.github/workflows/upload-file-s3.yml b/.github/workflows/upload-file-s3.yml new file mode 100644 index 0000000000..6bcb172468 --- /dev/null +++ b/.github/workflows/upload-file-s3.yml @@ -0,0 +1,46 @@ +name: Upload File to S3 + +on: + workflow_call: + secrets: + s3_access_key: + s3_secret_key: + inputs: + endpoint: + required: true + type: string + bucket: + required: true + type: string + download_id: + required: true + type: string + filename: + required: true + type: string + +jobs: + upload-file-in-s3: + name: Upload file in S3 + runs-on: ubuntu-latest + + steps: + - name: Install minio + run: | + curl https://dl.min.io/client/mc/release/linux-amd64/mc \ + --create-dirs \ + -o $GITHUB_WORKSPACE/minio-binaries/mc + + chmod +x $GITHUB_WORKSPACE/minio-binaries/mc + echo $GITHUB_WORKSPACE/minio-binaries/ >> $GITHUB_PATH + + - name: Setup minio + run: mc alias set s3 ${{ inputs.endpoint }} ${{ secrets.s3_access_key }} ${{ secrets.s3_secret_key }} + + - name: Download file + uses: actions/download-artifact@v3 + with: + name: ${{ inputs.download_id }} + + - name: Upload file to s3 + run: mc cp ${{ inputs.filename }} s3/${{ inputs.bucket }}/ From 05331f0ef8e9c9fd39e9062e44da3fc6c78563c2 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Tue, 30 May 2023 20:43:18 +0200 Subject: [PATCH 18/40] CI: kernel: test each subtarget on push events Test each subtarget on push events to improve testing and to refresh ccache of each subtarget. Signed-off-by: Christian Marangi (cherry picked from commit 5bafc4352fb543c03389b6237f0e2fe327f328fa) --- .github/workflows/kernel.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 5f18a39c55..3aa46f5cd7 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -54,10 +54,12 @@ jobs: TARGETS_SUBTARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1 | awk '{ print $1 }')" TARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1,1 | awk '{ print $1 }')" - # On testing non-specific target, skip testing each subtarget - if echo "$CHANGED_FILES" | grep -v -q target/linux || - echo "$CHANGED_FILES" | grep -q target/linux/generic; then - TARGETS_SUBTARGETS=$TARGETS + # On testing non-specific target, skip testing each subtarget if we are testing pr + if [ ${{ github.event_name }} != 'push' ]; then + if echo "$CHANGED_FILES" | grep -v -q target/linux || + echo "$CHANGED_FILES" | grep -q target/linux/generic; then + TARGETS_SUBTARGETS=$TARGETS + fi fi JSON_TARGETS_SUBTARGETS='[' From 37395ecb3214f6c086668b9f1a3c3405e06acfe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 26 May 2023 11:38:24 +0200 Subject: [PATCH 19/40] ci: bump buildworker container to version v6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Its being used by buildbot workers, adds g++-multilib to fix node cross-compilation from a 64-bit build machine to 32-bit host. References: https://github.com/openwrt/buildbot/pull/7 Signed-off-by: Petr Štetiar (cherry picked from commit 567784127e92ba6f9291adb1a546f567e50d9850) --- .github/workflows/Dockerfile.tools | 2 +- .github/workflows/build-tools.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Dockerfile.tools b/.github/workflows/Dockerfile.tools index df5892618a..5d365fc56d 100644 --- a/.github/workflows/Dockerfile.tools +++ b/.github/workflows/Dockerfile.tools @@ -1,4 +1,4 @@ -FROM ghcr.io/openwrt/buildbot/buildworker-v3.8.0:v2 +FROM ghcr.io/openwrt/buildbot/buildworker-v3.8.0:v6 COPY --chown=buildbot staging_dir/host /prebuilt_tools/staging_dir/host COPY --chown=buildbot build_dir/host /prebuilt_tools/build_dir/host diff --git a/.github/workflows/build-tools.yml b/.github/workflows/build-tools.yml index 9b865f2608..0629b1b62a 100644 --- a/.github/workflows/build-tools.yml +++ b/.github/workflows/build-tools.yml @@ -13,7 +13,7 @@ jobs: build: name: Build tools runs-on: ubuntu-latest - container: ghcr.io/openwrt/buildbot/buildworker-v3.8.0:v2 + container: ghcr.io/openwrt/buildbot/buildworker-v3.8.0:v6 steps: - name: Checkout From 6cdd9a6de493cc9b8152a73d8449673b1190d1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 26 May 2023 11:41:18 +0200 Subject: [PATCH 20/40] ci: build: verify downloaded toolchain tarball MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CDNs are known to ship outdated or corrupted files, if it unpacks correctly, it necessarily doesn't mean, that we're using the desired content. So lets fix it by checking the tarball as well. I'm adding GPG checking explicitly, its not needed, but just double checking, that everything is working as expected on build infrastructure. Signed-off-by: Petr Štetiar (cherry picked from commit 95dde523297c652072ee96ac32d22912a43ef761) --- .github/workflows/build.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efaf759403..367a43383b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -280,13 +280,23 @@ jobs: restore-keys: | ccache-${{ inputs.ccache_type }}-${{ inputs.target }}/${{ inputs.subtarget }}- + - name: Import GPG keys + shell: su buildbot -c "sh -e {0}" + if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal' && steps.parse-toolchain.outputs.toolchain-type != 'external_container' + run: gpg --receive-keys 0xCD84BCED626471F1 0x1D53D1877742E911 0xCD54E82DADB3684D + - name: Download external toolchain/sdk if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal' && steps.parse-toolchain.outputs.toolchain-type != 'external_container' shell: su buildbot -c "sh -e {0}" working-directory: openwrt run: | - wget -O - https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ inputs.target }}/${{ inputs.subtarget }}/${{ env.TOOLCHAIN_FILE }}.tar.xz \ - | tar --xz -xf - + wget https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ inputs.target }}/${{ inputs.subtarget }}/${{ env.TOOLCHAIN_FILE }}.tar.xz + wget https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ inputs.target }}/${{ inputs.subtarget }}/sha256sums.asc + wget https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ inputs.target }}/${{ inputs.subtarget }}/sha256sums + gpg --with-fingerprint --verify sha256sums.asc + sha256sum --check --ignore-missing sha256sums + tar --xz -xf ${{ env.TOOLCHAIN_FILE }}.tar.xz + rm ${{ env.TOOLCHAIN_FILE }}.tar.xz sha256sums - name: Configure testing kernel if: inputs.testing == true From b00fcab13c663a8c85ff2a16f3225febfe5db0d9 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 31 May 2023 17:40:11 +0200 Subject: [PATCH 21/40] CI: label-kernel: support compile testing kernel version and all target Add support to label-kernel for compiling testing kernel version and check patches. To trigger this special build appent :testing to the normal label. Example: - ci:kernel:ipq806x:generic:testing Test will fail if the requested target doesn't have a defined kernel testing version. Also add support for testing all target and subtarget. To trigger this some special pattern are added: - ci:kernel:all:all Trigger test for all target and subtarget - ci:kernel:all:first Trigger test for all target and the first subtarget in alphabetical order for the target. With these special case :testing can also be used and every target and subtarget that supports kernel testing version will be selected: - ci:kernel:all:all:testing Trigger test for all target and subtarget that have a kernel testing version defined. - ci:kernel:all:first:testing Trigger test for all target and the first subtarget in alphabetical order for the target that, if they have a kernel testing version defined. Signed-off-by: Christian Marangi (cherry picked from commit 218deba503f38e2f44f5012baf96af91b3e00c6a) --- .github/workflows/label-kernel.yml | 97 +++++++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 10 deletions(-) diff --git a/.github/workflows/label-kernel.yml b/.github/workflows/label-kernel.yml index 29a9d79558..eab79cf0c0 100644 --- a/.github/workflows/label-kernel.yml +++ b/.github/workflows/label-kernel.yml @@ -12,17 +12,84 @@ jobs: name: Set target runs-on: ubuntu-latest outputs: - target: ${{ steps.set_target.outputs.target }} - subtarget: ${{ steps.set_target.outputs.subtarget }} + targets_subtargets: ${{ steps.set_target.outputs.targets_subtargets }} + targets: ${{ steps.set_target.outputs.targets }} steps: - - name: Set target - id: set_target + - name: Checkout + uses: actions/checkout@v3 + + - name: Parse label + id: parse_label env: CI_EVENT_LABEL_NAME: ${{ github.event.label.name }} run: | - echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/target=\1/p' | tee --append $GITHUB_OUTPUT - echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/subtarget=\2/p' | tee --append $GITHUB_OUTPUT + echo "$CI_EVENT_LABEL_NAME" | sed -n 's/ci:kernel:\([^:]*\):\([^:]*\):*\([^:]*\)$/target=\1/p' | tee --append $GITHUB_OUTPUT + echo "$CI_EVENT_LABEL_NAME" | sed -n 's/ci:kernel:\([^:]*\):\([^:]*\):*\([^:]*\)$/subtarget=\2/p' | tee --append $GITHUB_OUTPUT + echo "$CI_EVENT_LABEL_NAME" | sed -n 's/ci:kernel:\([^:]*\):\([^:]*\):*\([^:]*\)$/testing=\3/p' | tee --append $GITHUB_OUTPUT + + - name: Set targets + id: set_target + run: | + ALL_TARGETS="$(perl ./scripts/dump-target-info.pl kernels 2>/dev/null)" + + TARGETS_SUBTARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1)" + TARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1,1)" + + [ "${{ steps.parse_label.outputs.subtarget }}" = "first" ] && TARGETS_SUBTARGETS=$TARGETS + + JSON_TARGETS_SUBTARGETS='[' + FIRST=1 + while IFS= read -r line; do + TARGET_SUBTARGET=$(echo $line | cut -d " " -f 1) + TARGET=$(echo $TARGET_SUBTARGET | cut -d "/" -f 1) + SUBTARGET=$(echo $TARGET_SUBTARGET | cut -d "/" -f 2) + + [ "${{ steps.parse_label.outputs.target }}" != "all" ] && [ "${{ steps.parse_label.outputs.target }}" != "$TARGET" ] && continue + [ "${{ steps.parse_label.outputs.subtarget }}" != "all" ] && [ "${{ steps.parse_label.outputs.subtarget }}" != "first" ] && + [ "${{ steps.parse_label.outputs.subtarget }}" != $SUBTARGET ] && continue + if [ "${{ steps.parse_label.outputs.testing }}" = "testing" ]; then + TESTING_KERNEL_VER=$(echo $line | cut -d " " -f 3) + [ -z "$TESTING_KERNEL_VER" ] && continue + fi + + TUPLE='{"target":"'"$TARGET"'","subtarget":"'"$SUBTARGET"'","testing":"'"$TESTING_KERNEL_VER"'"}' + [[ $FIRST -ne 1 ]] && JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"',' + JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS""$TUPLE" + FIRST=0 + done <<< "$TARGETS_SUBTARGETS" + JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"']' + + JSON_TARGETS='[' + FIRST=1 + while IFS= read -r line; do + TARGET_SUBTARGET=$(echo $line | cut -d " " -f 1) + TARGET=$(echo $TARGET_SUBTARGET | cut -d "/" -f 1) + SUBTARGET=$(echo $TARGET_SUBTARGET | cut -d "/" -f 2) + + [ "${{ steps.parse_label.outputs.target }}" != "all" ] && [ "${{ steps.parse_label.outputs.target }}" != $TARGET ] && continue + if [ "${{ steps.parse_label.outputs.testing }}" = "testing" ]; then + TESTING_KERNEL_VER=$(echo $line | cut -d " " -f 3) + [ -z "$TESTING_KERNEL_VER" ] && continue + fi + + TUPLE='{"target":"'"$TARGET"'","subtarget":"'"$SUBTARGET"'","testing":"'"$TESTING_KERNEL_VER"'"}' + [[ $FIRST -ne 1 ]] && JSON_TARGETS="$JSON_TARGETS"',' + JSON_TARGETS="$JSON_TARGETS""$TUPLE" + FIRST=0 + done <<< "$TARGETS" + JSON_TARGETS="$JSON_TARGETS"']' + + echo -e "\n---- targets to build ----\n" + echo "$JSON_TARGETS_SUBTARGETS" + echo -e "\n---- targets to build ----\n" + + echo -e "\n---- targets to check patch ----\n" + echo "$JSON_TARGETS" + echo -e "\n---- targets to check patch ----\n" + + echo "targets_subtargets=$JSON_TARGETS_SUBTARGETS" >> $GITHUB_OUTPUT + echo "targets=$JSON_TARGETS" >> $GITHUB_OUTPUT build_kernel: name: Build Kernel with external toolchain @@ -32,10 +99,15 @@ jobs: packages: read actions: write uses: ./.github/workflows/build.yml + strategy: + fail-fast: False + matrix: + include: ${{fromJson(needs.set_target.outputs.targets_subtargets)}} with: container_name: toolchain - target: ${{ needs.set_target.outputs.target }} - subtarget: ${{ needs.set_target.outputs.subtarget }} + target: ${{ matrix.target }} + subtarget: ${{ matrix.subtarget }} + testing: ${{ matrix.testing != '' && true }} build_kernel: true build_all_kmods: true @@ -46,7 +118,12 @@ jobs: contents: read packages: read actions: write + strategy: + fail-fast: False + matrix: + include: ${{fromJson(needs.set_target.outputs.targets)}} uses: ./.github/workflows/check-kernel-patches.yml with: - target: ${{ needs.set_target.outputs.target }} - subtarget: ${{ needs.set_target.outputs.subtarget }} + target: ${{ matrix.target }} + subtarget: ${{ matrix.subtarget }} + testing: ${{ matrix.testing != '' && true }} From 3826ebbd181770d43a2a057611707d96ec90b550 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Thu, 3 Nov 2022 13:32:51 +0100 Subject: [PATCH 22/40] CI: build-tools: build all host tools Now that we build also core packages, we need more host tools. Compile all of them to reduce compile time on other actions. Signed-off-by: Christian Marangi (cherry picked from commit de9955a62f6aab6eafb2cfdffc4829ee97e69c04) --- .github/workflows/build-tools.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-tools.yml b/.github/workflows/build-tools.yml index 0629b1b62a..0212925c50 100644 --- a/.github/workflows/build-tools.yml +++ b/.github/workflows/build-tools.yml @@ -32,6 +32,7 @@ jobs: echo CONFIG_DEVEL=y >> .config echo CONFIG_AUTOREMOVE=y >> .config echo CONFIG_CCACHE=y >> .config + echo CONFIG_BUILD_ALL_HOST_TOOLS=y >> .config - name: Make prereq shell: su buildbot -c "sh -e {0}" From 76a9b0e02a614ec15f4dc771df32de90ab30d779 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 19 Jun 2023 13:55:32 +0200 Subject: [PATCH 23/40] CI: migrate each workflow to use reusable workflow from dedicated repo Migrate each workflow to use reusable workflow from dedicated repo to skip pushing CI related commits to openwrt and better track versioning of CI workflow. Signed-off-by: Christian Marangi (cherry picked from commit 38cc09165fd11caa9599d960280bd91dbaba7a62) --- .github/workflows/coverity.yml | 51 +------ .github/workflows/kernel.yml | 121 +--------------- .github/workflows/label-kernel.yml | 119 +-------------- .github/workflows/label-target.yml | 32 +---- .github/workflows/packages.yml | 46 +----- .github/workflows/push-containers.yml | 199 +------------------------- .github/workflows/toolchain.yml | 50 +------ .github/workflows/tools.yml | 74 +--------- 8 files changed, 22 insertions(+), 670 deletions(-) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 72f39a729b..f54695986d 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -16,53 +16,4 @@ jobs: contents: read packages: read actions: write - uses: ./.github/workflows/build.yml - with: - container_name: toolchain - target: x86 - subtarget: 64 - build_full: true - include_feeds: true - use_ccache_cache: false - coverity_compiler_template_list: >- - x86_64-openwrt-linux-gcc - x86_64-openwrt-linux-musl-gcc - # qosify fails to build with cov-build - coverity_check_packages: >- - cgi-io - dnsmasq - dropbear - firewall - fstools - fwtool - iwinfo - jsonfilter - libnl-tiny - libubox - mtd - netifd - odhcp6c - odhcpd - opkg - procd - relayd - rpcd - swconfig - ubox - ubus - ucert - uci - uclient - ucode - ugps - uhttpd - umbim - umdns - unetd - uqmi - urngd - usbmode - usign - usteer - ustp - ustream-ssl + uses: openwrt/actions-shared-workflows/.github/workflows/coverity.yml@main diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 3aa46f5cd7..87b8a14293 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -28,128 +28,13 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - determine_targets: - name: Set targets - runs-on: ubuntu-latest - outputs: - targets_subtargets: ${{ steps.find_targets.outputs.targets_subtargets }} - targets: ${{ steps.find_targets.outputs.targets }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v35 - - - name: Set targets - id: find_targets - run: | - ALL_TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null)" - CHANGED_FILES="$(echo ${{ steps.changed-files.outputs.all_changed_files }} | tr ' ' '\n')" - - TARGETS_SUBTARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1 | awk '{ print $1 }')" - TARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1,1 | awk '{ print $1 }')" - - # On testing non-specific target, skip testing each subtarget if we are testing pr - if [ ${{ github.event_name }} != 'push' ]; then - if echo "$CHANGED_FILES" | grep -v -q target/linux || - echo "$CHANGED_FILES" | grep -q target/linux/generic; then - TARGETS_SUBTARGETS=$TARGETS - fi - fi - - JSON_TARGETS_SUBTARGETS='[' - FIRST=1 - for TARGET in $TARGETS_SUBTARGETS; do - if echo "$CHANGED_FILES" | grep -v -q target/linux || - echo "$CHANGED_FILES" | grep -q target/linux/generic || - echo "$CHANGED_FILES" | grep -q $(echo $TARGET | cut -d "/" -f 1); then - TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}' - [[ $FIRST -ne 1 ]] && JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"',' - JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS""$TUPLE" - FIRST=0 - fi - done - JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"']' - - JSON_TARGETS='[' - FIRST=1 - for TARGET in $TARGETS; do - if echo "$CHANGED_FILES" | grep -v -q target/linux || - echo "$CHANGED_FILES" | grep -q target/linux/generic || - echo "$CHANGED_FILES" | grep -q $(echo $TARGET | cut -d "/" -f 1); then - TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}' - [[ $FIRST -ne 1 ]] && JSON_TARGETS="$JSON_TARGETS"',' - JSON_TARGETS="$JSON_TARGETS""$TUPLE" - FIRST=0 - fi - done - JSON_TARGETS="$JSON_TARGETS"']' - - echo -e "\n---- targets to build ----\n" - echo "$JSON_TARGETS_SUBTARGETS" - echo -e "\n---- targets to build ----\n" - - echo -e "\n---- targets to check patch ----\n" - echo "$JSON_TARGETS" - echo -e "\n---- targets to check patch ----\n" - - echo "targets_subtargets=$JSON_TARGETS_SUBTARGETS" >> $GITHUB_OUTPUT - echo "targets=$JSON_TARGETS" >> $GITHUB_OUTPUT - - build: - name: Build Kernel with external toolchain - needs: determine_targets + build-kernels: + name: Build all affected Kernels permissions: contents: read packages: read actions: write - strategy: - fail-fast: False - matrix: - include: ${{fromJson(needs.determine_targets.outputs.targets_subtargets)}} - uses: ./.github/workflows/build.yml - with: - container_name: toolchain - target: ${{ matrix.target }} - subtarget: ${{ matrix.subtarget }} - build_kernel: true - build_all_kmods: true - upload_ccache_cache: ${{ github.repository_owner == 'openwrt' }} - - check-kernel-patches: - name: Check Kernel patches - needs: determine_targets - permissions: - contents: read - packages: read - strategy: - fail-fast: False - matrix: - include: ${{fromJson(needs.determine_targets.outputs.targets)}} - uses: ./.github/workflows/check-kernel-patches.yml - with: - target: ${{ matrix.target }} - subtarget: ${{ matrix.subtarget }} - - upload-ccache-cache-in-s3: - if: github.event_name == 'push' && github.repository_owner == 'openwrt' - name: Upload ccache cache to s3 - needs: [determine_targets, build] - strategy: - fail-fast: False - matrix: - include: ${{fromJson(needs.determine_targets.outputs.targets_subtargets)}} secrets: s3_access_key: ${{ secrets.GCS_S3_ACCESS_KEY }} s3_secret_key: ${{ secrets.GCS_S3_SECRET_KEY }} - uses: ./.github/workflows/upload-file-s3.yml - with: - endpoint: https://storage.googleapis.com - bucket: openwrt-ci-cache - download_id: ${{ matrix.target }}-${{ matrix.subtarget }}-ccache-cache - filename: ccache-kernel-${{ matrix.target }}-${{ matrix.subtarget }}.tar + uses: openwrt/actions-shared-workflows/.github/workflows/kernel.yml@main diff --git a/.github/workflows/label-kernel.yml b/.github/workflows/label-kernel.yml index eab79cf0c0..655d7d6ff3 100644 --- a/.github/workflows/label-kernel.yml +++ b/.github/workflows/label-kernel.yml @@ -7,123 +7,10 @@ on: - labeled jobs: - set_target: - if: startsWith(github.event.label.name, 'ci:kernel:') - name: Set target - runs-on: ubuntu-latest - outputs: - targets_subtargets: ${{ steps.set_target.outputs.targets_subtargets }} - targets: ${{ steps.set_target.outputs.targets }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Parse label - id: parse_label - env: - CI_EVENT_LABEL_NAME: ${{ github.event.label.name }} - run: | - echo "$CI_EVENT_LABEL_NAME" | sed -n 's/ci:kernel:\([^:]*\):\([^:]*\):*\([^:]*\)$/target=\1/p' | tee --append $GITHUB_OUTPUT - echo "$CI_EVENT_LABEL_NAME" | sed -n 's/ci:kernel:\([^:]*\):\([^:]*\):*\([^:]*\)$/subtarget=\2/p' | tee --append $GITHUB_OUTPUT - echo "$CI_EVENT_LABEL_NAME" | sed -n 's/ci:kernel:\([^:]*\):\([^:]*\):*\([^:]*\)$/testing=\3/p' | tee --append $GITHUB_OUTPUT - - - name: Set targets - id: set_target - run: | - ALL_TARGETS="$(perl ./scripts/dump-target-info.pl kernels 2>/dev/null)" - - TARGETS_SUBTARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1)" - TARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1,1)" - - [ "${{ steps.parse_label.outputs.subtarget }}" = "first" ] && TARGETS_SUBTARGETS=$TARGETS - - JSON_TARGETS_SUBTARGETS='[' - FIRST=1 - while IFS= read -r line; do - TARGET_SUBTARGET=$(echo $line | cut -d " " -f 1) - TARGET=$(echo $TARGET_SUBTARGET | cut -d "/" -f 1) - SUBTARGET=$(echo $TARGET_SUBTARGET | cut -d "/" -f 2) - - [ "${{ steps.parse_label.outputs.target }}" != "all" ] && [ "${{ steps.parse_label.outputs.target }}" != "$TARGET" ] && continue - [ "${{ steps.parse_label.outputs.subtarget }}" != "all" ] && [ "${{ steps.parse_label.outputs.subtarget }}" != "first" ] && - [ "${{ steps.parse_label.outputs.subtarget }}" != $SUBTARGET ] && continue - if [ "${{ steps.parse_label.outputs.testing }}" = "testing" ]; then - TESTING_KERNEL_VER=$(echo $line | cut -d " " -f 3) - [ -z "$TESTING_KERNEL_VER" ] && continue - fi - - TUPLE='{"target":"'"$TARGET"'","subtarget":"'"$SUBTARGET"'","testing":"'"$TESTING_KERNEL_VER"'"}' - [[ $FIRST -ne 1 ]] && JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"',' - JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS""$TUPLE" - FIRST=0 - done <<< "$TARGETS_SUBTARGETS" - JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"']' - - JSON_TARGETS='[' - FIRST=1 - while IFS= read -r line; do - TARGET_SUBTARGET=$(echo $line | cut -d " " -f 1) - TARGET=$(echo $TARGET_SUBTARGET | cut -d "/" -f 1) - SUBTARGET=$(echo $TARGET_SUBTARGET | cut -d "/" -f 2) - - [ "${{ steps.parse_label.outputs.target }}" != "all" ] && [ "${{ steps.parse_label.outputs.target }}" != $TARGET ] && continue - if [ "${{ steps.parse_label.outputs.testing }}" = "testing" ]; then - TESTING_KERNEL_VER=$(echo $line | cut -d " " -f 3) - [ -z "$TESTING_KERNEL_VER" ] && continue - fi - - TUPLE='{"target":"'"$TARGET"'","subtarget":"'"$SUBTARGET"'","testing":"'"$TESTING_KERNEL_VER"'"}' - [[ $FIRST -ne 1 ]] && JSON_TARGETS="$JSON_TARGETS"',' - JSON_TARGETS="$JSON_TARGETS""$TUPLE" - FIRST=0 - done <<< "$TARGETS" - JSON_TARGETS="$JSON_TARGETS"']' - - echo -e "\n---- targets to build ----\n" - echo "$JSON_TARGETS_SUBTARGETS" - echo -e "\n---- targets to build ----\n" - - echo -e "\n---- targets to check patch ----\n" - echo "$JSON_TARGETS" - echo -e "\n---- targets to check patch ----\n" - - echo "targets_subtargets=$JSON_TARGETS_SUBTARGETS" >> $GITHUB_OUTPUT - echo "targets=$JSON_TARGETS" >> $GITHUB_OUTPUT - - build_kernel: - name: Build Kernel with external toolchain - needs: set_target + build-kernels-label: + name: Build all affected Kernels from defined label permissions: contents: read packages: read actions: write - uses: ./.github/workflows/build.yml - strategy: - fail-fast: False - matrix: - include: ${{fromJson(needs.set_target.outputs.targets_subtargets)}} - with: - container_name: toolchain - target: ${{ matrix.target }} - subtarget: ${{ matrix.subtarget }} - testing: ${{ matrix.testing != '' && true }} - build_kernel: true - build_all_kmods: true - - check-kernel-patches: - name: Check Kernel patches - needs: set_target - permissions: - contents: read - packages: read - actions: write - strategy: - fail-fast: False - matrix: - include: ${{fromJson(needs.set_target.outputs.targets)}} - uses: ./.github/workflows/check-kernel-patches.yml - with: - target: ${{ matrix.target }} - subtarget: ${{ matrix.subtarget }} - testing: ${{ matrix.testing != '' && true }} + uses: openwrt/actions-shared-workflows/.github/workflows/label-kernel.yml@main diff --git a/.github/workflows/label-target.yml b/.github/workflows/label-target.yml index 610aab026a..989ee9fcb4 100644 --- a/.github/workflows/label-target.yml +++ b/.github/workflows/label-target.yml @@ -7,36 +7,10 @@ on: - labeled jobs: - set_target: - if: startsWith(github.event.label.name, 'ci:target:') - name: Set target - runs-on: ubuntu-latest - outputs: - target: ${{ steps.set_target.outputs.target }} - subtarget: ${{ steps.set_target.outputs.subtarget }} - - steps: - - name: Set target - id: set_target - env: - CI_EVENT_LABEL_NAME: ${{ github.event.label.name }} - run: | - echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/target=\1/p' | tee --append $GITHUB_OUTPUT - echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/subtarget=\2/p' | tee --append $GITHUB_OUTPUT - - build_target: - name: Build target - needs: set_target + build-target-label: + name: Build target from defined label permissions: contents: read packages: read actions: write - uses: ./.github/workflows/build.yml - with: - container_name: toolchain - target: ${{ needs.set_target.outputs.target }} - subtarget: ${{ needs.set_target.outputs.subtarget }} - build_full: true - build_all_kmods: true - build_all_boards: true - build_all_modules: true + uses: openwrt/actions-shared-workflows/.github/workflows/label-target.yml@main diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index fe2898cacd..07621dcb4a 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -3,7 +3,6 @@ name: Build all core packages on: pull_request: paths: - - '.github/workflows/build.yml' - '.github/workflows/packages.yml' - 'config/**' - 'include/**' @@ -12,7 +11,6 @@ on: - 'toolchain/**' push: paths: - - '.github/workflows/build.yml' - '.github/workflows/packages.yml' - 'config/**' - 'include/**' @@ -30,51 +28,13 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - build: - name: Build Packages with external toolchain + build-packages: + name: Build all core packages for selected target permissions: contents: read packages: read actions: write - strategy: - fail-fast: False - matrix: - include: - - target: malta - subtarget: be - - target: x86 - subtarget: 64 - uses: ./.github/workflows/build.yml - with: - container_name: toolchain - target: ${{ matrix.target }} - subtarget: ${{ matrix.subtarget }} - build_kernel: true - build_all_kmods: true - build_all_modules: true - build_full: true - ccache_type: packages - upload_ccache_cache: ${{ github.repository_owner == 'openwrt' }} - - upload-ccache-cache-in-s3: - if: github.event_name == 'push' && github.repository_owner == 'openwrt' - name: Upload ccache cache to s3 - needs: build - strategy: - fail-fast: False - matrix: - include: - - target: malta - subtarget: be - - target: x86 - subtarget: 64 secrets: s3_access_key: ${{ secrets.GCS_S3_ACCESS_KEY }} s3_secret_key: ${{ secrets.GCS_S3_SECRET_KEY }} - uses: ./.github/workflows/upload-file-s3.yml - with: - endpoint: https://storage.googleapis.com - bucket: openwrt-ci-cache - download_id: ${{ matrix.target }}-${{ matrix.subtarget }}-ccache-cache - filename: ccache-packages-${{ matrix.target }}-${{ matrix.subtarget }}.tar - + uses: openwrt/actions-shared-workflows/.github/workflows/packages.yml@main diff --git a/.github/workflows/push-containers.yml b/.github/workflows/push-containers.yml index 04a9b8d8e9..74f534d57a 100644 --- a/.github/workflows/push-containers.yml +++ b/.github/workflows/push-containers.yml @@ -6,13 +6,8 @@ on: - 'include/version.mk' - 'include/cmake.mk' - 'tools/**' - - '.github/workflows/build-tools.yml' - '.github/workflows/push-containers.yml' - - '.github/workflows/Dockerfile.tools' - 'toolchain/**' - - '.github/workflows/build.yml' - - '.github/workflows/toolchain.yml' - - '.github/workflows/Dockerfile.toolchain' branches-ignore: - master @@ -24,198 +19,10 @@ concurrency: cancel-in-progress: true jobs: - determine-container-info: - name: Determine needed info to push containers - if: ${{ github.repository_owner == 'openwrt' }} - runs-on: ubuntu-latest - outputs: - owner-lc: ${{ steps.generate-owner-lc.outputs.owner-lc }} - container-tag: ${{ steps.determine-container-tag.outputs.container-tag }} - - steps: - - name: Set lower case owner name - id: generate-owner-lc - env: - OWNER: ${{ github.repository_owner }} - run: | - echo "owner-lc=${OWNER,,}" >> "$GITHUB_OUTPUT" - - # Per branch tools container tag - # By default stick to latest - # For official test targetting openwrt stable branch - # Get the branch or parse the tag and push dedicated tools containers - # Any branch that will match this pattern openwrt-[0-9][0-9].[0-9][0-9] - # will refresh the tools container with the matching tag. - # (example branch openwrt-22.03 -> tools:openwrt-22.03) - # (example branch openwrt-22.03-test -> tools:openwrt-22.03) - - name: Determine tools container tag - id: determine-container-tag - run: | - CONTAINER_TAG=latest - - if [ ${{ github.ref_type }} == "branch" ]; then - if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then - CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\).*/\1/')" - fi - elif [ ${{ github.ref_type }} == "tag" ]; then - if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then - CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" - fi - fi - - echo "Container tag to push for tools and toolchain is $CONTAINER_TAG" - echo "container-tag=$CONTAINER_TAG" >> "$GITHUB_OUTPUT" - - build-linux-buildbot: - name: Build tools with buildbot container - if: ${{ github.repository_owner == 'openwrt' }} - uses: ./.github/workflows/build-tools.yml - with: - generate_prebuilt_artifacts: true - - push-tools-container: - needs: [ determine-container-info, build-linux-buildbot ] - if: ${{ github.repository_owner == 'openwrt' }} - name: Push prebuilt tools container - runs-on: ubuntu-latest - + build-push-containers: + name: Build and Push all prebuilt containers permissions: contents: read packages: write - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: 'openwrt' - - - name: Download prebuilt tools from build job - uses: actions/download-artifact@v3 - with: - name: linux-buildbot-prebuilt-tools - path: openwrt - - - name: Extract prebuild tools - working-directory: openwrt - run: tar -xf tools.tar - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: openwrt - push: true - tags: ghcr.io/${{ needs.determine-container-info.outputs.owner-lc }}/tools:${{ needs.determine-container-info.outputs.container-tag }} - file: openwrt/.github/workflows/Dockerfile.tools - - determine-targets: - name: Set targets - if: ${{ github.repository_owner == 'openwrt' }} - runs-on: ubuntu-latest - outputs: - target: ${{ steps.find_targets.outputs.target }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set targets - id: find_targets - run: | - export TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null \ - | awk '{ print $1 }')" - - JSON='[' - FIRST=1 - for TARGET in $TARGETS; do - TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}' - [[ $FIRST -ne 1 ]] && JSON="$JSON"',' - JSON="$JSON""$TUPLE" - FIRST=0 - done - JSON="$JSON"']' - - echo -e "\n---- targets ----\n" - echo "$JSON" - echo -e "\n---- targets ----\n" - - echo "target=$JSON" >> $GITHUB_OUTPUT - - build: - name: Build Target Toolchain - if: ${{ github.repository_owner == 'openwrt' }} - needs: [ determine-targets, push-tools-container ] - permissions: - contents: read - packages: read actions: write - strategy: - fail-fast: False - matrix: - include: ${{fromJson(needs.determine-targets.outputs.target)}} - uses: ./.github/workflows/build.yml - with: - target: ${{ matrix.target }} - subtarget: ${{ matrix.subtarget }} - build_toolchain: true - build_external_toolchain: true - upload_external_toolchain: true - - push-toolchain-container: - name: Push Target Toolchain container - if: ${{ github.repository_owner == 'openwrt' }} - needs: [ determine-container-info, determine-targets, build ] - runs-on: ubuntu-latest - - strategy: - fail-fast: False - matrix: - include: ${{fromJson(needs.determine-targets.outputs.target)}} - - permissions: - contents: read - packages: write - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: 'openwrt' - - - name: Download external toolchain from build job - uses: actions/download-artifact@v3 - with: - name: ${{ matrix.target }}-${{ matrix.subtarget }}-external-toolchain - path: openwrt - - - name: Find external toolchain name - id: get-toolchain-name - working-directory: openwrt - run: | - TOOLCHAIN_NAME=$(ls | grep toolchain-${{ matrix.target }}-${{ matrix.subtarget }}) - echo "toolchain-name=$TOOLCHAIN_NAME" >> $GITHUB_OUTPUT - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: openwrt - push: true - tags: ghcr.io/${{ needs.determine-container-info.outputs.owner-lc }}/toolchain:${{ matrix.target }}-${{ matrix.subtarget }}-${{ needs.determine-container-info.outputs.container-tag }} - file: openwrt/.github/workflows/Dockerfile.toolchain - build-args: | - OWNER_LC=${{ needs.determine-container-info.outputs.owner-lc }} - CONTAINER_TAG=${{ needs.determine-container-info.outputs.container-tag }} - TOOLCHAIN_NAME=${{ steps.get-toolchain-name.outputs.toolchain-name }} + uses: openwrt/actions-shared-workflows/.github/workflows/push-containers.yml@main diff --git a/.github/workflows/toolchain.yml b/.github/workflows/toolchain.yml index 4f4d78f4f8..0bc9fec179 100644 --- a/.github/workflows/toolchain.yml +++ b/.github/workflows/toolchain.yml @@ -3,12 +3,10 @@ name: Build Toolchains on: pull_request: paths: - - '.github/workflows/build.yml' - '.github/workflows/toolchain.yml' - 'toolchain/**' push: paths: - - '.github/workflows/build.yml' - '.github/workflows/toolchain.yml' - 'toolchain/**' branches-ignore: @@ -22,52 +20,10 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - determine_targets: - name: Set targets - runs-on: ubuntu-latest - outputs: - target: ${{ steps.find_targets.outputs.target }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set targets - id: find_targets - run: | - export TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null \ - | sort -u -t '/' -k1,1 \ - | awk '{ print $1 }')" - - JSON='[' - FIRST=1 - for TARGET in $TARGETS; do - TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}' - [[ $FIRST -ne 1 ]] && JSON="$JSON"',' - JSON="$JSON""$TUPLE" - FIRST=0 - done - JSON="$JSON"']' - - echo -e "\n---- targets ----\n" - echo "$JSON" - echo -e "\n---- targets ----\n" - - echo "target=$JSON" >> $GITHUB_OUTPUT - - build: - name: Build Target Toolchain - needs: determine_targets + build-toolchains: + name: Build Toolchains for each target permissions: contents: read packages: read actions: write - strategy: - fail-fast: False - matrix: - include: ${{fromJson(needs.determine_targets.outputs.target)}} - uses: ./.github/workflows/build.yml - with: - target: ${{ matrix.target }} - subtarget: ${{ matrix.subtarget }} - build_toolchain: true + uses: openwrt/actions-shared-workflows/.github/workflows/toolchain.yml@main diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 83bf5e98f5..35904a5e56 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -5,13 +5,11 @@ on: paths: - 'include/**' - 'tools/**' - - '.github/workflows/build-tools.yml' - '.github/workflows/tools.yml' push: paths: - 'include/**' - 'tools/**' - - '.github/workflows/build-tools.yml' - '.github/workflows/tools.yml' branches-ignore: - master @@ -24,72 +22,6 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - build-macos-latest: - name: Build tools with macos latest - runs-on: macos-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: openwrt - - - name: Setup MacOS - run: | - echo "WORKPATH=/Volumes/OpenWrt" >> "$GITHUB_ENV" - hdiutil create -size 20g -type SPARSE -fs "Case-sensitive HFS+" -volname OpenWrt OpenWrt.sparseimage - hdiutil attach OpenWrt.sparseimage - mv "$GITHUB_WORKSPACE/openwrt" /Volumes/OpenWrt/ - - - name: Install required prereq on MacOS - working-directory: ${{ env.WORKPATH }}/openwrt - run: | - brew install \ - automake \ - coreutils \ - diffutils \ - findutils \ - gawk \ - git-extras \ - gnu-getopt \ - gnu-sed \ - grep \ - make - - echo "/bin" >> "$GITHUB_PATH" - echo "/sbin/Library/Apple/usr/bin" >> "$GITHUB_PATH" - echo "/usr/bin" >> "$GITHUB_PATH" - echo "/usr/local/bin" >> "$GITHUB_PATH" - echo "/usr/local/opt/coreutils/bin" >> "$GITHUB_PATH" - echo "/usr/local/opt/findutils/libexec/gnubin" >> "$GITHUB_PATH" - echo "/usr/local/opt/gettext/bin" >> "$GITHUB_PATH" - echo "/usr/local/opt/gnu-getopt/bin" >> "$GITHUB_PATH" - echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH" - echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH" - echo "/usr/sbin" >> "$GITHUB_PATH" - - - name: Make prereq - working-directory: ${{ env.WORKPATH }}/openwrt - run: make defconfig - - - name: Build tools MacOS - working-directory: ${{ env.WORKPATH }}/openwrt - run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Upload logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: macos-latest-logs - path: ${{ env.WORKPATH }}/openwrt/logs - - - name: Upload config - if: always() - uses: actions/upload-artifact@v3 - with: - name: macos-latest-config - path: ${{ env.WORKPATH }}/openwrt/.config - - build-linux-buildbot: - name: Build tools with buildbot container - uses: ./.github/workflows/build-tools.yml + build-tools: + name: Build host tools for linux and macos based systems + uses: openwrt/actions-shared-workflows/.github/workflows/tools.yml@main From b63c6e3512077fa452a0736f5bec2169c8bef6cc Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 19 Jun 2023 13:39:42 +0200 Subject: [PATCH 24/40] CI: drop unused reusable workflow and dockerfiles Drop unused reusable workflow and dockerfiles now that we moved them to a dedicated repository. Signed-off-by: Christian Marangi (cherry picked from commit 14293dd901e5fdb0fd242945b5916ccbb33ab328) --- .github/workflows/Dockerfile.toolchain | 8 - .github/workflows/Dockerfile.tools | 4 - .github/workflows/build-tools.yml | 73 --- .github/workflows/build.yml | 575 --------------------- .github/workflows/check-kernel-patches.yml | 155 ------ .github/workflows/upload-file-s3.yml | 46 -- 6 files changed, 861 deletions(-) delete mode 100644 .github/workflows/Dockerfile.toolchain delete mode 100644 .github/workflows/Dockerfile.tools delete mode 100644 .github/workflows/build-tools.yml delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/check-kernel-patches.yml delete mode 100644 .github/workflows/upload-file-s3.yml diff --git a/.github/workflows/Dockerfile.toolchain b/.github/workflows/Dockerfile.toolchain deleted file mode 100644 index 949bc2bb5c..0000000000 --- a/.github/workflows/Dockerfile.toolchain +++ /dev/null @@ -1,8 +0,0 @@ -ARG OWNER_LC -ARG CONTAINER_TAG - -FROM ghcr.io/$OWNER_LC/tools:$CONTAINER_TAG - -ARG TOOLCHAIN_NAME - -ADD $TOOLCHAIN_NAME /external-toolchain/ diff --git a/.github/workflows/Dockerfile.tools b/.github/workflows/Dockerfile.tools deleted file mode 100644 index 5d365fc56d..0000000000 --- a/.github/workflows/Dockerfile.tools +++ /dev/null @@ -1,4 +0,0 @@ -FROM ghcr.io/openwrt/buildbot/buildworker-v3.8.0:v6 - -COPY --chown=buildbot staging_dir/host /prebuilt_tools/staging_dir/host -COPY --chown=buildbot build_dir/host /prebuilt_tools/build_dir/host diff --git a/.github/workflows/build-tools.yml b/.github/workflows/build-tools.yml deleted file mode 100644 index 0212925c50..0000000000 --- a/.github/workflows/build-tools.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Build host tools - -on: - workflow_call: - inputs: - generate_prebuilt_artifacts: - type: boolean - -permissions: - contents: read - -jobs: - build: - name: Build tools - runs-on: ubuntu-latest - container: ghcr.io/openwrt/buildbot/buildworker-v3.8.0:v6 - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: openwrt - - - name: Fix permission - run: chown -R buildbot:buildbot openwrt - - - name: Set configs for tools container - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - touch .config - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config - echo CONFIG_BUILD_ALL_HOST_TOOLS=y >> .config - - - name: Make prereq - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make defconfig - - - name: Build tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Upload logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: linux-buildbot-logs - path: openwrt/logs - - - name: Upload config - if: always() - uses: actions/upload-artifact@v3 - with: - name: linux-buildbot-config - path: openwrt/.config - - - name: Archive prebuilt tools - if: inputs.generate_prebuilt_artifacts == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: tar -cf tools.tar staging_dir/host build_dir/host - - - name: Upload prebuilt tools - if: inputs.generate_prebuilt_artifacts == true - uses: actions/upload-artifact@v3 - with: - name: linux-buildbot-prebuilt-tools - path: openwrt/tools.tar - retention-days: 1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 367a43383b..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,575 +0,0 @@ -name: Build sub target - -on: - workflow_call: - secrets: - coverity_api_token: - inputs: - container_name: - type: string - default: tools - target: - required: true - type: string - subtarget: - required: true - type: string - testing: - type: boolean - build_toolchain: - type: boolean - include_feeds: - type: boolean - build_full: - type: boolean - build_kernel: - type: boolean - build_all_modules: - type: boolean - build_all_kmods: - type: boolean - build_all_boards: - type: boolean - use_openwrt_container: - type: boolean - default: true - coverity_project_name: - type: string - default: OpenWrt - coverity_check_packages: - type: string - coverity_compiler_template_list: - type: string - default: >- - arm-openwrt-linux-gcc - coverity_force_compile_packages: - type: string - default: >- - curl - libnl - mbedtls - wolfssl - openssl - build_external_toolchain: - type: boolean - upload_external_toolchain: - type: boolean - use_ccache_cache: - type: boolean - default: true - ccache_type: - type: string - default: kernel - upload_ccache_cache: - type: boolean - -permissions: - contents: read - -jobs: - setup_build: - name: Setup build ${{ inputs.target }}/${{ inputs.subtarget }} - runs-on: ubuntu-latest - outputs: - owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} - container_tag: ${{ steps.determine_tools_container.outputs.container_tag }} - container_name: ${{ steps.determine_tools_container.outputs.container_name }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set lower case owner name - id: lower_owner - run: | - OWNER_LC=$(echo "${{ github.repository_owner }}" \ - | tr '[:upper:]' '[:lower:]') - - if [ ${{ inputs.use_openwrt_container }} == "true" ]; then - OWNER_LC=openwrt - fi - - echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT - - # Per branch tools container tag - # By default stick to latest - # For official test targetting openwrt stable branch - # Get the branch or parse the tag and push dedicated tools containers - # For local test to use the correct container for stable release testing - # you need to use for the branch name a prefix of openwrt-[0-9][0-9].[0-9][0-9]- - - name: Determine tools container tag - id: determine_tools_container - run: | - CONTAINER_NAME=${{ inputs.container_name }} - CONTAINER_TAG=latest - if [ -n "${{ github.base_ref }}" ]; then - if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then - CONTAINER_TAG="${{ github.base_ref }}" - fi - elif [ ${{ github.ref_type }} == "branch" ]; then - if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then - CONTAINER_TAG=${{ github.ref_name }} - elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then - CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\)-.*/\1/')" - fi - elif [ ${{ github.ref_type }} == "tag" ]; then - if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then - CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/^v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" - fi - fi - - if [ "$CONTAINER_NAME" = "toolchain" ]; then - GHCR_TOKEN=$(echo ${{ secrets.GITHUB_TOKEN }} | base64) - GHCR_HEADER="Authorization: Bearer ${GHCR_TOKEN}" - GHCR_MANIFEST_LINK=https://ghcr.io/v2/${{ steps.lower_owner.outputs.owner_lc }}/${{ inputs.container_name }}/manifests/${{ inputs.target }}-${{ inputs.subtarget }}-"$CONTAINER_TAG" - # Check if container exist - if [ $(curl -s -o /dev/null -w "%{http_code}" -H "$GHCR_HEADER" -I "$GHCR_MANIFEST_LINK") = 200 ]; then - CONTAINER_TAG=${{ inputs.target }}-${{ inputs.subtarget }}-"$CONTAINER_TAG" - else - CONTAINER_NAME=tools - fi - fi - - echo "Tools container to use $CONTAINER_NAME:$CONTAINER_TAG" - echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT - echo "container_name=$CONTAINER_NAME" >> $GITHUB_OUTPUT - - build: - name: Build ${{ inputs.target }}/${{ inputs.subtarget }} - needs: setup_build - runs-on: ubuntu-latest - - container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/${{ needs.setup_build.outputs.container_name }}:${{ needs.setup_build.outputs.container_tag }} - - permissions: - contents: read - packages: read - actions: write - - steps: - - name: Checkout master directory - uses: actions/checkout@v3 - with: - path: openwrt - - - name: Checkout packages feed - if: inputs.include_feeds == true - uses: actions/checkout@v3 - with: - repository: openwrt/packages - path: openwrt/feeds/packages - - - name: Checkout luci feed - if: inputs.include_feeds == true - uses: actions/checkout@v3 - with: - repository: openwrt/luci - path: openwrt/feeds/luci - - - name: Checkout routing feed - if: inputs.include_feeds == true - uses: actions/checkout@v3 - with: - repository: openwrt/routing - path: openwrt/feeds/routing - - - name: Checkout telephony feed - if: inputs.include_feeds == true - uses: actions/checkout@v3 - with: - repository: openwrt/telephony - path: openwrt/feeds/telephony - - - name: Parse toolchain file - if: inputs.build_toolchain == false - id: parse-toolchain - working-directory: openwrt - run: | - if [ -d /external-toolchain/ ]; then - echo "toolchain-type=external_container" >> $GITHUB_OUTPUT - exit 0 - fi - - TOOLCHAIN_PATH=snapshots - - if [ -n "${{ github.base_ref }}" ]; then - if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then - major_ver="$(echo ${{ github.base_ref }} | sed 's/^openwrt-/v/')" - fi - elif [ "${{ github.ref_type }}" = "branch" ]; then - if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then - major_ver="$(echo ${{ github.ref_name }} | sed 's/^openwrt-/v/')" - elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then - major_ver="$(echo ${{ github.ref_name }} | sed 's/^openwrt-\([0-9][0-9]\.[0-9][0-9]\)-.*/v\1/')" - fi - elif [ "${{ github.ref_type }}" = "tag" ]; then - if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then - major_ver="$(echo ${{ github.ref_name }} | sed 's/^\(v[0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" - fi - fi - - if [ -n "$major_ver" ]; then - git fetch --tags -f - latest_tag="$(git tag --sort=-creatordate -l $major_ver* | head -n1)" - if [ -n "$latest_tag" ]; then - TOOLCHAIN_PATH=releases/$(echo $latest_tag | sed 's/^v//') - fi - fi - - SUMS_FILE="https://downloads.cdn.openwrt.org/$TOOLCHAIN_PATH/targets/${{ inputs.target }}/${{ inputs.subtarget }}/sha256sums" - if curl $SUMS_FILE | grep -q ".*openwrt-toolchain.*tar.xz"; then - TOOLCHAIN_STRING="$( curl $SUMS_FILE | grep ".*openwrt-toolchain.*tar.xz")" - TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') - - echo "toolchain-type=external_toolchain" >> $GITHUB_OUTPUT - elif curl $SUMS_FILE | grep -q ".*openwrt-sdk.*tar.xz"; then - TOOLCHAIN_STRING="$( curl $SUMS_FILE | grep ".*openwrt-sdk.*tar.xz")" - TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-sdk.*\).tar.xz/\1/p') - - echo "toolchain-type=external_sdk" >> $GITHUB_OUTPUT - else - echo "toolchain-type=internal" >> $GITHUB_OUTPUT - fi - - echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" - echo "TOOLCHAIN_PATH=$TOOLCHAIN_PATH" >> "$GITHUB_ENV" - - - name: Download and extract ccache cache from s3 - id: restore-ccache-cache-s3 - if: inputs.use_ccache_cache == true - working-directory: openwrt - run: | - ENDPOINT=https://storage.googleapis.com - BUCKET=openwrt-ci-cache - CCACHE_TAR=ccache-${{ inputs.ccache_type }}-${{ inputs.target }}-${{ inputs.subtarget }}.tar - - if curl -o /dev/null -s --head --fail $ENDPOINT/$BUCKET/$CCACHE_TAR; then - wget -O - $ENDPOINT/$BUCKET/$CCACHE_TAR | tar -xf - - echo "cache-hit=true" >> $GITHUB_OUTPUT - fi - - - name: Fix permission - run: | - chown -R buildbot:buildbot openwrt - - - name: Prepare prebuilt tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - mkdir -p staging_dir build_dir - ln -s /prebuilt_tools/staging_dir/host staging_dir/host - ln -s /prebuilt_tools/build_dir/host build_dir/host - - ./scripts/ext-tools.sh --refresh - - - name: Update & Install feeds - if: inputs.include_feeds == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - ./scripts/feeds update -a - ./scripts/feeds install -a - - - name: Restore ccache cache - id: restore-ccache-cache - if: inputs.use_ccache_cache == true && steps.restore-ccache-cache-s3.outputs.cache-hit != 'true' - uses: actions/cache/restore@v3 - with: - path: openwrt/.ccache - key: ccache-${{ inputs.ccache_type }}-${{ inputs.target }}/${{ inputs.subtarget }}-${{ hashFiles('openwrt/include/kernel-**') }} - restore-keys: | - ccache-${{ inputs.ccache_type }}-${{ inputs.target }}/${{ inputs.subtarget }}- - - - name: Import GPG keys - shell: su buildbot -c "sh -e {0}" - if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal' && steps.parse-toolchain.outputs.toolchain-type != 'external_container' - run: gpg --receive-keys 0xCD84BCED626471F1 0x1D53D1877742E911 0xCD54E82DADB3684D - - - name: Download external toolchain/sdk - if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal' && steps.parse-toolchain.outputs.toolchain-type != 'external_container' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - wget https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ inputs.target }}/${{ inputs.subtarget }}/${{ env.TOOLCHAIN_FILE }}.tar.xz - wget https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ inputs.target }}/${{ inputs.subtarget }}/sha256sums.asc - wget https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ inputs.target }}/${{ inputs.subtarget }}/sha256sums - gpg --with-fingerprint --verify sha256sums.asc - sha256sum --check --ignore-missing sha256sums - tar --xz -xf ${{ env.TOOLCHAIN_FILE }}.tar.xz - rm ${{ env.TOOLCHAIN_FILE }}.tar.xz sha256sums - - - name: Configure testing kernel - if: inputs.testing == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_TESTING_KERNEL=y >> .config - - - name: Configure all kernel modules - if: inputs.build_all_kmods == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_ALL_KMODS=y >> .config - - - name: Configure all modules - if: inputs.build_all_modules == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_ALL=y >> .config - - - name: Configure all boards - if: inputs.build_all_boards == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_TARGET_MULTI_PROFILE=y >> .config - echo CONFIG_TARGET_PER_DEVICE_ROOTFS=y >> .config - echo CONFIG_TARGET_ALL_PROFILES=y >> .config - - # ccache for some reason have problem detecting compiler type - # with external toolchain. This cause the complete malfunction - # of ccache with the result of tons of unsupported compiler - # option error. - # To fix this force compiler type to gcc. - - name: Configure ccache and apply fixes - if: inputs.use_ccache_cache == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - env: - SYSTEM_CCACHE_CONF: staging_dir/host/etc/ccache.conf - run: | - touch $SYSTEM_CCACHE_CONF - - echo compiler_type=gcc >> $SYSTEM_CCACHE_CONF - - echo CONFIG_CCACHE=y >> .config - - - name: Configure external toolchain in container - if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_container' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - - ./scripts/ext-toolchain.sh \ - --toolchain /external-toolchain/$(ls /external-toolchain/ | grep openwrt-toolchain)/toolchain-* \ - --overwrite-config \ - --config ${{ inputs.target }}/${{ inputs.subtarget }} - - - name: Configure external toolchain - if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_toolchain' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - - ./scripts/ext-toolchain.sh \ - --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ - --overwrite-config \ - --config ${{ inputs.target }}/${{ inputs.subtarget }} - - - name: Adapt external sdk to external toolchain format - if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_sdk' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - TOOLCHAIN_DIR=${{ env.TOOLCHAIN_FILE }}/staging_dir/$(ls ${{ env.TOOLCHAIN_FILE }}/staging_dir | grep toolchain) - TOOLCHAIN_BIN=$TOOLCHAIN_DIR/bin - OPENWRT_DIR=$(pwd) - - # Find target name from toolchain info.mk - GNU_TARGET_NAME=$(cat $TOOLCHAIN_DIR/info.mk | grep TARGET_CROSS | sed 's/^TARGET_CROSS=\(.*\)-$/\1/') - - cd $TOOLCHAIN_BIN - - # Revert sdk wrapper scripts applied to all the bins - for app in $(find . -name "*.bin"); do - TARGET_APP=$(echo $app | sed 's/\.\/\.\(.*\)\.bin/\1/') - rm $TARGET_APP - mv .$TARGET_APP.bin $TARGET_APP - done - - # Setup the wrapper script in the sdk toolchain dir simulating an external toolchain build - cp $OPENWRT_DIR/target/toolchain/files/wrapper.sh $GNU_TARGET_NAME-wrapper.sh - for app in cc gcc g++ c++ cpp ld as ; do - [ -f $GNU_TARGET_NAME-$app ] && mv $GNU_TARGET_NAME-$app $GNU_TARGET_NAME-$app.bin - ln -sf $GNU_TARGET_NAME-wrapper.sh $GNU_TARGET_NAME-$app - done - - - name: Configure external toolchain with sdk - if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_sdk' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - - ./scripts/ext-toolchain.sh \ - --toolchain ${{ env.TOOLCHAIN_FILE }}/staging_dir/toolchain-* \ - --overwrite-config \ - --config ${{ inputs.target }}/${{ inputs.subtarget }} - - - name: Configure internal toolchain - if: inputs.build_toolchain == true || steps.parse-toolchain.outputs.toolchain-type == 'internal' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - - echo "CONFIG_TARGET_${{ inputs.target }}=y" >> .config - echo "CONFIG_TARGET_${{ inputs.target }}_${{ inputs.subtarget }}=y" >> .config - - make defconfig - - - name: Show configuration - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: ./scripts/diffconfig.sh - - - name: Build tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build toolchain - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make toolchain/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build Kernel - if: inputs.build_kernel == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make target/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build Kernel Kmods - if: inputs.build_kernel == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make package/linux/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build everything - if: inputs.build_full == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build external toolchain - if: inputs.build_external_toolchain == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make target/toolchain/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Coverity prepare toolchain - if: inputs.coverity_check_packages != '' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - wget -q https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.coverity_api_token }}&project=${{ inputs.coverity_project_name }}" -O coverity.tar.gz - wget -q https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.coverity_api_token }}&project=${{ inputs.coverity_project_name }}&md5=1" -O coverity.tar.gz.md5 - echo ' coverity.tar.gz' >> coverity.tar.gz.md5 - md5sum -c coverity.tar.gz.md5 - - mkdir cov-analysis-linux64 - tar xzf coverity.tar.gz --strip 1 -C cov-analysis-linux64 - export PATH=$(pwd)/cov-analysis-linux64/bin:$PATH - - for template in ${{ inputs.coverity_compiler_template_list }}; do - cov-configure --template --comptype gcc --compiler "$template" - done - - - name: Clean and recompile packages with Coverity toolchain - if: inputs.coverity_check_packages != '' - shell: su buildbot -c "bash {0}" - working-directory: openwrt - run: | - set -o pipefail -o errexit - - coverity_check_packages=(${{ inputs.coverity_check_packages }}) - printf -v clean_packages "package/%s/clean " "${coverity_check_packages[@]}" - make -j$(nproc) BUILD_LOG=1 $clean_packages || ret=$? .github/workflows/scripts/show_build_failures.sh - - coverity_force_compile_packages=(${{ inputs.coverity_force_compile_packages }}) - printf -v force_compile_packages "package/%s/compile " "${coverity_force_compile_packages[@]}" - make -j$(nproc) BUILD_LOG=1 $force_compile_packages || ret=$? .github/workflows/scripts/show_build_failures.sh - - printf -v compile_packages "package/%s/compile " "${coverity_check_packages[@]}" - export PATH=$(pwd)/cov-analysis-linux64/bin:$PATH - cov-build --dir cov-int make -j $(nproc) BUILD_LOG=1 $compile_packages || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Upload build to Coverity for analysis - if: inputs.coverity_check_packages != '' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - tar czf cov-int.tar.gz ./cov-int - curl \ - --form token="${{ secrets.coverity_api_token }}" \ - --form email="contact@openwrt.org" \ - --form file=@cov-int.tar.gz \ - --form version="${{ github.ref_name }}-${{ github.sha }}" \ - --form description="OpenWrt ${{ github.ref_name }}-${{ github.sha }}" \ - "https://scan.coverity.com/builds?project=${{ inputs.coverity_project_name }}" - - - name: Upload logs - if: failure() - uses: actions/upload-artifact@v3 - with: - name: ${{ inputs.target }}-${{ inputs.subtarget }}-logs - path: "openwrt/logs" - - - name: Delete already present ccache cache - if: steps.restore-ccache-cache.outputs.cache-hit == 'true' && inputs.use_ccache_cache == true && - github.event_name == 'push' && steps.restore-ccache-cache-s3.outputs.cache-hit != 'true' - uses: octokit/request-action@v2.x - with: - route: DELETE /repos/{repository}/actions/caches?key={key} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - INPUT_REPOSITORY: ${{ github.repository }} - INPUT_KEY: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }} - - - name: Save ccache cache - if: inputs.use_ccache_cache == true && github.event_name == 'push' && - steps.restore-ccache-cache-s3.outputs.cache-hit != 'true' - uses: actions/cache/save@v3 - with: - path: openwrt/.ccache - key: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }} - - - name: Archive ccache - if: inputs.use_ccache_cache == true && github.event_name == 'push' && - inputs.upload_ccache_cache == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: tar -cf ccache-${{ inputs.ccache_type }}-${{ inputs.target }}-${{ inputs.subtarget }}.tar .ccache - - - name: Upload ccache cache - if: inputs.use_ccache_cache == true && github.event_name == 'push' && - inputs.upload_ccache_cache == true - uses: actions/upload-artifact@v3 - with: - name: ${{ inputs.target }}-${{ inputs.subtarget }}-ccache-cache - path: openwrt/ccache-${{ inputs.ccache_type }}-${{ inputs.target }}-${{ inputs.subtarget }}.tar - retention-days: 1 - - - name: Find external toolchain name - id: get-toolchain-name - if: inputs.upload_external_toolchain == true - working-directory: openwrt - run: | - TOOLCHAIN_NAME=$(ls bin/targets/${{inputs.target }}/${{ inputs.subtarget }} | grep toolchain) - echo "toolchain-name=$TOOLCHAIN_NAME" >> $GITHUB_OUTPUT - - - name: Upload prebuilt toolchain - if: inputs.upload_external_toolchain == true - uses: actions/upload-artifact@v3 - with: - name: ${{ inputs.target }}-${{ inputs.subtarget }}-external-toolchain - path: openwrt/bin/targets/${{ inputs.target }}/${{ inputs.subtarget }}/${{ steps.get-toolchain-name.outputs.toolchain-name }} - retention-days: 1 diff --git a/.github/workflows/check-kernel-patches.yml b/.github/workflows/check-kernel-patches.yml deleted file mode 100644 index 1ab4a361f5..0000000000 --- a/.github/workflows/check-kernel-patches.yml +++ /dev/null @@ -1,155 +0,0 @@ -name: Refresh kernel for target - -on: - workflow_call: - inputs: - target: - required: true - type: string - subtarget: - required: true - type: string - testing: - type: boolean - use_openwrt_container: - type: boolean - default: true - -permissions: - contents: read - -jobs: - setup_build: - name: Setup build - runs-on: ubuntu-latest - outputs: - owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} - container_tag: ${{ steps.determine_tools_container.outputs.container_tag }} - - steps: - - name: Set lower case owner name - id: lower_owner - run: | - OWNER_LC=$(echo "${{ github.repository_owner }}" \ - | tr '[:upper:]' '[:lower:]') - - if [ ${{ inputs.use_openwrt_container }} == "true" ]; then - OWNER_LC=openwrt - fi - - echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT - - # Per branch tools container tag - # By default stick to latest - # For official test targetting openwrt stable branch - # Get the branch or parse the tag and push dedicated tools containers - # For local test to use the correct container for stable release testing - # you need to use for the branch name a prefix of openwrt-[0-9][0-9].[0-9][0-9]- - - name: Determine tools container tag - id: determine_tools_container - run: | - CONTAINER_TAG=latest - if [ -n "${{ github.base_ref }}" ]; then - if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then - CONTAINER_TAG="${{ github.base_ref }}" - fi - elif [ ${{ github.ref_type }} == "branch" ]; then - if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then - CONTAINER_TAG=${{ github.ref_name }} - elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then - CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\)-.*/\1/')" - fi - elif [ ${{ github.ref_type }} == "tag" ]; then - if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then - CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/^v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" - fi - fi - echo "Tools container to use tools:$CONTAINER_TAG" - echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT - - check-patch: - name: Check Kernel patches - needs: setup_build - runs-on: ubuntu-latest - - container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:${{ needs.setup_build.outputs.container_tag }} - - permissions: - contents: read - packages: read - - steps: - - name: Checkout master directory - uses: actions/checkout@v3 - with: - path: openwrt - - - name: Fix permission - run: | - chown -R buildbot:buildbot openwrt - - - name: Prepare prebuilt tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - mkdir -p staging_dir build_dir - ln -sf /prebuilt_tools/staging_dir/host staging_dir/host - ln -sf /prebuilt_tools/build_dir/host build_dir/host - - ./scripts/ext-tools.sh --refresh - - - name: Configure testing kernel - if: inputs.testing == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_TESTING_KERNEL=y >> .config - - - name: Configure system - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_ALL_KMODS=y >> .config - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config - - echo "CONFIG_TARGET_${{ inputs.target }}=y" >> .config - echo "CONFIG_TARGET_${{ inputs.target }}_${{ inputs.subtarget }}=y" >> .config - - make defconfig - - - name: Build tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make tools/quilt/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Refresh Kernel patches - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make target/linux/refresh V=s - - - name: Validate Refreshed Kernel Patches - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - . .github/workflows/scripts/ci_helpers.sh - - if git diff --name-only --exit-code; then - success "Kernel patches for ${{ inputs.target }}/${{ inputs.subtarget }} seems ok" - else - err "Kernel patches for ${{ inputs.target }}/${{ inputs.subtarget }} require refresh. (run 'make target/linux/refresh' and force push this pr)" - err "You can also check the provided artifacts with the refreshed patch from this CI run." - mkdir ${{ inputs.target }}-${{ inputs.subtarget }}-refreshed - for f in $(git diff --name-only); do - cp --parents $f ${{ inputs.target }}-${{ inputs.subtarget }}-refreshed/ - done - exit 1 - fi - - - name: Upload Refreshed Patches - if: failure() - uses: actions/upload-artifact@v3 - with: - name: ${{ inputs.target }}-${{ inputs.subtarget }}-refreshed - path: openwrt/${{ inputs.target }}-${{ inputs.subtarget }}-refreshed diff --git a/.github/workflows/upload-file-s3.yml b/.github/workflows/upload-file-s3.yml deleted file mode 100644 index 6bcb172468..0000000000 --- a/.github/workflows/upload-file-s3.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Upload File to S3 - -on: - workflow_call: - secrets: - s3_access_key: - s3_secret_key: - inputs: - endpoint: - required: true - type: string - bucket: - required: true - type: string - download_id: - required: true - type: string - filename: - required: true - type: string - -jobs: - upload-file-in-s3: - name: Upload file in S3 - runs-on: ubuntu-latest - - steps: - - name: Install minio - run: | - curl https://dl.min.io/client/mc/release/linux-amd64/mc \ - --create-dirs \ - -o $GITHUB_WORKSPACE/minio-binaries/mc - - chmod +x $GITHUB_WORKSPACE/minio-binaries/mc - echo $GITHUB_WORKSPACE/minio-binaries/ >> $GITHUB_PATH - - - name: Setup minio - run: mc alias set s3 ${{ inputs.endpoint }} ${{ secrets.s3_access_key }} ${{ secrets.s3_secret_key }} - - - name: Download file - uses: actions/download-artifact@v3 - with: - name: ${{ inputs.download_id }} - - - name: Upload file to s3 - run: mc cp ${{ inputs.filename }} s3/${{ inputs.bucket }}/ From c53dda11a26ee360d2cab51d2a07c84d3b3a039c Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 5 Aug 2023 01:55:11 +0200 Subject: [PATCH 25/40] CI: generilize S3 secret keys name and rename to proper name Generilize S3 secret keys and rename to make them not platform specific. Signed-off-by: Christian Marangi (cherry picked from commit f98dc5aa43e9d84b8ceef9414fd4f92e05c418d7) --- .github/workflows/kernel.yml | 4 ++-- .github/workflows/packages.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 87b8a14293..a96ece8709 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -35,6 +35,6 @@ jobs: packages: read actions: write secrets: - s3_access_key: ${{ secrets.GCS_S3_ACCESS_KEY }} - s3_secret_key: ${{ secrets.GCS_S3_SECRET_KEY }} + ccache_s3_access_key: ${{ secrets.CCACHE_S3_ACCESS_KEY }} + ccache_s3_secret_key: ${{ secrets.CCACHE_S3_SECRET_KEY }} uses: openwrt/actions-shared-workflows/.github/workflows/kernel.yml@main diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 07621dcb4a..d9251ed2a0 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -35,6 +35,6 @@ jobs: packages: read actions: write secrets: - s3_access_key: ${{ secrets.GCS_S3_ACCESS_KEY }} - s3_secret_key: ${{ secrets.GCS_S3_SECRET_KEY }} + ccache_s3_access_key: ${{ secrets.CCACHE_S3_ACCESS_KEY }} + ccache_s3_secret_key: ${{ secrets.CCACHE_S3_SECRET_KEY }} uses: openwrt/actions-shared-workflows/.github/workflows/packages.yml@main From 263ef841d47414efe4586013bd0bf4b026936d2e Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 5 Aug 2023 01:58:29 +0200 Subject: [PATCH 26/40] CI: provide new required secret for S3 endpoint and bucket name Provide new required secret for S3 endpoint and bucket name to permit an easier migration to new services. Signed-off-by: Christian Marangi (cherry picked from commit 881235c713fae8692190178561af4eb2dee4ead1) --- .github/workflows/kernel.yml | 2 ++ .github/workflows/packages.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index a96ece8709..43c610ab4f 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -35,6 +35,8 @@ jobs: packages: read actions: write secrets: + ccache_s3_endpoint: ${{ secrets.CCACHE_S3_ENDPOINT }} + ccache_s3_bucket: ${{ secrets.CCACHE_S3_BUCKET }} ccache_s3_access_key: ${{ secrets.CCACHE_S3_ACCESS_KEY }} ccache_s3_secret_key: ${{ secrets.CCACHE_S3_SECRET_KEY }} uses: openwrt/actions-shared-workflows/.github/workflows/kernel.yml@main diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index d9251ed2a0..f061c1cd37 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -35,6 +35,8 @@ jobs: packages: read actions: write secrets: + ccache_s3_endpoint: ${{ secrets.CCACHE_S3_ENDPOINT }} + ccache_s3_bucket: ${{ secrets.CCACHE_S3_BUCKET }} ccache_s3_access_key: ${{ secrets.CCACHE_S3_ACCESS_KEY }} ccache_s3_secret_key: ${{ secrets.CCACHE_S3_SECRET_KEY }} uses: openwrt/actions-shared-workflows/.github/workflows/packages.yml@main From 75fe50defe20cf2536a083110f8910e2de5e409a Mon Sep 17 00:00:00 2001 From: Rani Hod Date: Fri, 20 Oct 2023 16:15:38 +0300 Subject: [PATCH 27/40] ramips: TP-link archer A6/C6 device tree updates Set correct GPIO (10) for the WPS button. This matches GPIO settings in vendor GPL sources. Note that GPL sources also mention a USB indicator LED (GPIO 13) but the device has neither an external USB port nor a USB LED. In addition, prefixes (button-, led-) are added to relevant DT entries, as well as color and function specifications for LEDs. Closes: #13736 Reported-by: Waldemar Czabaj Signed-off-by: Rani Hod (added led mitigations for wifi leds) Signed-off-by: Christian Lamparter (cherry picked from commit fe5e4987776ef66c6788f70251dcbc0ca80a1c5f) --- .../dts/mt7621_tplink_archer-x6-v3.dtsi | 38 ++++++++++++------- .../etc/uci-defaults/04_led_migration | 17 +++++++++ 2 files changed, 41 insertions(+), 14 deletions(-) create mode 100644 target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi index 217c1b60fe..557003a08a 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi +++ b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi @@ -4,6 +4,7 @@ #include #include +#include / { aliases { @@ -21,14 +22,14 @@ keys { compatible = "gpio-keys"; - wps { + button-wps { label = "wps"; - gpios = <&gpio 28 GPIO_ACTIVE_LOW>; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; debounce-interval = <60>; linux,code = ; }; - reset { + button-reset { label = "reset"; gpios = <&gpio 8 GPIO_ACTIVE_LOW>; debounce-interval = <60>; @@ -39,35 +40,44 @@ leds { compatible = "gpio-leds"; - led_power: power { + led_power: led-power { label = "green:power"; + color = ; + function = LED_FUNCTION_POWER; gpios = <&gpio 4 GPIO_ACTIVE_LOW>; }; - wan_orange { - label = "orange:wan"; + led-wan-amber { + color = ; + function = LED_FUNCTION_WAN; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; - lan { - label = "green:lan"; + led-lan { + color = ; + function = LED_FUNCTION_LAN; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; - wifi5g { - label = "green:wifi5g"; + led-wifi5g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <5>; gpios = <&gpio 16 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy1tpt"; }; - wifi2g { - label = "green:wifi2g"; + led-wifi2g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <2>; gpios = <&gpio 18 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy0tpt"; }; - wan_green { - label = "green:wan"; + led-wan-green { + color = ; + function = LED_FUNCTION_WAN; gpios = <&gpio 45 GPIO_ACTIVE_LOW>; }; }; diff --git a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration new file mode 100644 index 0000000000..b595ae6fd1 --- /dev/null +++ b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration @@ -0,0 +1,17 @@ +. /lib/functions.sh +. /lib/functions/migrations.sh + +board=$(board_name) + +case "$board" in +tplink,archer-a6-v3|\ +tplink,archer-c6-v3) + migrate_leds ':wifi2g$=:wlan-2' ':wifi5g$=:wlan-5' + ;; +esac + +remove_devicename_leds + +migrations_apply system + +exit 0 From 6a1b92b0243246f0adb3e3207a1af2196b44942a Mon Sep 17 00:00:00 2001 From: Rani Hod Date: Sun, 1 Oct 2023 02:05:19 +0300 Subject: [PATCH 28/40] bcm53xx: Linksys EA9200 nvram and 02_network fixes 1) clear nvram partialboots upon successful boot This behavior is already defined for EA9500; enabled for EA9200 too. 2) fix MAC address in board.d/02_network Use the correct nvram variable to derive lan/wan MAC address. Signed-off-by: Rani Hod (cherry picked from commit 9c42d23c5f7aa2b7f80af96921b2d5476626b8c6) --- package/utils/nvram/files/nvram-bcm53xx.init | 1 + target/linux/bcm53xx/base-files/etc/board.d/02_network | 1 + 2 files changed, 2 insertions(+) diff --git a/package/utils/nvram/files/nvram-bcm53xx.init b/package/utils/nvram/files/nvram-bcm53xx.init index 0502cd28b6..4319c761bb 100755 --- a/package/utils/nvram/files/nvram-bcm53xx.init +++ b/package/utils/nvram/files/nvram-bcm53xx.init @@ -9,6 +9,7 @@ clear_partialboots() { # clear partialboots case $(board_name) in + linksys,ea9200|\ linksys,panamera) COMMIT=1 nvram set partialboots=0 diff --git a/target/linux/bcm53xx/base-files/etc/board.d/02_network b/target/linux/bcm53xx/base-files/etc/board.d/02_network index 13e7311e79..6d84442da4 100644 --- a/target/linux/bcm53xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm53xx/base-files/etc/board.d/02_network @@ -50,6 +50,7 @@ bcm53xx_setup_macs() offset=1 ;; dlink,dir-885l | \ + linksys,ea9200 | \ linksys,panamera | \ netgear,r7900 | \ netgear,r8000 | \ From cdf7c3a16e60a9ce6ba2b362b0c1a40c2fe4a17a Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 24 Oct 2023 22:42:19 +0200 Subject: [PATCH 29/40] openssl: update to 3.0.12 Major changes between OpenSSL 3.0.11 and OpenSSL 3.0.12 [24 Oct 2023] * Mitigate incorrect resize handling for symmetric cipher keys and IVs. (CVE-2023-5363) Signed-off-by: Hauke Mehrtens (cherry picked from commit e4ebc7b5662d6436fcc84b8e1583204b96fb0503) --- package/libs/openssl/Makefile | 4 ++-- .../libs/openssl/patches/120-strip-cflags-from-binary.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 459d367372..4b1388e7af 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl -PKG_VERSION:=3.0.11 +PKG_VERSION:=3.0.12 PKG_RELEASE:=1 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto @@ -24,7 +24,7 @@ PKG_SOURCE_URL:= \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/ -PKG_HASH:=b3425d3bb4a2218d0697eb41f7fc0cdede016ed19ca49d168b78e8d947887f55 +PKG_HASH:=f93c9e8edde5e9166119de31755fc87b4aa34863662f67ddfcba14d0b6b69b61 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE diff --git a/package/libs/openssl/patches/120-strip-cflags-from-binary.patch b/package/libs/openssl/patches/120-strip-cflags-from-binary.patch index c4f2540395..ebdb940b42 100644 --- a/package/libs/openssl/patches/120-strip-cflags-from-binary.patch +++ b/package/libs/openssl/patches/120-strip-cflags-from-binary.patch @@ -10,7 +10,7 @@ Signed-off-by: Eneas U de Queiroz --- a/crypto/build.info +++ b/crypto/build.info -@@ -111,7 +111,7 @@ DEFINE[../libcrypto]=$UPLINKDEF +@@ -109,7 +109,7 @@ DEFINE[../libcrypto]=$UPLINKDEF DEPEND[info.o]=buildinf.h DEPEND[cversion.o]=buildinf.h From 74dbee1ea0d1d0010cb2955e08708c8b2c04e40c Mon Sep 17 00:00:00 2001 From: Davide Fioravanti Date: Thu, 22 Jun 2023 00:33:16 +0200 Subject: [PATCH 30/40] bcm53xx: add Wavlink Quantum DAX/WL-WN538A8 as alt name As already documented in the wiki (https://openwrt.org/toh/wavlink/quantum_dax_wn538a8), this router is based on the Phicomm K3. Just the flashing method is different Signed-off-by: Davide Fioravanti (cherry picked from commit f1136fe1fd3e7539c4efb035efeffe77500dd9c0) --- target/linux/bcm53xx/image/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index defa68e59f..b1eb4277b7 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -461,6 +461,10 @@ TARGET_DEVICES += smartrg_sr400ac define Device/phicomm_k3 DEVICE_VENDOR := PHICOMM DEVICE_MODEL := K3 + DEVICE_ALT0_VENDOR := Wavlink + DEVICE_ALT0_MODEL := QUANTUM DAX + DEVICE_ALT1_VENDOR := Wavlink + DEVICE_ALT1_MODEL := WL-WN538A8 DEVICE_PACKAGES := $(BRCMFMAC_4366C0) $(USB3_PACKAGES) IMAGES := trx endef From 07d4455cee161a0372a53ca8557ae1c35798e2e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= Date: Thu, 10 Aug 2023 15:23:08 +0300 Subject: [PATCH 31/40] bcm53xx: backport DT changes for ASUS RT-AC3100 queued for v6.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport the patch that adds the DT for ASUS RT-AC3100. Signed-off-by: Arınç ÜNAL (cherry picked from commit b7ee8c9f83ea0e3b861e6b71b08ed7a62066d149) --- ...s-BCM5301X-Add-DT-for-Asus-RT-AC3100.patch | 431 ++++++++++++++++++ ...RM-BCM5301X-Add-DT-for-Netgear-R7900.patch | 2 +- 2 files changed, 432 insertions(+), 1 deletion(-) create mode 100644 target/linux/bcm53xx/patches-5.15/037-v6.6-0016-ARM-dts-BCM5301X-Add-DT-for-Asus-RT-AC3100.patch diff --git a/target/linux/bcm53xx/patches-5.15/037-v6.6-0016-ARM-dts-BCM5301X-Add-DT-for-Asus-RT-AC3100.patch b/target/linux/bcm53xx/patches-5.15/037-v6.6-0016-ARM-dts-BCM5301X-Add-DT-for-Asus-RT-AC3100.patch new file mode 100644 index 0000000000..6c2af02589 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/037-v6.6-0016-ARM-dts-BCM5301X-Add-DT-for-Asus-RT-AC3100.patch @@ -0,0 +1,431 @@ +From 2900083269f7c0f0ff430bffc6ced2038aed9b6b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Thu, 3 Aug 2023 10:14:54 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Add DT for ASUS RT-AC3100 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +ASUS RT-AC3100 is ASUS RT-AC88U without the external switch. Move the +shared bindings to bcm47094-asus-rt-ac3100.dtsi. + +Remove the fixed-link node on port@7 as commit ba4aebce23b2 ("ARM: dts: +BCM5301X: Describe switch ports in the main DTS") states it's not +necessary. + +Replace the copyright notice with an author notice. + +Rename the model name from Asus to ASUS on bcm47094-asus-rt-ac88u.dts. + +Signed-off-by: Arınç ÜNAL +Reviewed-by: Linus Walleij +Link: https://lore.kernel.org/r/20230803071454.5902-2-arinc.unal@arinc9.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 1 + + .../dts/bcm47094-asus-rt-ac3100.dts | 23 +++ + .../dts/bcm47094-asus-rt-ac3100.dtsi | 163 ++++++++++++++++++ + .../dts/bcm47094-asus-rt-ac88u.dts | 155 +---------------- + 4 files changed, 190 insertions(+), 152 deletions(-) + create mode 100644 arch/arm/boot/dts/bcm47094-asus-rt-ac3100.dts + create mode 100644 arch/arm/boot/dts/bcm47094-asus-rt-ac3100.dtsi + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -119,6 +119,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm4709-netgear-r7000.dtb \ + bcm4709-netgear-r8000.dtb \ + bcm4709-tplink-archer-c9-v1.dtb \ ++ bcm47094-asus-rt-ac3100.dtb \ + bcm47094-asus-rt-ac88u.dtb \ + bcm47094-dlink-dir-885l.dtb \ + bcm47094-dlink-dir-890l.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac3100.dts +@@ -0,0 +1,23 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Author: Arınç ÜNAL ++ */ ++ ++/dts-v1/; ++ ++#include "bcm47094-asus-rt-ac3100.dtsi" ++ ++/ { ++ compatible = "asus,rt-ac3100", "brcm,bcm47094", "brcm,bcm4708"; ++ model = "ASUS RT-AC3100"; ++ ++ nvram@1c080000 { ++ et0macaddr: et0macaddr { ++ }; ++ }; ++}; ++ ++&gmac0 { ++ nvmem-cells = <&et0macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac3100.dtsi +@@ -0,0 +1,163 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Author: Arınç ÜNAL ++ */ ++ ++#include "bcm47094.dtsi" ++#include "bcm5301x-nand-cs0-bch8.dtsi" ++ ++/ { ++ chosen { ++ bootargs = "earlycon"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x18000000>; ++ }; ++ ++ nvram@1c080000 { ++ compatible = "brcm,nvram"; ++ reg = <0x1c080000 0x00180000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-power { ++ label = "white:power"; ++ gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ led-wan-red { ++ label = "red:wan"; ++ gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-lan { ++ label = "white:lan"; ++ gpios = <&chipcommon 21 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-usb2 { ++ label = "white:usb2"; ++ gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ehci_port2>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ led-usb3 { ++ label = "white:usb3"; ++ gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ehci_port1>, <&xhci_port1>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ led-wps { ++ label = "white:wps"; ++ gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ button-wps { ++ label = "WPS"; ++ linux,code = ; ++ gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>; ++ }; ++ ++ button-reset { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; ++ }; ++ ++ button-wifi { ++ label = "Wi-Fi"; ++ linux,code = ; ++ gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>; ++ }; ++ ++ button-led { ++ label = "Backlight"; ++ linux,code = ; ++ gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&srab { ++ compatible = "brcm,bcm53012-srab", "brcm,bcm5301x-srab"; ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ label = "lan1"; ++ }; ++ ++ port@4 { ++ label = "wan"; ++ }; ++ ++ port@5 { ++ label = "cpu"; ++ }; ++ ++ port@7 { ++ label = "cpu"; ++ }; ++ ++ port@8 { ++ label = "cpu"; ++ }; ++ }; ++}; ++ ++&usb2 { ++ vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3_phy { ++ status = "okay"; ++}; ++ ++&nandcs { ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "boot"; ++ reg = <0x00000000 0x00080000>; ++ read-only; ++ }; ++ ++ partition@80000 { ++ label = "nvram"; ++ reg = <0x00080000 0x00180000>; ++ }; ++ ++ partition@200000 { ++ label = "firmware"; ++ reg = <0x00200000 0x07e00000>; ++ compatible = "brcm,trx"; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -1,102 +1,21 @@ + // SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /* +- * Copyright (C) 2021-2022 Arınç ÜNAL ++ * Author: Arınç ÜNAL + */ + + /dts-v1/; + +-#include "bcm47094.dtsi" +-#include "bcm5301x-nand-cs0-bch8.dtsi" ++#include "bcm47094-asus-rt-ac3100.dtsi" + + / { + compatible = "asus,rt-ac88u", "brcm,bcm47094", "brcm,bcm4708"; +- model = "Asus RT-AC88U"; +- +- chosen { +- bootargs = "earlycon"; +- }; +- +- memory@0 { +- device_type = "memory"; +- reg = <0x00000000 0x08000000>, +- <0x88000000 0x18000000>; +- }; ++ model = "ASUS RT-AC88U"; + + nvram@1c080000 { +- compatible = "brcm,nvram"; +- reg = <0x1c080000 0x00180000>; +- + et1macaddr: et1macaddr { + }; + }; + +- leds { +- compatible = "gpio-leds"; +- +- led-power { +- label = "white:power"; +- gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; +- linux,default-trigger = "default-on"; +- }; +- +- led-wan-red { +- label = "red:wan"; +- gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>; +- }; +- +- led-lan { +- label = "white:lan"; +- gpios = <&chipcommon 21 GPIO_ACTIVE_LOW>; +- }; +- +- led-usb2 { +- label = "white:usb2"; +- gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>; +- trigger-sources = <&ehci_port2>; +- linux,default-trigger = "usbport"; +- }; +- +- led-usb3 { +- label = "white:usb3"; +- gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +- trigger-sources = <&ehci_port1>, <&xhci_port1>; +- linux,default-trigger = "usbport"; +- }; +- +- led-wps { +- label = "white:wps"; +- gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>; +- }; +- }; +- +- gpio-keys { +- compatible = "gpio-keys"; +- +- button-wps { +- label = "WPS"; +- linux,code = ; +- gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>; +- }; +- +- button-reset { +- label = "Reset"; +- linux,code = ; +- gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +- }; +- +- button-wifi { +- label = "Wi-Fi"; +- linux,code = ; +- gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>; +- }; +- +- button-led { +- label = "Backlight"; +- linux,code = ; +- gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; +- }; +- }; +- + switch { + compatible = "realtek,rtl8365mb"; + /* 7 = MDIO (has input reads), 6 = MDC (clock, output only) */ +@@ -175,31 +94,9 @@ + }; + + &srab { +- compatible = "brcm,bcm53012-srab", "brcm,bcm5301x-srab"; +- status = "okay"; + dsa,member = <0 0>; + + ports { +- port@0 { +- label = "lan4"; +- }; +- +- port@1 { +- label = "lan3"; +- }; +- +- port@2 { +- label = "lan2"; +- }; +- +- port@3 { +- label = "lan1"; +- }; +- +- port@4 { +- label = "wan"; +- }; +- + sw0_p5: port@5 { + /delete-property/ethernet; + +@@ -212,19 +109,6 @@ + pause; + }; + }; +- +- port@7 { +- label = "cpu"; +- +- fixed-link { +- speed = <1000>; +- full-duplex; +- }; +- }; +- +- port@8 { +- label = "cpu"; +- }; + }; + }; + +@@ -236,36 +120,3 @@ + nvmem-cells = <&et1macaddr>; + nvmem-cell-names = "mac-address"; + }; +- +-&usb2 { +- vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>; +-}; +- +-&usb3_phy { +- status = "okay"; +-}; +- +-&nandcs { +- partitions { +- compatible = "fixed-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; +- +- partition@0 { +- label = "boot"; +- reg = <0x00000000 0x00080000>; +- read-only; +- }; +- +- partition@80000 { +- label = "nvram"; +- reg = <0x00080000 0x00180000>; +- }; +- +- partition@200000 { +- label = "firmware"; +- reg = <0x00200000 0x07e00000>; +- compatible = "brcm,trx"; +- }; +- }; +-}; diff --git a/target/linux/bcm53xx/patches-5.15/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch b/target/linux/bcm53xx/patches-5.15/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch index e76a12fe1b..bc04cbd2d6 100644 --- a/target/linux/bcm53xx/patches-5.15/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch +++ b/target/linux/bcm53xx/patches-5.15/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch @@ -16,7 +16,7 @@ Signed-off-by: Rafał Miłecki + bcm4709-netgear-r7900.dtb \ bcm4709-netgear-r8000.dtb \ bcm4709-tplink-archer-c9-v1.dtb \ - bcm47094-asus-rt-ac88u.dtb \ + bcm47094-asus-rt-ac3100.dtb \ --- /dev/null +++ b/arch/arm/boot/dts/bcm4709-netgear-r7900.dts @@ -0,0 +1,42 @@ From 97980323efd2df1d229f846ddb8677b7ea7091ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= Date: Thu, 10 Aug 2023 15:23:09 +0300 Subject: [PATCH 32/40] bcm53xx: add support for ASUS RT-AC3100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ASUS RT-AC3100 is ASUS RT-AC88U without the external switch. OpenWrt forum users effortless and ktmakwana have confirmed that there are revisions with either 4366b1 or 4366c0 wireless chips. Therefore, include firmware for 4366b1 along with 4366c0. This way, all hardware revisions of the router will be supported by having brcmfmac use the firmware file for the wireless chip it detects. Signed-off-by: Arınç ÜNAL (cherry picked from commit 2214bab3503981fe6168746acd13044a9d5e89e7) --- target/linux/bcm53xx/image/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index b1eb4277b7..5158b432b3 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -159,6 +159,14 @@ define Device/asus IMAGE/trx := append-ubi | trx-nand | asus-trx endef +define Device/asus_rt-ac3100 + $(call Device/asus) + DEVICE_MODEL := RT-AC3100 + DEVICE_PACKAGES := $(BRCMFMAC_4366B1) $(BRCMFMAC_4366C0) $(USB3_PACKAGES) + ASUS_PRODUCTID := RT-AC3100 +endef +TARGET_DEVICES += asus_rt-ac3100 + define Device/asus_rt-ac56u $(call Device/asus) DEVICE_MODEL := RT-AC56U From ba300c8a1c807ecdd26545ca74285b81e972b718 Mon Sep 17 00:00:00 2001 From: Rani Hod Date: Sat, 30 Sep 2023 22:22:13 +0300 Subject: [PATCH 33/40] bcm53xx: build a single device per profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So far every build of a single bcm53xx Target Profile (it means: when NOT using CONFIG_TARGET_MULTI_PROFILE) resulted in all target devices images being built. Now it only builds the one matching selected profile. Fixes: #13572 Suggested-by: Jonas Gorski Signed-off-by: Rani Hod [rmilecki: update commit subject + body & move PROFILES line] Signed-off-by: Rafał Miłecki (cherry picked from commit 802a5f5cb4a7b42d25e82b787d7ab1323a20183f) --- target/linux/bcm53xx/image/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index 5158b432b3..f3c1b89adf 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -137,6 +137,7 @@ USB2_PACKAGES += kmod-usb-ledtrig-usbport USB3_PACKAGES := $(USB2_PACKAGES) kmod-usb3 kmod-phy-bcm-ns-usb3 define Device/Default + PROFILES = Generic $$(DEVICE_NAME) # .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names # extract the full dtb name based on the device info DEVICE_DTS := $(patsubst %.dtb,%,$(notdir $(wildcard $(if $(IB),$(KDIR),$(DTS_DIR))/*-$(subst _,-,$(1)).dtb))) From a1e3ec0ff647adbb08580e68372b411d34a8f1e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 13 Oct 2023 12:57:35 +0200 Subject: [PATCH 34/40] bcm53xx: simplify patch adding switch ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We now have all raw ports defined in bcm-ns.dtsi. Leave only lables in custom device files. Signed-off-by: Rafał Miłecki (cherry picked from commit 08ce0c76d7d7daad5e9382d51960d69f4b8b8f3a) --- ...-Specify-switch-ports-for-remaining-.patch | 152 ++---------------- 1 file changed, 16 insertions(+), 136 deletions(-) diff --git a/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch b/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch index e0832524f4..6779dfb8fe 100644 --- a/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch +++ b/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch @@ -10,7 +10,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts +++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts -@@ -92,3 +92,40 @@ +@@ -92,3 +92,33 @@ &usb3_phy { status = "okay"; }; @@ -20,40 +20,33 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts +++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts -@@ -83,3 +83,40 @@ +@@ -83,3 +83,33 @@ &usb3_phy { status = "okay"; }; @@ -63,40 +56,33 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts +++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts -@@ -149,3 +149,40 @@ +@@ -149,3 +149,33 @@ &usb3_phy { status = "okay"; }; @@ -106,40 +92,33 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts +++ b/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts -@@ -46,3 +46,40 @@ +@@ -46,3 +46,33 @@ &usb3_phy { status = "okay"; }; @@ -149,40 +128,33 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts +++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts -@@ -43,3 +43,40 @@ +@@ -43,3 +43,33 @@ &usb3_phy { status = "okay"; }; @@ -192,40 +164,33 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts +++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts -@@ -86,3 +86,40 @@ +@@ -86,3 +86,33 @@ &usb3_phy { status = "okay"; }; @@ -235,40 +200,33 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; --- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts +++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts -@@ -77,3 +77,40 @@ +@@ -77,3 +77,33 @@ &usb3_phy { status = "okay"; }; @@ -278,40 +236,33 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts -@@ -66,6 +66,38 @@ +@@ -66,6 +66,32 @@ status = "okay"; }; @@ -320,29 +271,23 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@7 { -+ reg = <7>; + label = "cpu"; -+ ethernet = <&gmac1>; + }; + }; +}; @@ -352,7 +297,7 @@ Signed-off-by: Rafał Miłecki compatible = "fixed-partitions"; --- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts -@@ -130,3 +130,40 @@ +@@ -130,3 +130,33 @@ &usb3_phy { status = "okay"; }; @@ -362,40 +307,33 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts -@@ -47,3 +47,45 @@ +@@ -47,3 +47,33 @@ &usb3_phy { status = "okay"; }; @@ -405,45 +343,33 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@8 { -+ reg = <8>; + label = "cpu"; -+ ethernet = <&gmac2>; -+ -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ }; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts -@@ -104,3 +104,40 @@ +@@ -104,3 +104,33 @@ &usb3_phy { status = "okay"; }; @@ -453,40 +379,33 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; --- a/arch/arm/boot/dts/bcm47094-netgear-r8500.dts +++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts -@@ -94,3 +94,45 @@ +@@ -94,3 +94,33 @@ &usb3_phy { status = "okay"; }; @@ -496,45 +415,33 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@8 { -+ reg = <8>; + label = "cpu"; -+ ethernet = <&gmac2>; -+ -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ }; + }; + }; +}; --- a/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts -@@ -38,6 +38,38 @@ +@@ -38,6 +38,32 @@ status = "okay"; }; @@ -543,29 +450,23 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; @@ -575,7 +476,7 @@ Signed-off-by: Rafał Miłecki compatible = "fixed-partitions"; --- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts -@@ -91,6 +91,43 @@ +@@ -91,6 +91,36 @@ }; }; @@ -584,34 +485,27 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; @@ -621,7 +515,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts -@@ -100,6 +100,43 @@ +@@ -100,6 +100,36 @@ vcc-gpio = <&chipcommon 12 GPIO_ACTIVE_HIGH>; }; @@ -630,34 +524,27 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; @@ -667,7 +554,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts +++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts -@@ -107,3 +107,41 @@ +@@ -107,3 +107,34 @@ &usb3_phy { status = "okay"; }; @@ -677,34 +564,27 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; + }; +}; From cd189cdefeac1c9375f6bb061f188bb358f31a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 24 Oct 2023 07:40:37 +0200 Subject: [PATCH 35/40] bcm53xx: backport DT changes queued for v6.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Among other changes this commit makes Linux use correct switch ports again. Fixes: a4792d79e899 ("bcm53xx: backport DT changes from v6.5") Signed-off-by: Rafał Miłecki (cherry picked from commit a67af19bc84e98588c307af9b08686bde9dd38d5) --- ...CM5301X-Set-MACs-for-D-Link-DIR-885L.patch | 56 +++ ...1X-Set-MAC-address-for-Asus-RT-AC87U.patch | 44 ++ ...-Relicense-Felix-s-code-to-the-GPL-2.patch | 57 +++ ...-Relicense-Vivek-s-code-to-the-GPL-2.patch | 104 +++++ ...-Explicitly-disable-unused-switch-CP.patch | 377 ++++++++++++++++++ ...-Set-fixed-link-for-extra-Netgear-R8.patch | 47 +++ ...-Specify-switch-ports-for-remaining-.patch | 2 +- 7 files changed, 686 insertions(+), 1 deletion(-) create mode 100644 target/linux/bcm53xx/patches-5.15/038-v6.7-0001-ARM-dts-BCM5301X-Set-MACs-for-D-Link-DIR-885L.patch create mode 100644 target/linux/bcm53xx/patches-5.15/038-v6.7-0002-ARM-dts-BCM5301X-Set-MAC-address-for-Asus-RT-AC87U.patch create mode 100644 target/linux/bcm53xx/patches-5.15/038-v6.7-0003-ARM-dts-BCM5301X-Relicense-Felix-s-code-to-the-GPL-2.patch create mode 100644 target/linux/bcm53xx/patches-5.15/038-v6.7-0004-ARM-dts-BCM5301X-Relicense-Vivek-s-code-to-the-GPL-2.patch create mode 100644 target/linux/bcm53xx/patches-5.15/038-v6.7-0005-ARM-dts-BCM5301X-Explicitly-disable-unused-switch-CP.patch create mode 100644 target/linux/bcm53xx/patches-5.15/038-v6.7-0006-ARM-dts-BCM5301X-Set-fixed-link-for-extra-Netgear-R8.patch diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0001-ARM-dts-BCM5301X-Set-MACs-for-D-Link-DIR-885L.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0001-ARM-dts-BCM5301X-Set-MACs-for-D-Link-DIR-885L.patch new file mode 100644 index 0000000000..78b8975f1f --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0001-ARM-dts-BCM5301X-Set-MACs-for-D-Link-DIR-885L.patch @@ -0,0 +1,56 @@ +From 5cbee5828219c4f7b33e96b5d8ce5e467b2857c8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 1 Sep 2023 12:55:49 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Set MACs for D-Link DIR-885L +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Specify NVRAM access and use its "et2macaddr" NVMEM cell. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20230901105549.7076-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcm47094-dlink-dir-885l.dts | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +@@ -25,6 +25,15 @@ + <0x88000000 0x08000000>; + }; + ++ nvram@1e3f0000 { ++ compatible = "brcm,nvram"; ++ reg = <0x1e3f0000 0x10000>; ++ ++ et2macaddr: et2macaddr { ++ #nvmem-cell-cells = <1>; ++ }; ++ }; ++ + nand_controller: nand-controller@18028000 { + nand@0 { + partitions { +@@ -112,6 +121,11 @@ + vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>; + }; + ++&gmac0 { ++ nvmem-cells = <&et2macaddr 0>; ++ nvmem-cell-names = "mac-address"; ++}; ++ + &spi_nor { + status = "okay"; + }; +@@ -142,6 +156,8 @@ + + port@4 { + label = "wan"; ++ nvmem-cells = <&et2macaddr 3>; ++ nvmem-cell-names = "mac-address"; + }; + + port@8 { diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0002-ARM-dts-BCM5301X-Set-MAC-address-for-Asus-RT-AC87U.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0002-ARM-dts-BCM5301X-Set-MAC-address-for-Asus-RT-AC87U.patch new file mode 100644 index 0000000000..11ce7acb53 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0002-ARM-dts-BCM5301X-Set-MAC-address-for-Asus-RT-AC87U.patch @@ -0,0 +1,44 @@ +From a9e79863b62aaaefcdf469fc331bf482ae00db0d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 1 Sep 2023 14:43:11 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Set MAC address for Asus RT-AC87U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Specify NVRAM access and use its "et1macaddr" NVMEM cell. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20230901124311.31156-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/broadcom/bcm4709-asus-rt-ac87u.dts | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts ++++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +@@ -25,6 +25,12 @@ + <0x88000000 0x08000000>; + }; + ++ nvram@1c080000 { ++ et1macaddr: et1macaddr { ++ #nvmem-cell-cells = <1>; ++ }; ++ }; ++ + leds { + compatible = "gpio-leds"; + +@@ -62,6 +68,11 @@ + }; + }; + ++&gmac0 { ++ nvmem-cells = <&et1macaddr 0>; ++ nvmem-cell-names = "mac-address"; ++}; ++ + &usb3_phy { + status = "okay"; + }; diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0003-ARM-dts-BCM5301X-Relicense-Felix-s-code-to-the-GPL-2.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0003-ARM-dts-BCM5301X-Relicense-Felix-s-code-to-the-GPL-2.patch new file mode 100644 index 0000000000..6df1e555e9 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0003-ARM-dts-BCM5301X-Relicense-Felix-s-code-to-the-GPL-2.patch @@ -0,0 +1,57 @@ +From 81ea360a16978a4df61df9db56b171909bd659c0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sat, 16 Sep 2023 10:30:57 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Relicense Felix's code to the GPL 2.0+ / + MIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Move code added by Felix to the bcm-ns.dtsi which uses dual licensing. +That syncs more Northstar code to be based on the same licensing schema. + +This code was added in the commit 1ff80363524c ("ARM: BCM5301X: Add +profiling support"). + +Cc: Felix Fietkau +Signed-off-by: Rafał Miłecki +Acked-by: Felix Fietkau +Link: https://lore.kernel.org/r/20230916083057.10458-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/broadcom/bcm-ns.dtsi | 7 +++++++ + arch/arm/boot/dts/broadcom/bcm5301x.dtsi | 7 ------- + 2 files changed, 7 insertions(+), 7 deletions(-) + +--- a/arch/arm/boot/dts/bcm-ns.dtsi ++++ b/arch/arm/boot/dts/bcm-ns.dtsi +@@ -14,6 +14,13 @@ + #address-cells = <1>; + #size-cells = <1>; + ++ pmu { ++ compatible = "arm,cortex-a9-pmu"; ++ interrupts = ++ , ++ ; ++ }; ++ + chipcommon-a-bus@18000000 { + compatible = "simple-bus"; + ranges = <0x00000000 0x18000000 0x00001000>; +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -26,13 +26,6 @@ + }; + }; + +- pmu { +- compatible = "arm,cortex-a9-pmu"; +- interrupts = +- , +- ; +- }; +- + clocks { + #address-cells = <1>; + #size-cells = <1>; diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0004-ARM-dts-BCM5301X-Relicense-Vivek-s-code-to-the-GPL-2.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0004-ARM-dts-BCM5301X-Relicense-Vivek-s-code-to-the-GPL-2.patch new file mode 100644 index 0000000000..66db4a291f --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0004-ARM-dts-BCM5301X-Relicense-Vivek-s-code-to-the-GPL-2.patch @@ -0,0 +1,104 @@ +From b8d4f7c1be04d66c37c119c501c87bccc4197694 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sat, 16 Sep 2023 10:58:55 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Relicense Vivek's code to the GPL 2.0+ / + MIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Move code added by Vivek to the bcm-ns.dtsi which uses dual licensing. +That syncs more Northstar code to be based on the same licensing schema. + +This code was added in the commit 37f6130ec39f ("ARM: dts: BCM5301X: +Make USB 3.0 PHY use MDIO PHY driver"). + +Cc: Vivek Unune +Signed-off-by: Rafał Miłecki +Acked-by: Vivek Unune +Link: https://lore.kernel.org/r/20230916085855.28375-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/broadcom/bcm-ns.dtsi | 27 ++++++++++++++++++++++++ + arch/arm/boot/dts/broadcom/bcm5301x.dtsi | 27 ------------------------ + 2 files changed, 27 insertions(+), 27 deletions(-) + +--- a/arch/arm/boot/dts/bcm-ns.dtsi ++++ b/arch/arm/boot/dts/bcm-ns.dtsi +@@ -327,6 +327,29 @@ + #address-cells = <1>; + }; + ++ mdio-mux@18003000 { ++ compatible = "mdio-mux-mmioreg", "mdio-mux"; ++ mdio-parent-bus = <&mdio>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x18003000 0x4>; ++ mux-mask = <0x200>; ++ ++ mdio@0 { ++ reg = <0x0>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ usb3_phy: usb3-phy@10 { ++ compatible = "brcm,ns-ax-usb3-phy"; ++ reg = <0x10>; ++ usb3-dmp-syscon = <&usb3_dmp>; ++ #phy-cells = <0>; ++ status = "disabled"; ++ }; ++ }; ++ }; ++ + rng: rng@18004000 { + compatible = "brcm,bcm5301x-rng"; + reg = <0x18004000 0x14>; +@@ -467,6 +490,10 @@ + brcm,nand-has-wp; + }; + ++ usb3_dmp: syscon@18105000 { ++ reg = <0x18105000 0x1000>; ++ }; ++ + thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <0>; +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -62,33 +62,6 @@ + }; + }; + +- mdio-mux@18003000 { +- compatible = "mdio-mux-mmioreg", "mdio-mux"; +- mdio-parent-bus = <&mdio>; +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <0x18003000 0x4>; +- mux-mask = <0x200>; +- +- mdio@0 { +- reg = <0x0>; +- #address-cells = <1>; +- #size-cells = <0>; +- +- usb3_phy: usb3-phy@10 { +- compatible = "brcm,ns-ax-usb3-phy"; +- reg = <0x10>; +- usb3-dmp-syscon = <&usb3_dmp>; +- #phy-cells = <0>; +- status = "disabled"; +- }; +- }; +- }; +- +- usb3_dmp: syscon@18105000 { +- reg = <0x18105000 0x1000>; +- }; +- + i2c0: i2c@18009000 { + compatible = "brcm,iproc-i2c"; + reg = <0x18009000 0x50>; diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0005-ARM-dts-BCM5301X-Explicitly-disable-unused-switch-CP.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0005-ARM-dts-BCM5301X-Explicitly-disable-unused-switch-CP.patch new file mode 100644 index 0000000000..72e5c6b061 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0005-ARM-dts-BCM5301X-Explicitly-disable-unused-switch-CP.patch @@ -0,0 +1,377 @@ +From 473baeab929444295b0530f8766e4becb6a08973 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 13 Oct 2023 12:33:13 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Explicitly disable unused switch CPU + ports +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When redescribing ports I assumed that missing "label" (like "cpu") +means switch port isn't used. That was incorrect and I realized my +change made Linux always use the first (5) CPU port (there are 3 of +them). + +While above should technically be possible it often isn't correct: +1. Non-default switch ports are often connected to Ethernet interfaces + not fully covered by vendor setup (they may miss MACs) +2. On some devices non-default ports require specifying fixed link + +This fixes network connectivity for some devices. It was reported & +tested for Netgear R8000. It also affects Linksys EA9200 with its +downstream DTS. + +Fixes: ba4aebce23b2 ("ARM: dts: BCM5301X: Describe switch ports in the main DTS") +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20231013103314.10306-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4708-luxul-xap-1510.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4708-luxul-xwc-1000.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4708-netgear-r6250.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4708-smartrg-sr400ac.dts | 8 ++++++++ + .../boot/dts/broadcom/bcm47081-buffalo-wzr-600dhp2.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47081-luxul-xap-1410.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47081-luxul-xwr-1200.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4709-netgear-r8000.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-885l.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-890l.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-abr-4500.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xap-1610.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xbr-4500.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xwc-2000.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3100.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3150-v1.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm53015-meraki-mr26.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm53016-meraki-mr32.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm953012er.dts | 8 ++++++++ + 20 files changed, 160 insertions(+) + +--- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi +@@ -181,5 +181,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts ++++ b/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts +@@ -85,5 +85,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts ++++ b/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts +@@ -88,5 +88,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts ++++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts +@@ -122,5 +122,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts ++++ b/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts +@@ -145,6 +145,14 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; + +--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts ++++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts +@@ -145,5 +145,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts ++++ b/arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts +@@ -81,5 +81,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts ++++ b/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts +@@ -148,5 +148,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts +@@ -227,6 +227,14 @@ + label = "wan"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { + label = "cpu"; + }; +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +@@ -160,6 +160,14 @@ + nvmem-cell-names = "mac-address"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { + label = "cpu"; + }; +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts +@@ -192,6 +192,14 @@ + label = "wan"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { + label = "cpu"; + phy-mode = "rgmii"; +--- a/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts +@@ -107,5 +107,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts +@@ -120,5 +120,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts +@@ -107,5 +107,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts +@@ -75,5 +75,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts +@@ -147,5 +147,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts +@@ -158,5 +158,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm53015-meraki-mr26.dts ++++ b/arch/arm/boot/dts/bcm53015-meraki-mr26.dts +@@ -124,6 +124,14 @@ + full-duplex; + }; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -185,6 +185,14 @@ + full-duplex; + }; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; + +--- a/arch/arm/boot/dts/bcm953012er.dts ++++ b/arch/arm/boot/dts/bcm953012er.dts +@@ -84,6 +84,14 @@ + label = "cpu"; + ethernet = <&gmac0>; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; + diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0006-ARM-dts-BCM5301X-Set-fixed-link-for-extra-Netgear-R8.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0006-ARM-dts-BCM5301X-Set-fixed-link-for-extra-Netgear-R8.patch new file mode 100644 index 0000000000..0b2b7b36a3 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0006-ARM-dts-BCM5301X-Set-fixed-link-for-extra-Netgear-R8.patch @@ -0,0 +1,47 @@ +From d313b0e9070a7100ca55e64fe3b081d176d8806d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 13 Oct 2023 12:33:14 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Set fixed-link for extra Netgear R8000 + CPU ports +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Ports 5 and 7 are disabled by default because the standard use case is +for port 8 to manage all CPU directed traffic. For experimentation +purposes however it is desirable to provide adequate properties such +that people can experiment with using different ports without having to +figure out their configuration. Some of the use cases include but are +not limited to doubling or tripling the bandwidth by leveraging the +additional ports/Ethernet MAC combinations. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20231013103314.10306-2-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/broadcom/bcm4709-netgear-r8000.dts | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts +@@ -229,10 +229,20 @@ + + port@5 { + status = "disabled"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; + }; + + port@7 { + status = "disabled"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; + }; + + port@8 { diff --git a/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch b/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch index 6779dfb8fe..0efb284039 100644 --- a/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch +++ b/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch @@ -262,7 +262,7 @@ Signed-off-by: Rafał Miłecki +}; --- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts -@@ -66,6 +66,32 @@ +@@ -77,6 +77,32 @@ status = "okay"; }; From 7bd682bc58fbfab673290e9d150786946f0788fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 13 Oct 2023 13:25:33 +0200 Subject: [PATCH 36/40] bcm53xx: disable unused switch ports in downstream patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes Linux use correct switch ports again. Fixes: a4792d79e899 ("bcm53xx: backport DT changes from v6.5") Fixes: https://github.com/openwrt/openwrt/issues/13548 Signed-off-by: Rafał Miłecki (cherry picked from commit a912ee74d6ca08020933dcdb9ce791e74244c25b) --- ...-Specify-switch-ports-for-remaining-.patch | 160 ++++++++++++++++-- 1 file changed, 144 insertions(+), 16 deletions(-) diff --git a/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch b/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch index 0efb284039..ed75623460 100644 --- a/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch +++ b/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch @@ -10,7 +10,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts +++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts -@@ -92,3 +92,33 @@ +@@ -92,3 +92,41 @@ &usb3_phy { status = "okay"; }; @@ -42,11 +42,19 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts +++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts -@@ -83,3 +83,33 @@ +@@ -83,3 +83,41 @@ &usb3_phy { status = "okay"; }; @@ -78,11 +86,19 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts +++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts -@@ -149,3 +149,33 @@ +@@ -149,3 +149,41 @@ &usb3_phy { status = "okay"; }; @@ -114,11 +130,19 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts +++ b/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts -@@ -46,3 +46,33 @@ +@@ -46,3 +46,41 @@ &usb3_phy { status = "okay"; }; @@ -150,11 +174,19 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts +++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts -@@ -43,3 +43,33 @@ +@@ -43,3 +43,41 @@ &usb3_phy { status = "okay"; }; @@ -186,11 +218,19 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts +++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts -@@ -86,3 +86,33 @@ +@@ -86,3 +86,41 @@ &usb3_phy { status = "okay"; }; @@ -222,11 +262,19 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; --- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts +++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts -@@ -77,3 +77,33 @@ +@@ -77,3 +77,41 @@ &usb3_phy { status = "okay"; }; @@ -258,11 +306,19 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; --- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts -@@ -77,6 +77,32 @@ +@@ -77,6 +77,40 @@ status = "okay"; }; @@ -286,9 +342,17 @@ Signed-off-by: Rafał Miłecki + label = "lan3"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ + port@7 { + label = "cpu"; + }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; + @@ -297,7 +361,7 @@ Signed-off-by: Rafał Miłecki compatible = "fixed-partitions"; --- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts -@@ -130,3 +130,33 @@ +@@ -130,3 +130,41 @@ &usb3_phy { status = "okay"; }; @@ -329,11 +393,19 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; --- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts -@@ -47,3 +47,33 @@ +@@ -47,3 +47,41 @@ &usb3_phy { status = "okay"; }; @@ -362,6 +434,14 @@ Signed-off-by: Rafał Miłecki + label = "wan"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { + label = "cpu"; + }; @@ -369,7 +449,7 @@ Signed-off-by: Rafał Miłecki +}; --- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts -@@ -104,3 +104,33 @@ +@@ -104,3 +104,41 @@ &usb3_phy { status = "okay"; }; @@ -401,11 +481,19 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; --- a/arch/arm/boot/dts/bcm47094-netgear-r8500.dts +++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts -@@ -94,3 +94,33 @@ +@@ -94,3 +94,41 @@ &usb3_phy { status = "okay"; }; @@ -434,6 +522,14 @@ Signed-off-by: Rafał Miłecki + label = "lan4"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { + label = "cpu"; + }; @@ -441,7 +537,7 @@ Signed-off-by: Rafał Miłecki +}; --- a/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts -@@ -38,6 +38,32 @@ +@@ -38,6 +38,40 @@ status = "okay"; }; @@ -468,6 +564,14 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; + @@ -476,7 +580,7 @@ Signed-off-by: Rafał Miłecki compatible = "fixed-partitions"; --- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts -@@ -91,6 +91,36 @@ +@@ -91,6 +91,44 @@ }; }; @@ -507,6 +611,14 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; + @@ -515,7 +627,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts -@@ -100,6 +100,36 @@ +@@ -100,6 +100,44 @@ vcc-gpio = <&chipcommon 12 GPIO_ACTIVE_HIGH>; }; @@ -546,6 +658,14 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; + @@ -554,7 +674,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts +++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts -@@ -107,3 +107,34 @@ +@@ -107,3 +107,42 @@ &usb3_phy { status = "okay"; }; @@ -586,6 +706,14 @@ Signed-off-by: Rafał Miłecki + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; +}; + From 6150df13a369850f0d99ad418c2d580f4af940fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 26 Oct 2023 07:12:36 +0200 Subject: [PATCH 37/40] bcm53xx: backport 1 more late DT patch accepted for v6.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit 732ae343ffb3ad19978b75a8105d55f5e6d1d435) --- ...-Set-switch-ports-for-Linksys-EA9200.patch | 63 +++++++++++++++++++ ...-Specify-switch-ports-for-remaining-.patch | 44 ------------- 2 files changed, 63 insertions(+), 44 deletions(-) create mode 100644 target/linux/bcm53xx/patches-5.15/038-v6.7-0007-ARM-dts-BCM5301X-Set-switch-ports-for-Linksys-EA9200.patch diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0007-ARM-dts-BCM5301X-Set-switch-ports-for-Linksys-EA9200.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0007-ARM-dts-BCM5301X-Set-switch-ports-for-Linksys-EA9200.patch new file mode 100644 index 0000000000..4528c95a5a --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0007-ARM-dts-BCM5301X-Set-switch-ports-for-Linksys-EA9200.patch @@ -0,0 +1,63 @@ +From 253358f373492608348136e569366d73cb969f6a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 24 Oct 2023 09:26:05 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Set switch ports for Linksys EA9200 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch was developed as OpenWrt downstream change and was recently +confirmed to work as expected. + +Tested-by: Rani Hod +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20231024072605.32517-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcm4709-linksys-ea9200.dts | 38 +++++++++++++++++++ + 1 file changed, 38 insertions(+) + +--- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts ++++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +@@ -47,3 +47,41 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ label = "wan"; ++ }; ++ ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ label = "cpu"; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch b/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch index ed75623460..8039831a78 100644 --- a/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch +++ b/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch @@ -403,50 +403,6 @@ Signed-off-by: Rafał Miłecki + }; + }; +}; ---- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts -+++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts -@@ -47,3 +47,41 @@ - &usb3_phy { - status = "okay"; - }; -+ -+&srab { -+ status = "okay"; -+ -+ ports { -+ port@0 { -+ label = "lan1"; -+ }; -+ -+ port@1 { -+ label = "lan2"; -+ }; -+ -+ port@2 { -+ label = "lan3"; -+ }; -+ -+ port@3 { -+ label = "lan4"; -+ }; -+ -+ port@4 { -+ label = "wan"; -+ }; -+ -+ port@5 { -+ status = "disabled"; -+ }; -+ -+ port@7 { -+ status = "disabled"; -+ }; -+ -+ port@8 { -+ label = "cpu"; -+ }; -+ }; -+}; --- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts @@ -104,3 +104,41 @@ From 9eec4eb2684531ef146b9e4ff1a6c7545302fca9 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Wed, 16 Aug 2023 11:22:30 +0200 Subject: [PATCH 38/40] prereq: make existing binary check work for sdk as well To avoid replacing host built binaries with symlinks again, a check for an appropriate stamp was added in 729909c07f ("prereq-build: do not replace binaries with symlinks"). Unfortunately the stamp directory does not exist in the SDK, so the fix was ineffective there. This caused the packages builders to e.g. use the host tar again, which in turn made the tarballs created different since it may lack reproducibility fixes, or implement these differently, causing spurious hash failures on source repository based packages. Fix this by dropping the stamp dir check, and just check that the file is usable. Fixes: 729909c07f ("prereq-build: do not replace binaries with symlinks") Signed-off-by: Jonas Gorski (cherry picked from commit c1ef10c8d873254ce7c1f3019d821c4a87227474) --- include/prereq.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/include/prereq.mk b/include/prereq.mk index 88ed1f406a..5cb1102182 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -111,7 +111,6 @@ define SetupHostCommand [ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \ ;; \ "-"*) \ - find "$(STAGING_DIR_HOST)/stamp" | grep $(strip $(1)) && \ [ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \ ;; \ *" -> /"*) \ From c4c9f6133178f7e36ec3193be97326bbd037bd44 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Wed, 23 Aug 2023 09:47:57 +0200 Subject: [PATCH 39/40] prereq: merge common cases in SetupHostCommand Now that most cases do the same thing in SetupHostCommand, merge them together into one. To allow moving the generic symlink check, invert the check and let it check for relative links by matching on link targets that do not start with a slash. This then allows us to also drop the absolute link case, shortening the case statement further. This reorders the check to * if it is not a symlink, do not change it * if it is a symlink and it points to the found command, do not change it * if it is a symlink with a relative path, do not change it * else, update/replace it Signed-off-by: Jonas Gorski (cherry picked from commit 3210aa8e0a113cc4354628b08b608c5c8f792941) --- include/prereq.mk | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/include/prereq.mk b/include/prereq.mk index 5cb1102182..9f1ff70eed 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -107,15 +107,9 @@ define SetupHostCommand bin="$$$$$$$$(command -v "$$$$$$$${cmd%% *}")"; \ if [ -x "$$$$$$$$bin" ] && eval "$$$$$$$$cmd" >/dev/null 2>/dev/null; then \ case "$$$$$$$$(ls -dl -- $(STAGING_DIR_HOST)/bin/$(strip $(1)))" in \ - *" -> $$$$$$$$bin"*) \ - [ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \ - ;; \ - "-"*) \ - [ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \ - ;; \ - *" -> /"*) \ - ;; \ - *" -> "*) \ + "-"* | \ + *" -> $$$$$$$$bin"* | \ + *" -> "[!/]*) \ [ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \ ;; \ esac; \ From 525adac8eec19f715a261277430f73fc6797daab Mon Sep 17 00:00:00 2001 From: David Bauer Date: Fri, 20 Oct 2023 15:14:15 +0200 Subject: [PATCH 40/40] uqmi: update to latest HEAD c8c9f10 uim: fix help formatting aac0776 uqmi: add APN profile commands ffc5eea uim: support SIM card power-up/down d6c963d uim: add application state to SIM status Signed-off-by: David Bauer (cherry picked from commit 0da74dbb453d739ee37bbdca75cac5e294b2cb56) --- package/network/utils/uqmi/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/utils/uqmi/Makefile b/package/network/utils/uqmi/Makefile index 6671719321..e7de3ef77d 100644 --- a/package/network/utils/uqmi/Makefile +++ b/package/network/utils/uqmi/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uqmi -PKG_RELEASE:=5 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git -PKG_SOURCE_DATE:=2022-05-04 -PKG_SOURCE_VERSION:=56cb2d4056fef132ccf78dfb6f3074ae5d109992 -PKG_MIRROR_HASH:=cc832b5318805df8c8387a3650f250dee72d5f1dbda4e4866b5503e186b2210c +PKG_SOURCE_DATE:=2022-10-20 +PKG_SOURCE_VERSION:=c8c9f105aa2d03146664fa1cc1bd2c837aa4aadd +PKG_MIRROR_HASH:=5fd1b3c8f5e7c4b52ed81a0c69504fbf39e69c0ecd1f8278969cf22f57fdb2a9 PKG_MAINTAINER:=Matti Laakso PKG_LICENSE:=GPL-2.0