From 03ab4bfd5af37c50da4632c9ec8f3327a7d1c4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Tue, 24 Sep 2024 17:00:33 +0200 Subject: [PATCH 1/7] .github/workflows/deploy-template.yml: Add deployment for ODROID H4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Żygowski --- .github/workflows/deploy-template.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index ef49f026e06..e94d79e9608 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -53,6 +53,10 @@ jobs: base_dir="msi" model=$(echo "$tag" | cut -d'_' -f1-2) release=$(echo "$tag" | cut -d'_' -f3) + elif [ "${{ inputs.platform }}" == "hardkernel" ]; then + base_dir="hardkernel" + model=$(echo "$tag" | cut -d'_' -f2-3) + release=$(echo "$tag" | cut -d'_' -f4) fi echo "base_dir=$base_dir" >> "$GITHUB_OUTPUT" echo "model=$model" >> "$GITHUB_OUTPUT" @@ -73,6 +77,8 @@ jobs: first_part=$(echo ${{ steps.tag_name.outputs.tag }} | cut -d "_" -f1) second_part=$(echo ${{ steps.tag_name.outputs.tag }} | cut -d "_" -f2) echo "artifact_name=dasharo-$first_part-${second_part}_${{ inputs.type }}" >> "$GITHUB_OUTPUT" + elif [ "${{ inputs.platform }}" == "hardkernel" ]; then + echo "artifact_name=dasharo-${{ inputs.vendor }}-${{ inputs.model }}" >> "$GITHUB_OUTPUT" fi - name: Download workflow artifact @@ -98,6 +104,8 @@ jobs: new_name=$(echo "${{ inputs.vendor }}_${{ inputs.model }}_${{ inputs.payload }}_${release}.rom" | sed 's/.*/\L&/') elif [ "${{ inputs.platform }}" == "msi" ]; then new_name=$(echo "${model}_${{ inputs.type }}_${release}.rom" | sed 's/-/_/g; s/.*/\L&/') + elif [ "${{ inputs.platform }}" == "hardkernel" ]; then + new_name=$(echo "${{ inputs.vendor }}-${{ inputs.model }}_${release}.rom" | sed 's/-/_/g; s/.*/\L&/') fi # Create release directory if it doesn't exist From f460af2d854b27f11e86be7dc339077404cf9ba7 Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Mon, 30 Sep 2024 10:11:07 +0200 Subject: [PATCH 2/7] .github/workflows/deploy-template.yml: create board dir structure If uploading for the first time for a new board, directory structure might not be in place yet. Change-Id: I698d960771b7295d82133a92f33f284f8787bd74 Signed-off-by: Maciej Pijanowski --- .github/workflows/deploy-template.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index e94d79e9608..adeccdecaf0 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -109,7 +109,11 @@ jobs: fi # Create release directory if it doesn't exist + $CURL_CMD -X MKCOL "$BASE_URL/$base_dir" + $CURL_CMD -X MKCOL "$BASE_URL/$base_dir/$model" $CURL_CMD -X MKCOL "$BASE_URL/$base_dir/$model/$release" + + # upload firmware and hash files $CURL_CMD -X PUT -T "artifacts/coreboot.rom" "$BASE_URL/$base_dir/$model/$release/$new_name" sha256sum artifacts/coreboot.rom > ${new_name}.sha256 $CURL_CMD -X PUT -T "${new_name}.sha256" "$BASE_URL/$base_dir/$model/$release/" From 5c64e569ddc7cf4abbcf0438db8c57dc18b057a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Mon, 30 Sep 2024 13:27:14 +0200 Subject: [PATCH 3/7] .github/workflows/deploy-template.yml: Fix paths for 3mdeb releases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Żygowski --- .github/workflows/deploy-template.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index adeccdecaf0..fd6077ad0f7 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -50,12 +50,12 @@ jobs: model="pcengines_apu2" release=$(echo "$tag" | cut -d'_' -f3) elif [ "${{ inputs.platform }}" == "msi" ]; then - base_dir="msi" - model=$(echo "$tag" | cut -d'_' -f1-2) + base_dir="3mdeb/msi_$(echo "$tag" | cut -d'_' -f1-2)" + model="" release=$(echo "$tag" | cut -d'_' -f3) elif [ "${{ inputs.platform }}" == "hardkernel" ]; then - base_dir="hardkernel" - model=$(echo "$tag" | cut -d'_' -f2-3) + base_dir="3mdeb/hardkernel_$(echo "$tag" | cut -d'_' -f2-3)" + model="" release=$(echo "$tag" | cut -d'_' -f4) fi echo "base_dir=$base_dir" >> "$GITHUB_OUTPUT" From 1cf025196af436f83ef2eed23ae24455eeb59f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Mon, 30 Sep 2024 13:31:36 +0200 Subject: [PATCH 4/7] build.sh: Add DOROID H4 build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Żygowski --- build.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/build.sh b/build.sh index 19646f0029a..0c71078cdb4 100755 --- a/build.sh +++ b/build.sh @@ -25,6 +25,7 @@ usage() { echo -e "\toptiplex_9010 - build Dasharo compatible with Dell OptiPlex 7010/9010" echo -e "\tqemu - build Dasharo for QEMU Q35" echo -e "\tqemu_full - build Dasharo for QEMU Q35 with all menus available" + echo -e "\todroid_h4 - build Dasharo compatible with Hardkernel ODROID H4" } SDKVER="2023-11-24_2731fa619b" @@ -222,6 +223,39 @@ function build_qemu { fi } +function build_odroid_h4 { + DEFCONFIG="configs/config.hardkernel_odroid_h4" + FW_VERSION=$(cat ${DEFCONFIG} | grep CONFIG_LOCALVERSION | cut -d '=' -f 2 | tr -d '"') + + # checkout several submodules needed by these boards (some others are checked + # out by coreboot's Makefile) + git submodule update --init --force --checkout \ + 3rdparty/dasharo-blobs + + docker run --rm -t -u $UID -v $PWD:/home/coreboot/coreboot \ + -v $HOME/.ssh:/home/coreboot/.ssh \ + -w /home/coreboot/coreboot coreboot/coreboot-sdk:$SDKVER \ + /bin/bash -c "make distclean" + + cp $DEFCONFIG .config + + echo "Building Dasharo compatbile with Hardkernel ODROID H4 (version $FW_VERSION)" + + docker run --rm -t -u $UID -v $PWD:/home/coreboot/coreboot \ + -v $HOME/.ssh:/home/coreboot/.ssh \ + -w /home/coreboot/coreboot coreboot/coreboot-sdk:$SDKVER \ + /bin/bash -c "make olddefconfig && make -j$(nproc)" + + cp build/coreboot.rom hardkernel_odroid_h4_${FW_VERSION}.rom + if [ $? -eq 0 ]; then + echo "Result binary placed in $PWD/hardkernel_odroid_h4_${FW_VERSION}.rom" + sha256sum hardkernel_odroid_h4_${FW_VERSION}.rom > hardkernel_odroid_h4_${FW_VERSION}.rom.sha256 + else + echo "Build failed!" + exit 1 + fi +} + CMD="$1" case "$CMD" in @@ -299,6 +333,9 @@ case "$CMD" in "qemu_full" | "QEMU_full" | "q35_full" | "Q35_full" ) build_qemu "_all_menus" ;; + "odroid_h4" | "odroid_H4" | "ODROID_H4" ) + build_odroid_h4 + ;; *) echo "Invalid command: \"$CMD\"" usage From 1c57c9959dd2f33468a83acfcec29ad9975382dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Mon, 30 Sep 2024 13:32:02 +0200 Subject: [PATCH 5/7] build.sh: Bump SDKVER to 2024-02-18_732134932b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Żygowski --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 0c71078cdb4..34ba598f590 100755 --- a/build.sh +++ b/build.sh @@ -28,7 +28,7 @@ usage() { echo -e "\todroid_h4 - build Dasharo compatible with Hardkernel ODROID H4" } -SDKVER="2023-11-24_2731fa619b" +SDKVER="2024-02-18_732134932b" function build_optiplex_9010 { From 7597dd76c742f0f01db26183721e3b34c56c296d Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Tue, 1 Oct 2024 09:50:04 +0200 Subject: [PATCH 6/7] .github/workflows/deploy-template.yml: wip - simplify the deply template Change-Id: Ib7b4c499ae484e1a215abbf156ceafa7e36270d3 Signed-off-by: Maciej Pijanowski --- .github/workflows/deploy-template.yml | 43 +++++++++++---------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index fd6077ad0f7..bc76d9aba5f 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -31,33 +31,24 @@ jobs: - name: Parse directories id: parse_directories run: | + tag=${{ steps.tag_name.outputs.tag }} - if [ "${{ inputs.platform }}" == "protectli" ]; then - base_dir="protectli" - if [ "${{ inputs.model }}" == "vp2430" ]; then - model="protectli_vp2430" - release=$(echo "$tag" | cut -d'_' -f3) - else - model=$(echo "$tag" | cut -d'_' -f1-3) - release=$(echo "$tag" | cut -d'_' -f4) - fi - elif [ "${{ inputs.platform }}" == "novacustom" ]; then - base_dir="novacustom" - model=$(echo "$tag" | cut -d'_' -f1-3) - release=$(echo "$tag" | cut -d'_' -f4) - elif [ "${{ inputs.platform }}" == "pcengines" ]; then - base_dir="pcengines" - model="pcengines_apu2" - release=$(echo "$tag" | cut -d'_' -f3) - elif [ "${{ inputs.platform }}" == "msi" ]; then - base_dir="3mdeb/msi_$(echo "$tag" | cut -d'_' -f1-2)" - model="" - release=$(echo "$tag" | cut -d'_' -f3) - elif [ "${{ inputs.platform }}" == "hardkernel" ]; then - base_dir="3mdeb/hardkernel_$(echo "$tag" | cut -d'_' -f2-3)" - model="" - release=$(echo "$tag" | cut -d'_' -f4) - fi + # Extract platform model string (everything before the last underscore in the tag) + model=$(echo "$tag" | awk -F'_' '{OFS="_"; $(NF)=""; print $0}' | sed 's/_$//') + # Extract version string (everything after the last underscore in the tag) + release=$(echo "$tag" | awk -F'_' '{print $NF}') + + # Use 3mdeb directory for community / DPP releases + case "${{ inputs.platform }}" in + msi|hardkernel) + base_dir="3mdeb" + ;; + *) + # by default, use platform vendor name as a directory + base_dir="${{ inputs.platform }}" + ;; + esac + echo "base_dir=$base_dir" >> "$GITHUB_OUTPUT" echo "model=$model" >> "$GITHUB_OUTPUT" echo "release=$release" >> "$GITHUB_OUTPUT" From ed525aa189b74f611312081fbf152851d4524c5e Mon Sep 17 00:00:00 2001 From: Pawel Langowski Date: Tue, 1 Oct 2024 11:06:12 +0200 Subject: [PATCH 7/7] .github/workflows: Simplify deploy-template workflow Signed-off-by: Pawel Langowski --- .github/workflows/build.yml | 58 ++++++++++++++++++++++++--- .github/workflows/deploy-template.yml | 46 ++++++++------------- 2 files changed, 69 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dec5668c060..84824fc3782 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -273,6 +273,8 @@ jobs: platform: protectli vendor: ${{ matrix.vendor }} model: ${{ matrix.model }} + artifact_name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}" + secrets: inherit strategy: matrix: @@ -312,6 +314,7 @@ jobs: platform: protectli vendor: ${{ matrix.vendor }} model: ${{ matrix.model }} + artifact_name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}" secrets: inherit strategy: matrix: @@ -325,6 +328,7 @@ jobs: platform: protectli vendor: ${{ matrix.vendor }} model: ${{ matrix.model }} + artifact_name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}" secrets: inherit strategy: matrix: @@ -338,6 +342,7 @@ jobs: platform: protectli vendor: ${{ matrix.vendor }} model: ${{ matrix.model }} + artifact_name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}" secrets: inherit strategy: matrix: @@ -351,18 +356,40 @@ jobs: platform: protectli vendor: ${{ matrix.vendor }} model: ${{ matrix.model }} + artifact_name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}" secrets: inherit strategy: matrix: vendor: [ protectli ] model: [ vp46xx ] - deploy_novacustom: - if: startsWith(github.ref, 'refs/tags/novacustom') + deploy_novacustom_adl: + if: startsWith(github.ref, 'refs/tags/novacustom') && contains(github.ref, 'adl') needs: build_novacustom uses: ./.github/workflows/deploy-template.yml with: platform: novacustom + vendor: ${{ matrix.vendor }} + model: ${{ matrix.model }} + artifact_name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}" secrets: inherit + strategy: + matrix: + vendor: [ novacustom ] + model: [ nv4x_adl, ns5x_adl ] + deploy_novacustom_tgl: + if: startsWith(github.ref, 'refs/tags/novacustom') && contains(github.ref, 'tgl') + needs: build_novacustom + uses: ./.github/workflows/deploy-template.yml + with: + platform: novacustom + vendor: ${{ matrix.vendor }} + model: ${{ matrix.model }} + artifact_name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}" + secrets: inherit + strategy: + matrix: + vendor: [ novacustom ] + model: [ nv4x_tgl, ns5x_tgl ] deploy_pcengines: if: startsWith(github.ref, 'refs/tags/pcengines') needs: build_pcengines @@ -372,22 +399,42 @@ jobs: vendor: ${{ matrix.vendor }} model: ${{ matrix.model }} payload: ${{ matrix.payload }} + artifact_name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}-${{ matrix.payload }}" secrets: inherit strategy: matrix: vendor: [ pcengines ] model: [ apu2, apu3, apu4, apu6 ] payload: [ uefi ] - deploy_msi: - if: startsWith(github.ref, 'refs/tags/msi') + deploy_msi_ms7d25: + if: startsWith(github.ref, 'refs/tags/msi_ms7d25') needs: build_msi uses: ./.github/workflows/deploy-template.yml with: platform: msi + vendor: ${{ matrix.vendor }} + model: "ms7d25" type: ${{ matrix.type }} + artifact_name: "dasharo-${{ matrix.vendor }}-ms7d25_${{ matrix.type }}" secrets: inherit strategy: matrix: + vendor: [ msi ] + type: [ ddr4, ddr5 ] + deploy_msi_ms7e06: + if: startsWith(github.ref, 'refs/tags/msi_ms7e06') + needs: build_msi + uses: ./.github/workflows/deploy-template.yml + with: + platform: msi + vendor: ${{ matrix.vendor }} + model: "ms7e06" + type: ${{ matrix.type }} + artifact_name: "dasharo-${{ matrix.vendor }}-ms7e06_${{ matrix.type }}" + secrets: inherit + strategy: + matrix: + vendor: [ msi ] type: [ ddr4, ddr5 ] deploy_hardkernel_odroid: if: startsWith(github.ref, 'refs/tags/hardkernel_odroid_h4') @@ -395,8 +442,9 @@ jobs: uses: ./.github/workflows/deploy-template.yml with: platform: hardkernel - vendor: ${{ matrix.vendor }} model: ${{ matrix.model }} + vendor: ${{ matrix.model }} + artifact_name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}" secrets: inherit strategy: matrix: diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index bc76d9aba5f..f0872b55bb6 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -16,6 +16,8 @@ on: type: type: string required: false + artifact_name: + type: string jobs: deploy: @@ -53,29 +55,10 @@ jobs: echo "model=$model" >> "$GITHUB_OUTPUT" echo "release=$release" >> "$GITHUB_OUTPUT" - - name: Parse artifact name - id: artifact_name - run: | - if [ "${{ inputs.platform }}" == "protectli" ]; then - echo "artifact_name=dasharo-${{ inputs.vendor }}-${{ inputs.model }}" >> "$GITHUB_OUTPUT" - elif [ "${{ inputs.platform }}" == "novacustom" ]; then - first_part=$(echo ${{ steps.tag_name.outputs.tag }} | cut -d "_" -f1) - second_part=$(echo ${{ steps.tag_name.outputs.tag }} | cut -d "_" -f2-3) - echo "artifact_name=dasharo-$first_part-$second_part" >> "$GITHUB_OUTPUT" - elif [ "${{ inputs.platform }}" == "pcengines" ]; then - echo "artifact_name=dasharo-${{ inputs.vendor }}-${{ inputs.model }}-${{ inputs.payload }}" >> "$GITHUB_OUTPUT" - elif [ "${{ inputs.platform }}" == "msi" ]; then - first_part=$(echo ${{ steps.tag_name.outputs.tag }} | cut -d "_" -f1) - second_part=$(echo ${{ steps.tag_name.outputs.tag }} | cut -d "_" -f2) - echo "artifact_name=dasharo-$first_part-${second_part}_${{ inputs.type }}" >> "$GITHUB_OUTPUT" - elif [ "${{ inputs.platform }}" == "hardkernel" ]; then - echo "artifact_name=dasharo-${{ inputs.vendor }}-${{ inputs.model }}" >> "$GITHUB_OUTPUT" - fi - - name: Download workflow artifact uses: actions/download-artifact@v4 with: - name: ${{ steps.artifact_name.outputs.artifact_name }} + name: ${{ inputs.artifact_name }} path: "./artifacts" - name: Upload to Nextcloud @@ -87,16 +70,19 @@ jobs: release="${{ steps.parse_directories.outputs.release }}" CURL_CMD="curl -u $url_part:${{ secrets.CLOUD_PASSWORD }}" - if [ "${{ inputs.platform }}" == "protectli" ]; then - new_name=$(echo "${{ inputs.vendor }}-${{ inputs.model }}-${release}.rom" | sed 's/-/_/g; s/.*/\L&/') - elif [ "${{ inputs.platform }}" == "novacustom" ]; then - new_name=$(echo "${model}_${release}.rom" | sed 's/-/_/g; s/.*/\L&/') - elif [ "${{ inputs.platform }}" == "pcengines" ]; then - new_name=$(echo "${{ inputs.vendor }}_${{ inputs.model }}_${{ inputs.payload }}_${release}.rom" | sed 's/.*/\L&/') - elif [ "${{ inputs.platform }}" == "msi" ]; then - new_name=$(echo "${model}_${{ inputs.type }}_${release}.rom" | sed 's/-/_/g; s/.*/\L&/') - elif [ "${{ inputs.platform }}" == "hardkernel" ]; then - new_name=$(echo "${{ inputs.vendor }}-${{ inputs.model }}_${release}.rom" | sed 's/-/_/g; s/.*/\L&/') + if [ "${{ inputs.platform }}" == "pcengines" ]; then + new_name="pcengines_${{ inputs.model }}_${release}.rom" + else + new_name="${{ inputs.model }}_${release}.rom" + if [ ! -z "${{ inputs.vendor }}" ]; then + new_name="${{ inputs.vendor }}_${new_name}" + fi + if [ ! -z "${{ inputs.payload }}" ]; then + new_name=$(echo "$new_name" | awk -F'_' '{OFS="_"; $NF="${{ inputs.payload }}_"$NF; print}') + fi + if [ ! -z "${{ inputs.type }}" ]; then + new_name=$(echo "${new_name%.rom}_${{ inputs.type }}.rom") + fi fi # Create release directory if it doesn't exist