|
| 1 | +name: uefi-only-build |
| 2 | + |
| 3 | +# Controls when the action will run. |
| 4 | +on: |
| 5 | + # Triggers the workflow only on pull-requests when this file is changed. |
| 6 | + # Intended use is to manually trigger runs after updating the repository |
| 7 | + # variables `UEFI_DATE`, `UEFI_LINUX_TAG` or `UEFI_UBOOT_TAG`. |
| 8 | + pull_request: |
| 9 | + branches: [ main ] |
| 10 | + paths: [ .github/workflows/uefi-only-build.yaml ] |
| 11 | + |
| 12 | + # Allows you to run this workflow manually from the Actions tab |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +jobs: |
| 16 | + uefi-only-boot-bin: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + |
| 19 | + env: |
| 20 | + UEFI_ONLY_VERSION: uefi-only-${{ vars.UEFI_DATE }}-${{ vars.UEFI_LINUX_TAG }} |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v5 |
| 25 | + with: |
| 26 | + submodules: recursive |
| 27 | + |
| 28 | + - name: Checkout linux |
| 29 | + uses: actions/checkout@v5 |
| 30 | + with: |
| 31 | + repository: AsahiLinux/linux |
| 32 | + ref: ${{ vars.UEFI_LINUX_TAG }} |
| 33 | + path: linux |
| 34 | + sparse-checkout: 'arch/arm64/boot/dts/apple/' |
| 35 | + |
| 36 | + - name: Checkout u-boot |
| 37 | + uses: actions/checkout@v5 |
| 38 | + with: |
| 39 | + repository: AsahiLinux/u-boot |
| 40 | + ref: ${{ vars.UEFI_UBOOT_TAG }} |
| 41 | + path: u-boot |
| 42 | + |
| 43 | + - name: Install aarch64-linux-gnu- toolchain |
| 44 | + run: | |
| 45 | + sudo apt-get update |
| 46 | + sudo apt-get install --no-install-recommends -y \ |
| 47 | + gcc-aarch64-linux-gnu \ |
| 48 | + libgnutls28-dev \ |
| 49 | + device-tree-compiler |
| 50 | +
|
| 51 | + - name: Install aarch64-unknown-none-softfloat rust target |
| 52 | + run: | |
| 53 | + rustup target install aarch64-unknown-none-softfloat |
| 54 | +
|
| 55 | + - name: Build |
| 56 | + run: | |
| 57 | + cd m1n1 |
| 58 | + make -k -j2 ARCH=aarch64-linux-gnu- RELEASE=1 |
| 59 | +
|
| 60 | + - name: Update u-boot apple device trees |
| 61 | + run: | |
| 62 | + cp -f linux/arch/arm64/boot/dts/apple/*.dts \ |
| 63 | + linux/arch/arm64/boot/dts/apple/*.dtsi \ |
| 64 | + linux/arch/arm64/boot/dts/apple/*.h \ |
| 65 | + u-boot/arch/arm/dts/ |
| 66 | +
|
| 67 | + - name: Build u-boot |
| 68 | + run: | |
| 69 | + cd u-boot |
| 70 | + make CROSS_COMPILE=aarch64-linux-gnu- apple_m1_defconfig |
| 71 | + make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm -k -j2 |
| 72 | +
|
| 73 | + - name: Create m1n1 uefi only boot.bin |
| 74 | + run: | |
| 75 | + mkdir -p out/esp/m1n1/ |
| 76 | + gzip -k u-boot/u-boot-nodtb.bin |
| 77 | + cat m1n1/build/m1n1.bin \ |
| 78 | + u-boot/arch/arm/dts/t60*.dtb \ |
| 79 | + u-boot/arch/arm/dts/t81*.dtb \ |
| 80 | + u-boot/u-boot-nodtb.bin.gz \ |
| 81 | + > out/esp/m1n1/boot.bin |
| 82 | + cd out |
| 83 | + zip -r ${{ env.UEFI_ONLY_VERSION }}.zip esp |
| 84 | +
|
| 85 | + - uses: actions/upload-artifact@v4 |
| 86 | + with: |
| 87 | + name: uefi-only-boot.bin |
| 88 | + path: | |
| 89 | + out/${{ env.UEFI_ONLY_VERSION }}.zip |
0 commit comments