Skip to content

feat: update new kernel #7

feat: update new kernel

feat: update new kernel #7

name: Build Ubuntu 24 ARM Image
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-image:
runs-on: ubuntu-24.04
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
cd /output
wget https://cdimage.ubuntu.com/ubuntu-base/releases/24.10/release/ubuntu-base-24.10-base-arm64.tar.gz
# Create a temporary directory for extraction
mkdir -p temp_rootfs
# Extract with --no-overwrite-dir to handle existing symlinks
tar --no-overwrite-dir -xpf ubuntu-base-24.10-base-arm64.tar.gz -C temp_rootfs
# Move contents to final rootfs directory
cp -a temp_rootfs/. /output/rootfs/
# Clean up
rm -rf temp_rootfs
rm ubuntu-base-24.10-base-arm64.tar.gz
"
- 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 --privileged --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
"
- name: Compress Image
run: |
docker run --rm -v ${{ github.workspace }}/output:/output ubuntu-arm-builder /bin/bash -c "
cd /output
gzip ubuntu-24-arm.img
"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ubuntu-24-arm-image
path: ${{ github.workspace }}/output/ubuntu-24-arm.img.gz
if-no-files-found: error