ci: exclude c920 for ci for now #67
Workflow file for this run
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: xuantie-kernel-ci | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 2 * * *" | |
env: | |
xt64_toolchain: https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1705395627867 | |
xt64_toolchain_file_name: Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.8.1-20240115.tar.gz | |
rv32_toolchain: https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2024.04.12 | |
rv32_toolchain_file_name: riscv32-glibc-ubuntu-22.04-gcc-nightly-2024.04.12-nightly.tar.gz | |
rv64_toolchain: https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2024.04.12 | |
rv64_toolchain_file_name: riscv64-glibc-ubuntu-22.04-gcc-nightly-2024.04.12-nightly.tar.gz | |
rv64ilp32_toolchain: https://github.com/ruyisdk/riscv-gnu-toolchain-rv64ilp32/releases/download/2024.03.08 | |
rv64ilp32_toolchain_file_name: riscv64ilp32-elf-ubuntu-22.04-gcc-nightly-2024.03.08-nightly.tar.gz | |
jobs: | |
kernel-build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: linux-32ilp32 | |
toolchain_tripe: riscv32-unknown-linux-gnu- | |
- name: linux-64lp64 | |
toolchain_tripe: riscv64-unknown-linux-gnu- | |
- name: linux-64ilp32 | |
toolchain_tripe: riscv64-unknown-elf- | |
- name: linux-64lp64-dirty | |
toolchain_tripe: riscv64-unknown-linux-gnu- | |
- name: linux-32ilp32-dirty | |
toolchain_tripe: riscv32-unknown-linux-gnu- | |
# - name: linux-64ilp32_12hz | |
# toolchain_tripe: riscv64-unknown-elf- | |
# - name: linux-64lp64-dirty_12hz | |
# toolchain_tripe: riscv64-unknown-linux-gnu- | |
# - name: linux-32ilp32-dirty_12hz | |
# toolchain_tripe: riscv32-unknown-linux-gnu- | |
runs-on: ubuntu-22.04 | |
env: | |
CROSS_COMPILE: ${{ matrix.toolchain_tripe }} | |
steps: | |
- name: Install software | |
run: | | |
sudo apt update && \ | |
sudo apt install -y build-essential | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Configure toolchains | |
run: | | |
if [ x"${{ matrix.name }}" = x"linux-32ilp32" ]; then | |
wget ${rv32_toolchain}/${rv32_toolchain_file_name} | |
tar -xvf ${rv32_toolchain_file_name} -C /opt | |
rm -v ${rv32_toolchain_file_name} | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-64lp64" ]; then | |
wget ${rv64_toolchain}/${rv64_toolchain_file_name} | |
tar -xvf ${rv64_toolchain_file_name} -C /opt | |
rm -v ${rv64_toolchain_file_name} | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-64ilp32" ]; then | |
wget ${rv64ilp32_toolchain}/${rv64ilp32_toolchain_file_name} | |
tar -xvf ${rv64ilp32_toolchain_file_name} -C /opt | |
rm -v ${rv64ilp32_toolchain_file_name} | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-64lp64-dirty" ]; then | |
wget ${rv64_toolchain}/${rv64_toolchain_file_name} | |
tar -xvf ${rv64_toolchain_file_name} -C /opt | |
rm -v ${rv64_toolchain_file_name} | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-32ilp32-dirty" ]; then | |
wget ${rv32_toolchain}/${rv32_toolchain_file_name} | |
tar -xvf ${rv32_toolchain_file_name} -C /opt | |
rm -v ${rv32_toolchain_file_name} | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-64ilp32_12hz" ]; then | |
wget ${rv64ilp32_toolchain}/${rv64ilp32_toolchain_file_name} | |
tar -xvf ${rv64ilp32_toolchain_file_name} -C /opt | |
rm -v ${rv64ilp32_toolchain_file_name} | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-64lp64-dirty_12hz" ]; then | |
wget ${rv64_toolchain}/${rv64_toolchain_file_name} | |
tar -xvf ${rv64_toolchain_file_name} -C /opt | |
rm -v ${rv64_toolchain_file_name} | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-32ilp32-dirty_12hz" ]; then | |
wget ${rv32_toolchain}/${rv32_toolchain_file_name} | |
tar -xvf ${rv32_toolchain_file_name} -C /opt | |
rm -v ${rv32_toolchain_file_name} | |
fi | |
- name: Compile | |
run: | | |
if [ x"${{ matrix.name }}" = x"linux-32ilp32" ]; then | |
export PATH="/opt/riscv/bin:$PATH" | |
wget https://github.com/torvalds/linux/archive/ffc253263a1375a65fa6c9f62a893e9767fbebfa.tar.gz | |
tar zxf ffc253263a1375a65fa6c9f62a893e9767fbebfa.tar.gz | |
mv linux-ffc253263a1375a65fa6c9f62a893e9767fbebfa linux-6.6 | |
cp arch/riscv/configs/defconfig linux-6.6/arch/riscv/configs/defconfig | |
cd linux-6.6 | |
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc) | |
mv arch/riscv/boot/Image ./ | |
cp Documentation/admin-guide/kdump/gdbmacros.txt ./ | |
tar czvf ${{ matrix.name }}.tar.gz Image vmlinux modules_install headers_install gdbmacros.txt | |
mv ${{ matrix.name }}.tar.gz ../ | |
cd .. | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-64lp64" ]; then | |
export PATH="/opt/riscv/bin:$PATH" | |
wget https://github.com/torvalds/linux/archive/ffc253263a1375a65fa6c9f62a893e9767fbebfa.tar.gz | |
tar zxf ffc253263a1375a65fa6c9f62a893e9767fbebfa.tar.gz | |
mv linux-ffc253263a1375a65fa6c9f62a893e9767fbebfa linux-6.6 | |
cp arch/riscv/configs/defconfig linux-6.6/arch/riscv/configs/defconfig | |
cd linux-6.6 | |
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc) | |
mv arch/riscv/boot/Image ./ | |
cp Documentation/admin-guide/kdump/gdbmacros.txt ./ | |
tar czvf ${{ matrix.name }}.tar.gz Image vmlinux modules_install headers_install gdbmacros.txt | |
mv ${{ matrix.name }}.tar.gz ../ | |
cd .. | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-64ilp32" ]; then | |
export PATH="/opt/riscv/bin:$PATH" | |
echo CONFIG_MMU_SV32=y >> arch/riscv/configs/64ilp32.config | |
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv64ilp32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc) | |
mv arch/riscv/boot/Image ./Image_sv32xt | |
mv vmlinux vmlinux_sv32xt | |
mv headers_install headers_install_sv32xt | |
mv modules_install modules_install_sv32xt | |
git checkout arch/riscv/configs/64ilp32.config | |
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv64ilp32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc) | |
mv arch/riscv/boot/Image ./ | |
cp Documentation/admin-guide/kdump/gdbmacros.txt ./ | |
git log --oneline -500 > git.log | |
tar czvf ${{ matrix.name }}.tar.gz Image vmlinux modules_install headers_install Image_sv32xt vmlinux_sv32xt modules_install_sv32xt headers_install_sv32xt git.log gdbmacros.txt | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-64lp64-dirty" ]; then | |
export PATH="/opt/riscv/bin:$PATH" | |
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc) | |
mv arch/riscv/boot/Image ./ | |
cp Documentation/admin-guide/kdump/gdbmacros.txt ./ | |
git log --oneline -500 > git.log | |
tar czvf ${{ matrix.name }}.tar.gz Image vmlinux git.log modules_install headers_install gdbmacros.txt | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-32ilp32-dirty" ]; then | |
export PATH="/opt/riscv/bin:$PATH" | |
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc) | |
mv arch/riscv/boot/Image ./ | |
cp Documentation/admin-guide/kdump/gdbmacros.txt ./ | |
git log --oneline -500 > git.log | |
tar czvf ${{ matrix.name }}.tar.gz Image vmlinux git.log modules_install headers_install gdbmacros.txt | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-64ilp32_12hz" ]; then | |
export PATH="/opt/riscv/bin:$PATH" | |
echo CONFIG_HZ_12=y >> arch/riscv/configs/defconfig | |
echo CONFIG_MMU_SV32=y >> arch/riscv/configs/64ilp32.config | |
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv64ilp32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc) | |
mv arch/riscv/boot/Image ./Image_sv32xt | |
mv vmlinux vmlinux_sv32xt | |
mv headers_install headers_install_sv32xt | |
mv modules_install modules_install_sv32xt | |
git checkout arch/riscv/configs/64ilp32.config | |
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv64ilp32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc) | |
mv arch/riscv/boot/Image ./ | |
cp Documentation/admin-guide/kdump/gdbmacros.txt ./ | |
git log --oneline -500 > git.log | |
tar czvf ${{ matrix.name }}.tar.gz Image vmlinux modules_install headers_install Image_sv32xt vmlinux_sv32xt modules_install_sv32xt headers_install_sv32xt git.log gdbmacros.txt | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-64lp64-dirty_12hz" ]; then | |
export PATH="/opt/riscv/bin:$PATH" | |
echo CONFIG_HZ_12=y >> arch/riscv/configs/defconfig | |
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc) | |
mv arch/riscv/boot/Image ./ | |
cp Documentation/admin-guide/kdump/gdbmacros.txt ./ | |
git log --oneline -500 > git.log | |
tar czvf ${{ matrix.name }}.tar.gz Image vmlinux git.log modules_install headers_install gdbmacros.txt | |
fi | |
if [ x"${{ matrix.name }}" = x"linux-32ilp32-dirty_12hz" ]; then | |
export PATH="/opt/riscv/bin:$PATH" | |
echo CONFIG_HZ_12=y >> arch/riscv/configs/defconfig | |
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc) | |
mv arch/riscv/boot/Image ./ | |
cp Documentation/admin-guide/kdump/gdbmacros.txt ./ | |
git log --oneline -500 > git.log | |
tar czvf ${{ matrix.name }}.tar.gz Image vmlinux git.log modules_install headers_install gdbmacros.txt | |
fi | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.name }}.tar.gz | |
path: ${{ matrix.name }}.tar.gz | |
retention-days: 90 | |
qemu-boot-64lp64: | |
needs: kernel-build | |
runs-on: ubuntu-latest | |
container: ghcr.io/ruyisdk/linux-xuantie-kernel/xuantie-qemu:latest | |
strategy: | |
fail-fast: false | |
matrix: | |
cpu: [ c906fdv , c907fdvm-rv64 , c908v , c920 , c920v2] | |
kernel: [ linux-64lp64 , linux-64lp64-dirty ] | |
exclude: | |
- cpu: c920 | |
kernel: linux-64lp64-dirty | |
include: | |
- core_count: 4 | |
- cpu: c906fdv | |
core_count: 1 | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ matrix.kernel }}.tar.gz | |
- name: Download rootfs | |
run: | | |
wget -qc https://github.com/c-sky/buildroot/releases/download/v1.0.11/920v2_images.tar.gz | |
tar -xvf 920v2_images.tar.gz | |
tar -xvf ${{ matrix.kernel }}.tar.gz | |
- name: Run Qemu | |
run: | | |
qemu-system-riscv64 -cpu ${{ matrix.cpu }} -nographic -smp ${{ matrix.core_count }} -M virt -kernel ./Image -append 'rootwait root=/dev/vda ro' -drive file=./images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -monitor none -serial file:qemu_boot.log & | |
QEMU_PID=$! | |
sleep 180 | |
kill -9 $QEMU_PID | |
- name: Check Boot Success | |
run: | | |
cat qemu_boot.log | |
grep -q "login:" qemu_boot.log |