diff --git a/README.txt b/README.txt index 3b4e70e..b84d28b 100644 --- a/README.txt +++ b/README.txt @@ -14,6 +14,7 @@ Required parameters: * ppc32 * ppc64 * ppc64le + * riscv * x86 * x86_64 diff --git a/boot-qemu.sh b/boot-qemu.sh index a639b0b..9f951b7 100755 --- a/boot-qemu.sh +++ b/boot-qemu.sh @@ -29,7 +29,7 @@ function parse_parameters() { -a | --arch | --architecture) shift case ${1} in - arm32_v5 | arm32_v6 | arm32_v7 | arm64 | mips | mipsel | ppc32 | ppc64 | ppc64le | x86 | x86_64) ARCH=${1} ;; + arm32_v5 | arm32_v6 | arm32_v7 | arm64 | mips | mipsel | ppc32 | ppc64 | ppc64le | riscv | x86 | x86_64) ARCH=${1} ;; *) die "Invalid --arch value '${1}'" ;; esac ;; @@ -186,6 +186,17 @@ function setup_qemu_args() { QEMU=(qemu-system-ppc64) ;; + riscv) + KIMAGE=Image + DEB_BIOS=/usr/lib/riscv64-linux-gnu/opensbi/qemu/virt/fw_jump.elf + [[ -f ${DEB_BIOS} && -z ${BIOS} ]] && BIOS=${DEB_BIOS} + QEMU_ARCH_ARGS=( + -bios "${BIOS:-default}" + -M virt + ) + QEMU=(qemu-system-riscv64) + ;; + x86 | x86_64) KIMAGE=bzImage APPEND_STRING+="console=ttyS0 " diff --git a/buildroot/rebuild.sh b/buildroot/rebuild.sh index d15b536..9801aac 100755 --- a/buildroot/rebuild.sh +++ b/buildroot/rebuild.sh @@ -32,7 +32,7 @@ CONFIGS=() while ((${#})); do case ${1} in all) for CONFIG in *.config; do CONFIGS+=("../${CONFIG}"); done ;; - arm64 | arm | mips | mipsel | ppc32 | ppc64 | ppc64le | x86 | x86_64) CONFIGS+=("../${1}.config") ;; + arm64 | arm | mips | mipsel | ppc32 | ppc64 | ppc64le | riscv | x86 | x86_64) CONFIGS+=("../${1}.config") ;; *) die "Unknown parameter '${1}', exiting!" ;; esac shift diff --git a/buildroot/riscv.config b/buildroot/riscv.config new file mode 100644 index 0000000..cdd1afc --- /dev/null +++ b/buildroot/riscv.config @@ -0,0 +1,10 @@ +BR2_riscv=y +BR2_OPTIMIZE_3=y +BR2_BINUTILS_VERSION_2_31_X=y +BR2_TARGET_GENERIC_ROOT_PASSWD="root" +BR2_TARGET_GENERIC_GETTY_PORT="ttyS0" +BR2_ROOTFS_OVERLAY="../overlay-poweroff" +BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y +BR2_PACKAGE_BASH=y +BR2_TARGET_ROOTFS_CPIO=y +# BR2_TARGET_ROOTFS_TAR is not set diff --git a/images/riscv/rootfs.cpio.zst b/images/riscv/rootfs.cpio.zst new file mode 100644 index 0000000..e3febd8 Binary files /dev/null and b/images/riscv/rootfs.cpio.zst differ