Skip to content

Commit

Permalink
scripts: Change kernel and rpm build directory to $RV_TOP_DIR/build/$…
Browse files Browse the repository at this point in the history
…CHIP/

Signed-off-by: Xiaoguang Xing <[email protected]>
  • Loading branch information
xingxg2022 committed Nov 19, 2024
1 parent 2eb4b78 commit d4a29ab
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions scripts/envsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d4a29ab

Please sign in to comment.