-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #508 from ChinYikMing/feat/bring-up-linux
Bring up Linux kernel
- Loading branch information
Showing
35 changed files
with
5,018 additions
and
341 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
function cleanup { | ||
sleep 1 | ||
pkill -9 rv32emu | ||
} | ||
|
||
function ASSERT { | ||
$* | ||
local RES=$? | ||
if [ $RES -ne 0 ]; then | ||
echo 'Assert failed: "' $* '"' | ||
exit $RES | ||
fi | ||
} | ||
|
||
cleanup | ||
|
||
TIMEOUT=50 | ||
OPTS=" -k build/linux-image/Image " | ||
OPTS+=" -i build/linux-image/rootfs.cpio " | ||
OPTS+=" -b build/minimal.dtb " | ||
RUN_LINUX="build/rv32emu ${OPTS}" | ||
|
||
ASSERT expect <<DONE | ||
set timeout ${TIMEOUT} | ||
spawn ${RUN_LINUX} | ||
expect "buildroot login:" { send "root\n" } timeout { exit 1 } | ||
expect "# " { send "uname -a\n" } timeout { exit 2 } | ||
expect "riscv32 GNU/Linux" { send "\x01"; send "x" } timeout { exit 3 } | ||
DONE | ||
|
||
ret=$? | ||
cleanup | ||
|
||
MESSAGES=("OK!" \ | ||
"Fail to boot" \ | ||
"Fail to login" \ | ||
"Fail to run commands" \ | ||
) | ||
|
||
COLOR_G='\e[32;01m' # Green | ||
COLOR_N='\e[0m' # No color | ||
printf "\n[ ${COLOR_G}${MESSAGES[$ret]}${COLOR_N} ]\n" | ||
|
||
exit ${ret} |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
BR2_riscv=y | ||
BR2_ARCH="riscv32" | ||
BR2_NORMALIZED_ARCH="riscv" | ||
BR2_ENDIAN="LITTLE" | ||
BR2_GCC_TARGET_ABI="ilp32" | ||
BR2_READELF_ARCH_NAME="RISC-V" | ||
BR2_RISCV_ISA_RVI=y | ||
BR2_RISCV_ISA_RVM=y | ||
BR2_RISCV_ISA_RVA=y | ||
# BR2_riscv_g is not set | ||
BR2_riscv_custom=y | ||
BR2_RISCV_ISA_CUSTOM_RVM=y | ||
BR2_RISCV_ISA_CUSTOM_RVA=y | ||
# BR2_RISCV_ISA_CUSTOM_RVF is not set | ||
# BR2_RISCV_ISA_CUSTOM_RVC is not set | ||
BR2_RISCV_32=y | ||
# BR2_RISCV_64 is not set | ||
BR2_RISCV_ABI_ILP32=y | ||
BR2_BINFMT_ELF=y | ||
BR2_TOOLCHAIN_BUILDROOT_VENDOR="buildroot" | ||
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y | ||
BR2_TOOLCHAIN_BUILDROOT_LIBC="glibc" | ||
# BR2_TOOLCHAIN_BUILDROOT_CXX is not set | ||
BR2_KERNEL_HEADERS_6_1=y | ||
BR2_BINUTILS_VERSION_2_42_X=y | ||
# BR2_BINUTILS_GPROFNG is not set | ||
BR2_GCC_VERSION_14_X=y | ||
BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-softfloat" | ||
BR2_TOOLCHAIN_HEADERS_AT_LEAST="6.1" | ||
BR2_TOOLCHAIN_GCC_AT_LEAST_14=y | ||
BR2_TOOLCHAIN_GCC_AT_LEAST="14" | ||
BR2_SSP_NONE=y | ||
# BR2_SSP_REGULAR is not set | ||
# BR2_SSP_STRONG is not set | ||
BR2_RELRO_NONE=y | ||
# BR2_RELRO_PARTIAL is not set | ||
# BR2_RELRO_FULL is not set | ||
BR2_FORTIFY_SOURCE_1=y | ||
# BR2_PACKAGE_URANDOM_SCRIPTS is not set | ||
BR2_TARGET_ROOTFS_CPIO=y | ||
BR2_TARGET_ROOTFS_CPIO_FULL=y | ||
# BR2_TARGET_ROOTFS_CPIO_DRACUT is not set | ||
BR2_TARGET_ROOTFS_CPIO_NONE=y | ||
# BR2_TARGET_ROOTFS_TAR is not set | ||
BR2_PACKAGE_BUSYBOX_CONFIG="busybox.config" | ||
BR2_PACKAGE_COREMARK=y | ||
BR2_PACKAGE_DHRYSTONE=y |
Oops, something went wrong.