From 5d89b496135a73815793b4816a329e8307545a42 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Sun, 6 Feb 2022 14:14:19 +0900 Subject: [PATCH] github: Attempt to add a new workflow for aarch64 --- .github/workflows/aarch64.yml | 29 +++++++++++++++++++++ .github/workflows/{build.yml => x86_64.yml} | 2 +- util/build-in-docker-aarch64.sh | 28 ++++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/aarch64.yml rename .github/workflows/{build.yml => x86_64.yml} (98%) create mode 100644 util/build-in-docker-aarch64.sh diff --git a/.github/workflows/aarch64.yml b/.github/workflows/aarch64.yml new file mode 100644 index 00000000..e7c8ed48 --- /dev/null +++ b/.github/workflows/aarch64.yml @@ -0,0 +1,29 @@ +on: [push, workflow_dispatch] +name: QEMU AArch64 virt +jobs: + build-image: + runs-on: ubuntu-20.04 + steps: + - name: Clone Repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Clone Kuroko + uses: actions/checkout@v2 + with: + repository: kuroko-lang/kuroko + path: kuroko + - name: Checkout Kuroko + run: git submodule update --init kuroko + - name: Pull Builder Image + run: docker pull toaruos/build-tools:aarch64 + - name: Run Builder + run: docker run -v ${GITHUB_WORKSPACE}:/root/misaka -w /root/misaka -e LANG=C.UTF-8 -t toaruos/build-tools:aarch64 util/build-in-docker-aarch64.sh + - name: Upload Branch Image + uses: actions/upload-artifact@v2 + with: + name: build + path: | + misaka-kernel + ramdisk.igz + bootstub diff --git a/.github/workflows/build.yml b/.github/workflows/x86_64.yml similarity index 98% rename from .github/workflows/build.yml rename to .github/workflows/x86_64.yml index f8cb4b4e..b01bbe41 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/x86_64.yml @@ -1,5 +1,5 @@ on: [push, workflow_dispatch] -name: Build Image +name: x86-64 CD Image jobs: build-image: runs-on: ubuntu-20.04 diff --git a/util/build-in-docker-aarch64.sh b/util/build-in-docker-aarch64.sh new file mode 100644 index 00000000..5fa5f5b9 --- /dev/null +++ b/util/build-in-docker-aarch64.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Give other users access to /root +# (We probably should have just built the build tools somewhere else...) +chmod o+x /root +chmod -R o+rw /root/gcc_local/bin + +# Who owns this directory? +NEWUID=`stat -c '%u' .` + +if [[ "$NEWUID" == "0" ]]; then + echo "Are you running this on Docker for Mac? Owner UID is 0, going to use 501 instead." + NEWUID=501 +fi + +# Create a fake user with this name +useradd -u $NEWUID local + +# Map the build tools +ln -s /root/gcc_local util/local + +# Run make as local +runuser -u local -- sh -c 'make ARCH=aarch64 base/lib/libc.so && make ARCH=aarch64 -j4' || exit 1 + +# Remove the build tools +rm util/local + +