Skip to content

Commit 93ed1d7

Browse files
Xeonacidslp
andcommitted
Add riscv64 support
Co-authored-by: Sergio Lopez <[email protected]> Signed-off-by: Xeonacid <[email protected]>
1 parent cb36155 commit 93ed1d7

File tree

4 files changed

+3230
-1
lines changed

4 files changed

+3230
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Cross-build riscv64 kernel
2+
on: [pull_request, create]
3+
4+
jobs:
5+
build:
6+
if: github.event_name == 'pull_request'
7+
name: Cross-build riscv64 kernel
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Code checkout
11+
uses: actions/checkout@v2
12+
13+
- name: Install dependencies
14+
run: sudo apt-get install -y make gcc bc bison flex elfutils python3-pyelftools curl patch libelf-dev gcc-riscv64-linux-gnu
15+
16+
- name: Build riscv64 kernel
17+
run: make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__pycache__
22
*.pyc
33
*~
4-
libkrunfw.so
4+
libkrunfw.so*
55
kernel.c
66
vmlinux
77
/tarballs

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ else ifeq ($(ARCH),arm64)
2727
GUESTARCH := aarch64
2828
CC := $(CROSS_COMPILE)gcc
2929
STRIP := $(CROSS_COMPILE)strip
30+
else ifeq ($(ARCH),riscv)
31+
GUESTARCH := riscv64
32+
CC := $(CROSS_COMPILE)gcc
33+
STRIP := $(CROSS_COMPILE)strip
3034
else
3135
GUESTARCH := $(ARCH)
3236
CC := $(CROSS_COMPILE)gcc
@@ -35,9 +39,11 @@ endif
3539

3640
KBUNDLE_TYPE_x86_64 = vmlinux
3741
KBUNDLE_TYPE_aarch64 = Image
42+
KBUNDLE_TYPE_riscv64 = Image
3843

3944
KERNEL_BINARY_x86_64 = $(KERNEL_SOURCES)/vmlinux
4045
KERNEL_BINARY_aarch64 = $(KERNEL_SOURCES)/arch/arm64/boot/Image
46+
KERNEL_BINARY_riscv64 = $(KERNEL_SOURCES)/arch/riscv/boot/Image
4147

4248
KRUNFW_BINARY_Linux = libkrunfw$(VARIANT).so.$(FULL_VERSION)
4349
KRUNFW_SONAME_Linux = libkrunfw$(VARIANT).so.$(ABI_VERSION)

0 commit comments

Comments
 (0)