From 6dc751bd49c7464b46539a200315bec35879b768 Mon Sep 17 00:00:00 2001 From: Cjacker Date: Thu, 2 Mar 2023 21:58:03 +0800 Subject: [PATCH 1/2] add old config for make menuconfig, otherwise it will try to genenate config from /boot/config-kernelver of host --- build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 129eda480..37781d3f6 100755 --- a/build.sh +++ b/build.sh @@ -35,6 +35,12 @@ build_linux_config() echo " " echo "============ build linux kernel config =============" cd $SHELL_DIR/linux-5.10.4-808 + # add old config for make menuconfig, + # otherwise it will take config from /boot/config- of host, + # and kernel building will fail. + if [ ! -f .config ]; then + cp c906.config .config + fi make ARCH=riscv CROSS_COMPILE=$LINUX_CROSS_PREFIX menuconfig -j$(nproc) } @@ -153,4 +159,4 @@ all) esac echo " " -echo "===================== build done =======================" \ No newline at end of file +echo "===================== build done =======================" From e14a00e78e5c0ef619ebe88c3f2b624615b4a3f4 Mon Sep 17 00:00:00 2001 From: Cjacker Date: Thu, 2 Mar 2023 22:03:14 +0800 Subject: [PATCH 2/2] if no arg given, show help --- build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 37781d3f6..0f8a3c244 100755 --- a/build.sh +++ b/build.sh @@ -9,7 +9,12 @@ CMAKE=$SHELL_DIR/toolchain/cmake/bin/ LINUX_CROSS_PREFIX=$SHELL_DIR/toolchain/linux_toolchain/bin/riscv64-unknown-linux-gnu- NEWLIB_ELF_CROSS_PREFIX=$SHELL_DIR/toolchain/elf_newlib_toolchain/bin/riscv64-unknown-elf- -BUILD_TARGET=$1 +# if no arg given +if [ $# -ne 1 ]; then + BUILD_TARGET="--help" +else + BUILD_TARGET=$1 +fi if [[ ! -e $OUT_DIR ]]; then mkdir $OUT_DIR