Skip to content

Commit

Permalink
ci: support build images with HZ_12
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
  • Loading branch information
cp0613 authored and guoren83 committed Mar 26, 2024
1 parent 4ab753c commit bd3f106
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ jobs:
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:
Expand Down Expand Up @@ -74,6 +80,21 @@ jobs:
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: |
Expand Down Expand Up @@ -105,6 +126,7 @@ jobs:
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
Expand Down Expand Up @@ -137,6 +159,41 @@ jobs:
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+=-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+=-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+=-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+=-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:
Expand Down
3 changes: 3 additions & 0 deletions kernel/Kconfig.hz
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ choice
environment leading to NR_CPUS * HZ number of timer interrupts
per second.

config HZ_12
bool "12 HZ"

config HZ_100
bool "100 HZ"
Expand Down Expand Up @@ -50,6 +52,7 @@ endchoice

config HZ
int
default 12 if HZ_12
default 100 if HZ_100
default 250 if HZ_250
default 300 if HZ_300
Expand Down

0 comments on commit bd3f106

Please sign in to comment.