diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh index 20c7f64a..3485c007 100755 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh @@ -56,7 +56,7 @@ RV_GRUB_BUILD_DIR=$RV_TOP_DIR/grubriscv64 RV_KERNEL_SRC_DIR=$RV_TOP_DIR/linux-riscv -RV_KERNEL_BUILD_DIR=$RV_KERNEL_SRC_DIR/build/$CHIP/$KERNEL_VARIANT +RV_KERNEL_BUILD_DIR=$RV_TOP_DIR/build/$CHIP/linux-riscv/$KERNEL_VARIANT # RV_KERNEL_BUILD_DIR should only be used inside build/clean kernel functions RV_RAMDISK_DIR=$RV_TOP_DIR/bootloader-riscv/ramdisk @@ -690,7 +690,7 @@ function build_rv_kernel() return -1 fi RV_KERNEL_CONFIG=${VENDOR}_${CHIP}_$1_${KERNEL_VARIANT}_defconfig - RV_KERNEL_BUILD_DIR=$RV_KERNEL_SRC_DIR/build/$CHIP/$1_${KERNEL_VARIANT} + RV_KERNEL_BUILD_DIR=$RV_TOP_DIR/build/$CHIP/linux-riscv/$1_${KERNEL_VARIANT} fi pushd $RV_KERNEL_SRC_DIR @@ -779,7 +779,7 @@ function build_rv_ubuntu_kernel() { local RV_KERNEL_CONFIG=${VENDOR}_${CHIP}_ubuntu_defconfig local err - RV_KERNEL_BUILD_DIR=$RV_KERNEL_SRC_DIR/build/$CHIP/ubuntu + RV_KERNEL_BUILD_DIR=$RV_TOP_DIR/build/$CHIP/linux-riscv/ubuntu pushd $RV_KERNEL_SRC_DIR make O=$RV_KERNEL_BUILD_DIR ARCH=riscv CROSS_COMPILE=$RISCV64_LINUX_CROSS_COMPILE $RV_KERNEL_CONFIG @@ -820,7 +820,7 @@ function build_rv_ubuntu_kernel() function clean_rv_ubuntu_kernel() { - RV_KERNEL_BUILD_DIR=$RV_KERNEL_SRC_DIR/build/$CHIP/ubuntu + RV_KERNEL_BUILD_DIR=$RV_TOP_DIR/build/$CHIP/linux-riscv/ubuntu rm -rf $RV_KERNEL_BUILD_DIR rm -f $RV_DEB_INSTALL_DIR/linux-*.deb } @@ -831,7 +831,7 @@ function build_rv_fedora_kernel() local KERNELRELEASE local RPMBUILD_DIR local err - RV_KERNEL_BUILD_DIR=$RV_KERNEL_SRC_DIR/build/$CHIP/fedora + RV_KERNEL_BUILD_DIR=$RV_TOP_DIR/build/$CHIP/linux-riscv/fedora pushd $RV_KERNEL_SRC_DIR make ARCH=riscv CROSS_COMPILE=$RISCV64_LINUX_CROSS_COMPILE $RV_KERNEL_CONFIG @@ -859,7 +859,7 @@ EOT if [[ ${KERNELRELEASE:0:3} == "6.1" ]]; then RPMBUILD_DIR=$HOME/rpmbuild else - RPMBUILD_DIR=$RV_KERNEL_SRC_DIR/rpmbuild + RPMBUILD_DIR=$RV_TOP_DIR/build/$CHIP/rpmbuild fi make -j$(nproc) ARCH=riscv CROSS_COMPILE=$RISCV64_LINUX_CROSS_COMPILE LOCALVERSION="" rpm-pkg @@ -892,7 +892,7 @@ EOT function clean_rv_fedora_kernel() { - RV_KERNEL_BUILD_DIR=$RV_KERNEL_SRC_DIR/build/$CHIP/fedora + RV_KERNEL_BUILD_DIR=$RV_TOP_DIR/build/$CHIP/linux-riscv/fedora pushd $RV_KERNEL_SRC_DIR make distclean popd @@ -905,7 +905,7 @@ function build_rv_euler_kernel() local KERNELRELEASE local RPMBUILD_DIR local err - RV_KERNEL_BUILD_DIR=$RV_KERNEL_SRC_DIR/build/$CHIP/euler + RV_KERNEL_BUILD_DIR=$RV_TOP_DIR/build/$CHIP/linux-riscv/euler pushd $RV_KERNEL_SRC_DIR make ARCH=riscv CROSS_COMPILE=$RISCV64_LINUX_CROSS_COMPILE $RV_KERNEL_CONFIG @@ -933,7 +933,7 @@ EOT if [[ ${KERNELRELEASE:0:3} == "6.1" ]]; then RPMBUILD_DIR=$HOME/rpmbuild else - RPMBUILD_DIR=$RV_KERNEL_SRC_DIR/rpmbuild + RPMBUILD_DIR=$RV_TOP_DIR/build/$CHIP/rpmbuild fi make -j$(nproc) ARCH=riscv CROSS_COMPILE=$RISCV64_LINUX_CROSS_COMPILE LOCALVERSION="" rpm-pkg @@ -966,7 +966,7 @@ EOT function clean_rv_euler_kernel() { - RV_KERNEL_BUILD_DIR=$RV_KERNEL_SRC_DIR/build/$CHIP/euler + RV_KERNEL_BUILD_DIR=$RV_TOP_DIR/build/$CHIP/linux-riscv/euler pushd $RV_KERNEL_SRC_DIR make distclean popd