chore: update fix build #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Ubuntu 24 ARM Image | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Build Docker Image | |
run: | | |
docker build -t ubuntu-arm-builder . | |
- name: Clone and Configure Kernel | |
run: | | |
docker run --rm -v ${{ github.workspace }}/output:/output ubuntu-arm-builder /bin/bash -c " | |
cd /output | |
git clone --depth 1 --branch v6.13 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git | |
cd linux | |
cp /build/kernel-config .config | |
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- olddefconfig | |
" | |
- name: Build Kernel | |
run: | | |
docker run --rm -v ${{ github.workspace }}/output:/output ubuntu-arm-builder /bin/bash -c " | |
cd /output/linux | |
make -j$(nproc) ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- | |
" | |
- name: Install Kernel Modules | |
run: | | |
docker run --rm -v ${{ github.workspace }}/output:/output ubuntu-arm-builder /bin/bash -c " | |
cd /output/linux | |
make -j$(nproc) ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_install INSTALL_MOD_PATH=/output/rootfs | |
" | |
- name: Install Kernel | |
run: | | |
docker run --rm -v ${{ github.workspace }}/output:/output ubuntu-arm-builder /bin/bash -c " | |
cd /output/linux | |
make -j$(nproc) ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_PATH=/output/rootfs/boot install | |
" | |
- name: Setup Ubuntu Root Filesystem | |
run: | | |
docker run --rm -v ${{ github.workspace }}/output:/output ubuntu-arm-builder /bin/bash -c " | |
mkdir -p /output/rootfs | |
wget https://cdimage.ubuntu.com/ubuntu-base/releases/24.10/release/ubuntu-base-24.10-base-arm64.tar.gz | |
tar -xpf ubuntu-base-24.10-base-arm64.tar.gz -C /output/rootfs | |
" | |
- name: Create and Format Image | |
run: | | |
docker run --rm -v ${{ github.workspace }}/output:/output ubuntu-arm-builder /bin/bash -c " | |
cd /output | |
qemu-img create -f raw ubuntu-24-arm.img 2G | |
mkfs.ext4 -F ubuntu-24-arm.img | |
" | |
- name: Mount and Copy Root Filesystem | |
run: | | |
docker run --rm -v ${{ github.workspace }}/output:/output ubuntu-arm-builder /bin/bash -c " | |
mkdir -p /mnt/rootfs | |
mount -o loop /output/ubuntu-24-arm.img /mnt/rootfs | |
cp -r /output/rootfs/* /mnt/rootfs/ | |
umount /mnt/rootfs | |
" |