From ae7483704a231645be1a1124a759b07a0ab97767 Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Thu, 3 Feb 2022 21:34:09 +0000 Subject: [PATCH] Added workflow to add pi2 image --- .github/workflows/crankshaft.yml | 126 ++++++++++++++++++++++++---- stage3/03-crankshaft-base/00-run.sh | 2 +- stage3/EXPORT_IMAGE | 2 +- stage4/01-armv7-fixes/00-run.sh | 8 ++ stage4/EXPORT_IMAGE | 4 + stage4/EXPORT_NOOBS | 2 + stage4/files/qt5/.gitignore | 0 7 files changed, 128 insertions(+), 16 deletions(-) create mode 100644 stage4/01-armv7-fixes/00-run.sh create mode 100644 stage4/EXPORT_IMAGE create mode 100644 stage4/EXPORT_NOOBS create mode 100644 stage4/files/qt5/.gitignore diff --git a/.github/workflows/crankshaft.yml b/.github/workflows/crankshaft.yml index 568797cf..98a9622a 100644 --- a/.github/workflows/crankshaft.yml +++ b/.github/workflows/crankshaft.yml @@ -23,6 +23,14 @@ jobs: sha1_filename: ${{ steps.get-artifact-name.outputs.sha1_filename }} sha256_path: ${{ steps.get-artifact-name.outputs.sha256_path }} sha256_filename: ${{ steps.get-artifact-name.outputs.sha256_filename }} + pi2_artifact_path: ${{ steps.get-artifact-name.outputs.artifact_path }} + pi2_artifact_filename: ${{ steps.get-artifact-name-pi2.outputs.artifact_filename }} + pi2_md5_path: ${{ steps.get-artifact-name-pi2.outputs.md5_path }} + pi2_md5_filename: ${{ steps.get-artifact-name-pi2.outputs.md5_filename }} + pi2_sha1_path: ${{ steps.get-artifact-name-pi2.outputs.sha1_path }} + pi2_sha1_filename: ${{ steps.get-artifact-name-pi2.outputs.sha1_filename }} + pi2_sha256_path: ${{ steps.get-artifact-name-pi2.outputs.sha256_path }} + pi2_sha256_filename: ${{ steps.get-artifact-name-pi2.outputs.sha256_filename }} version: ${{ steps.get_version.outputs.version }} builddate: ${{ steps.get_version.outputs.builddate }} steps: @@ -89,20 +97,41 @@ jobs: id: get-artifact-name run: | ls -hla - ARTIFACT_PATHNAME=$(ls ./deploy/*.zip | head -n 1) + ARTIFACT_PATHNAME=$(ls -d -- deploy/*[!-pi2].zip | head -n 1) ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME) + MD5_PATHNAME=$(ls -d -- deploy/*[!-pi2].md5 | head -n 1) + MD5_NAME=$(basename $MD5_PATHNAME) + SHA1_PATHNAME=$(ls -d -- deploy/*[!-pi2].sha1 | head -n 1) + SHA1_NAME=$(basename $SHA1_PATHNAME) + SHA256_PATHNAME=$(ls -d -- deploy/*[!-pi2].sha256 | head -n 1) + SHA256_NAME=$(basename $SHA256_PATHNAME) echo ::set-output name=artifact_filename::${ARTIFACT_NAME} echo ::set-output name=artifact_path::${ARTIFACT_PATHNAME} - MD5_PATHNAME=$(ls ./deploy/*.md5 | head -n 1) - MD5_NAME=$(basename $MD5_PATHNAME) echo ::set-output name=md5_filename::${MD5_NAME} echo ::set-output name=md5_path::${MD5_PATHNAME} - SHA1_PATHNAME=$(ls ./deploy/*.sha1 | head -n 1) - SHA1_NAME=$(basename $SHA1_PATHNAME) echo ::set-output name=sha1_filename::${SHA1_NAME} echo ::set-output name=sha1_path::${SHA1_PATHNAME} - SHA256_PATHNAME=$(ls ./deploy/*.sha256 | head -n 1) + echo ::set-output name=sha256_filename::${SHA256_NAME} + echo ::set-output name=sha256_path::${SHA256_PATHNAME} + - + name: Get Name of Artifact - pi2 + id: get-artifact-name-pi2 + run: | + ls -hla + ARTIFACT_PATHNAME=$(ls -d -- deploy/*[-pi2].zip | head -n 1) + ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME) + MD5_PATHNAME=$(ls -d -- deploy/*[-pi2].md5 | head -n 1) + MD5_NAME=$(basename $MD5_PATHNAME) + SHA1_PATHNAME=$(ls -d -- deploy/*[-pi2].sha1 | head -n 1) + SHA1_NAME=$(basename $SHA1_PATHNAME) + SHA256_PATHNAME=$(ls -d -- deploy/*[-pi2].sha256 | head -n 1) SHA256_NAME=$(basename $SHA256_PATHNAME) + echo ::set-output name=artifact_filename::${ARTIFACT_NAME} + echo ::set-output name=artifact_path::${ARTIFACT_PATHNAME} + echo ::set-output name=md5_filename::${MD5_NAME} + echo ::set-output name=md5_path::${MD5_PATHNAME} + echo ::set-output name=sha1_filename::${SHA1_NAME} + echo ::set-output name=sha1_path::${SHA1_PATHNAME} echo ::set-output name=sha256_filename::${SHA256_NAME} echo ::set-output name=sha256_path::${SHA256_PATHNAME} - @@ -116,6 +145,10 @@ jobs: ${{ steps.get-artifact-name.outputs.md5_path }} ${{ steps.get-artifact-name.outputs.sha1_path }} ${{ steps.get-artifact-name.outputs.sha256_path }} + ${{ steps.get-artifact-name-pi2.outputs.artifact_path }} + ${{ steps.get-artifact-name-pi2.outputs.md5_path }} + ${{ steps.get-artifact-name-pi2.outputs.sha1_path }} + ${{ steps.get-artifact-name-pi2.outputs.sha256_path }} ./pi-gen/deploy/build.log release: name: Create release @@ -145,20 +178,41 @@ jobs: id: get-artifact-name run: | ls -hla - ARTIFACT_PATHNAME=$(ls deploy/*.zip | head -n 1) + ARTIFACT_PATHNAME=$(ls -d -- deploy/*[!-pi2].zip | head -n 1) ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME) + MD5_PATHNAME=$(ls -d -- deploy/*[!-pi2].md5 | head -n 1) + MD5_NAME=$(basename $MD5_PATHNAME) + SHA1_PATHNAME=$(ls -d -- deploy/*[!-pi2].sha1 | head -n 1) + SHA1_NAME=$(basename $SHA1_PATHNAME) + SHA256_PATHNAME=$(ls -d -- deploy/*[!-pi2].sha256 | head -n 1) + SHA256_NAME=$(basename $SHA256_PATHNAME) echo ::set-output name=artifact_filename::${ARTIFACT_NAME} echo ::set-output name=artifact_path::${ARTIFACT_PATHNAME} - MD5_PATHNAME=$(ls deploy/*.md5 | head -n 1) - MD5_NAME=$(basename $MD5_PATHNAME) echo ::set-output name=md5_filename::${MD5_NAME} echo ::set-output name=md5_path::${MD5_PATHNAME} - SHA1_PATHNAME=$(ls deploy/*.sha1 | head -n 1) - SHA1_NAME=$(basename $SHA1_PATHNAME) echo ::set-output name=sha1_filename::${SHA1_NAME} echo ::set-output name=sha1_path::${SHA1_PATHNAME} - SHA256_PATHNAME=$(ls deploy/*.sha256 | head -n 1) + echo ::set-output name=sha256_filename::${SHA256_NAME} + echo ::set-output name=sha256_path::${SHA256_PATHNAME} + - + name: Get Name of Artifact - pi2 + id: get-artifact-name-pi2 + run: | + ls -hla + ARTIFACT_PATHNAME=$(ls -d -- deploy/*[-pi2].zip | head -n 1) + ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME) + MD5_PATHNAME=$(ls -d -- deploy/*[-pi2].md5 | head -n 1) + MD5_NAME=$(basename $MD5_PATHNAME) + SHA1_PATHNAME=$(ls -d -- deploy/*[-pi2].sha1 | head -n 1) + SHA1_NAME=$(basename $SHA1_PATHNAME) + SHA256_PATHNAME=$(ls -d -- deploy/*[-pi2].sha256 | head -n 1) SHA256_NAME=$(basename $SHA256_PATHNAME) + echo ::set-output name=artifact_filename::${ARTIFACT_NAME} + echo ::set-output name=artifact_path::${ARTIFACT_PATHNAME} + echo ::set-output name=md5_filename::${MD5_NAME} + echo ::set-output name=md5_path::${MD5_PATHNAME} + echo ::set-output name=sha1_filename::${SHA1_NAME} + echo ::set-output name=sha1_path::${SHA1_PATHNAME} echo ::set-output name=sha256_filename::${SHA256_NAME} echo ::set-output name=sha256_path::${SHA256_PATHNAME} - @@ -172,9 +226,20 @@ jobs: asset_path: ${{ steps.get-artifact-name.outputs.artifact_path }} asset_name: ${{ steps.get-artifact-name.outputs.artifact_filename }} asset_content_type: application/zip + - + name: Upload Release Asset -pi2 + id: upload-release-asset-pi2 + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ${{ steps.get-artifact-name-pi2.outputs.artifact_path }} + asset_name: ${{ steps.get-artifact-name-pi2.outputs.artifact_filename }} + asset_content_type: application/zip - name: Upload Release MD5 - id: upload-release-md5 + id: upload-release-md5 uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -183,6 +248,17 @@ jobs: asset_path: ${{ steps.get-artifact-name.outputs.md5_path }} asset_name: ${{ steps.get-artifact-name.outputs.md5_filename }} asset_content_type: text/plain + - + name: Upload Release MD5 -pi2 + id: upload-release-md5-pi2 + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ${{ steps.get-artifact-name-pi2.outputs.md5_path }} + asset_name: ${{ steps.get-artifact-name-pi2.outputs.md5_filename }} + asset_content_type: text/plain - name: Upload Release SHA1 id: upload-release-sha1 @@ -194,9 +270,20 @@ jobs: asset_path: ${{ steps.get-artifact-name.outputs.sha1_path }} asset_name: ${{ steps.get-artifact-name.outputs.sha1_filename }} asset_content_type: text/plain + - + name: Upload Release SHA1 -pi2 + id: upload-release-sha1-pi2 + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ${{ steps.get-artifact-name-pi2.outputs.sha1_path }} + asset_name: ${{ steps.get-artifact-name-pi2.outputs.sha1_filename }} + asset_content_type: text/plain - name: Upload Release SHA256 - id: upload-release-SHA256 + id: upload-release-SHA256 uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -205,3 +292,14 @@ jobs: asset_path: ${{ steps.get-artifact-name.outputs.sha256_path }} asset_name: ${{ steps.get-artifact-name.outputs.sha256_filename }} asset_content_type: text/plain + - + name: Upload Release SHA256 -pi2 + id: upload-release-SHA256-pi2 + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ${{ steps.get-artifact-name-pi2.outputs.sha256_path }} + asset_name: ${{ steps.get-artifact-name-pi2.outputs.sha256_filename }} + asset_content_type: text/plain diff --git a/stage3/03-crankshaft-base/00-run.sh b/stage3/03-crankshaft-base/00-run.sh index 77d0fa2c..a3243d72 100755 --- a/stage3/03-crankshaft-base/00-run.sh +++ b/stage3/03-crankshaft-base/00-run.sh @@ -79,4 +79,4 @@ chmod 644 files/usr/local/bin/usbreset.md5 # qt5 rm -rf files/qt5/Qt5_OpenGLES2.tar.xz -cat $BASE_DIR/prebuilts/qt5/Qt_5151_armv7l_OpenGLES2.tar.xz* > files/qt5/Qt5_OpenGLES2.tar.xz +cat $BASE_DIR/prebuilts/qt5/Qt_5151_OpenGLES2.tar.xz* > files/qt5/Qt5_OpenGLES2.tar.xz diff --git a/stage3/EXPORT_IMAGE b/stage3/EXPORT_IMAGE index 79ec11a3..6c8ec421 100644 --- a/stage3/EXPORT_IMAGE +++ b/stage3/EXPORT_IMAGE @@ -1,4 +1,4 @@ -IMG_SUFFIX="" +IMG_SUFFIX="-pi2" if [ "${USE_QEMU}" = "1" ]; then export IMG_SUFFIX="${IMG_SUFFIX}-qemu" fi diff --git a/stage4/01-armv7-fixes/00-run.sh b/stage4/01-armv7-fixes/00-run.sh new file mode 100644 index 00000000..b53a80b5 --- /dev/null +++ b/stage4/01-armv7-fixes/00-run.sh @@ -0,0 +1,8 @@ +#!/bin/bash -e + +# qt5 from prebuilts +rm -rf files/qt5/Qt5_OpenGLES2.tar.xz +cat $BASE_DIR/prebuilts/qt5/Qt_5151_armv7l_OpenGLES2.tar.xz* > files/qt5/Qt5_OpenGLES2.tar.xz + +#qt5 +tar -xf files/qt5/Qt5_OpenGLES2.tar.xz -C ${ROOTFS_DIR}/ \ No newline at end of file diff --git a/stage4/EXPORT_IMAGE b/stage4/EXPORT_IMAGE new file mode 100644 index 00000000..79ec11a3 --- /dev/null +++ b/stage4/EXPORT_IMAGE @@ -0,0 +1,4 @@ +IMG_SUFFIX="" +if [ "${USE_QEMU}" = "1" ]; then + export IMG_SUFFIX="${IMG_SUFFIX}-qemu" +fi diff --git a/stage4/EXPORT_NOOBS b/stage4/EXPORT_NOOBS new file mode 100644 index 00000000..b7fe4eee --- /dev/null +++ b/stage4/EXPORT_NOOBS @@ -0,0 +1,2 @@ +NOOBS_NAME="Crankshaft pi2" +NOOBS_DESCRIPTION="A turnkey GNU/Linux solution that transforms a Raspberry Pi to an Android Auto head unit" diff --git a/stage4/files/qt5/.gitignore b/stage4/files/qt5/.gitignore new file mode 100644 index 00000000..e69de29b